-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (39 loc) · 1.41 KB
/
pr-checkbox.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
name: Check PR Checkboxes
on:
pull_request:
types: [opened, edited, synchronize]
jobs:
check-pr-body:
runs-on: ubuntu-latest
outputs:
run_lint: ${{ steps.check.outputs.run_lint }}
run_build: ${{ steps.check.outputs.run_build }}
run_utest: ${{ steps.check.outputs.run_utest }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check PR body for checkboxes
id: check
run: |
PR_BODY=$(jq -r '.pull_request.body' "$GITHUB_EVENT_PATH")
if echo "$PR_BODY" | grep -q '\- \[ \] Stop Lint'; then
echo "run_lint=true" >> $GITHUB_ENV
echo "::set-output name=run_lint::true"
else
echo "run_lint=false" >> $GITHUB_ENV
echo "::set-output name=run_lint::false"
fi
if echo "$PR_BODY" | grep -q '\- \[ \] Stop Build'; then
echo "run_build=true" >> $GITHUB_ENV
echo "::set-output name=run_build::true"
else
echo "run_build=false" >> $GITHUB_ENV
echo "::set-output name=run_build::false"
fi
if echo "$PR_BODY" | grep -q '\- \[ \] Stop Unit Tests'; then
echo "run_utest=true" >> $GITHUB_ENV
echo "::set-output name=run_utest::true"
else
echo "run_utest=false" >> $GITHUB_ENV
echo "::set-output name=run_utest::false"
fi