-
Notifications
You must be signed in to change notification settings - Fork 7
32 lines (29 loc) · 1.17 KB
/
pr-dependencies.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
name: Check PR Dependencies
on:
pull_request:
branches: ["main"]
types: [opened, edited]
jobs:
dependencies:
runs-on: ubuntu-20.04
steps:
- id: num-checks-total
name: Set total checks
run: echo "::set-output name=total::$(gh pr view $PR_NUMBER --repo $REPO --json body | grep -o "\[.\]" | wc -l)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repositoryUrl }}
PR_NUMBER: ${{github.event.number}}
- id: num-checks-checked
name: Set checked checks
run: echo "::set-output name=checked::$(gh pr view $PR_NUMBER --repo $REPO --json body | grep -o "\[x\]" | wc -l)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repositoryUrl }}
PR_NUMBER: ${{github.event.number}}
- if: ${{steps.num-checks-total.outputs.total == steps.num-checks-checked.outputs.checked}}
name: Pass
run: echo "All checks have been checked" && exit 0
- if: ${{steps.num-checks-total.outputs.total != steps.num-checks-checked.outputs.checked}}
name: Fail
run: echo "Some checks still need to be checked" && exit 1