-
Notifications
You must be signed in to change notification settings - Fork 37
37 lines (31 loc) · 1.12 KB
/
pr_tasks_check.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
name: PR Checkboxes
on:
pull_request:
types:
- opened
- synchronize
- ready_for_review
- reopened
- edited
jobs:
pr_tasks_check:
name: All PR checkboxes marked completed
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v4
- name: All tasks completed
run: |
# Get PR data including body and labels
PR_DATA=$(gh pr view ${{ github.event.pull_request.number }} --json body)
# Extract PR body
PR_BODY=$(echo "$PR_DATA" | jq -r .body)
# Check for unchecked tasks (- [ ])
if echo "$PR_BODY" | grep -q "\s*-\s*\[ \]"; then
echo "Error: The following checkboxes are not marked as completed:"
echo "$PR_BODY" | grep "\s*-\s*\[ \]"
exit 1
fi
echo "All tasks completed"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}