-
Notifications
You must be signed in to change notification settings - Fork 416
52 lines (50 loc) · 1.57 KB
/
pull-request-automation.yaml
File metadata and controls
52 lines (50 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Auto review, merge and close pull requests
on:
pull_request:
types:
- opened
- reopened
jobs:
auto-merge:
name: Auto review pull requests from bots
runs-on: ubuntu-22.04
timeout-minutes: 5
permissions:
pull-requests: write
steps:
- name: Print event
run: echo "${GITHUB}" | jq
env:
GITHUB: ${{ toJson(github) }}
- name: Print context
uses: actions/github-script@v8
with:
script: |-
console.log(context);
- name: Auto review GHCI updates
uses: actions/github-script@v8
if: |-
startsWith(github.head_ref, 'ghci/audit/')
&& (github.event.pull_request.user.login == 'geo-ghci-test[bot]'
|| github.event.pull_request.user.login == 'geo-ghci-int[bot]'
|| github.event.pull_request.user.login == 'geo-ghci[bot]')
with:
script: |-
github.rest.pulls.createReview({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
event: 'APPROVE',
})
- name: Auto review Renovate updates
uses: actions/github-script@v8
if: |-
github.event.pull_request.user.login == 'renovate[bot]'
with:
script: |-
github.rest.pulls.createReview({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.payload.pull_request.number,
event: 'APPROVE',
})