-
Notifications
You must be signed in to change notification settings - Fork 13
47 lines (37 loc) · 1.13 KB
/
auto-review.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
42
43
44
45
46
47
name: Auto-approve date change only PR
on:
pull_request:
paths:
- "source/**"
env:
PR_OWNER: ${{ github.event.pull_request.user.login }}
GITHUB_OAUTH_TOKEN: ${{ secrets.GH_BOT_PAT_TOKEN }}
TEAM_NAME: "operations-engineering"
jobs:
check-diff:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
if: ${{ github.actor != 'dependabot[bot]' }}
steps:
- name: Checkout PR code
uses: actions/checkout@v4
- run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
- name: owner of PR
run: |
echo "$PR_OWNER"
- name: Run git diff against repository
run: |
git diff origin/main HEAD > changes
- name: Auto-approval check
id: approve_pr_check
uses: ministryofjustice/cloud-platform-doc-checker@main
env:
GITHUB_TOKEN: ${{ secrets.OPS_BOT_TOKEN }}
- name: Approving PR
uses: hmarr/auto-approve-action@v3
if: steps.approve_pr_check.outputs.review_pr == 'true'
with:
github-token: "${{ secrets.OPS_BOT_TOKEN }}"