-
Notifications
You must be signed in to change notification settings - Fork 43
41 lines (34 loc) · 1.13 KB
/
auto-approve-pr.yml
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
name: Auto-approve a pull request
on:
pull_request
env:
PR_OWNER: ${{ github.event.pull_request.user.login }}
GITHUB_OAUTH_TOKEN: ${{ secrets.DOCUMENT_REVIEW_GITHUB }}
TEAM_NAME: "WebOps"
jobs:
check-diff:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- name: Checkout PR code
uses: actions/checkout@v4
- run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
- name: Run git diff against repository
run: |
git diff origin/main HEAD > changes
- name: Auto-approval check
id: approve_pr_check
uses: ministryofjustice/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_OWNER: ${{ github.event.pull_request.user.login }}
GITHUB_OAUTH_TOKEN: ${{ secrets.DOCUMENT_REVIEW_GITHUB }}
TEAM_NAME: "WebOps"
- name: Approving PR
uses: hmarr/auto-approve-action@v4
if: steps.approve_pr_check.outputs.review_pr == 'true'
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"