forked from ministryofjustice/cloud-platform-environments
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (36 loc) · 1.24 KB
/
auto-approve-pr.yaml
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 a pull request
on:
pull_request
jobs:
checksum-compare:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- name: Checkout PR code
uses: actions/checkout@v4
- name: Get changes and save to json
id: get_changes
uses: lots0logs/[email protected]
with:
token: "${{ secrets.GITHUB_TOKEN }}"
- name: Copy json so dir_hash can read contents
run: |
mkdir ${HOME}/work/_temp/_github_home
cp ${HOME}/files.json ${HOME}/work/_temp/_github_home/.
- name: Run check
id: dir_hash
uses: ministryofjustice/cloud-platform-directory-hash@main
- name: Comment PR
uses: vinodsai-a/actions-comment-pull-request@master
if: steps.dir_hash.outputs.checksum_match == 'true'
with:
message: 'Auto-approve has deemed this PR worthy!'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# When we're ready to auto-approve the PR
# - name: Approving PR
# uses: hmarr/[email protected]
# if: steps.dir_hash.outputs.checksum_match == 'true'
# with:
# github-token: "${{ secrets.GITHUB_TOKEN }}"