Skip to content

Commit 96cea9a

Browse files
enforce-pr-checklist.yml - TODO to configure as required status check before merging (in https://github.com/NatLabRockies/GEOPHIRES-X/settings/branch_protection_rules/50222740)
1 parent 60779a2 commit 96cea9a

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Enforce PR Checklist
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, synchronize]
6+
7+
jobs:
8+
verify-pr-checklist:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Verify checklist items in the PR description
12+
env:
13+
PR_BODY: ${{ github.event.pull_request.body }}
14+
run: |
15+
# Use grep to look for the checked box (handles lowercase 'x' or uppercase 'X')
16+
if echo "$PR_BODY" | grep -Eq '\[[xX]\] I certify that I am a human'; then
17+
echo "Required PR description checklist items verified. Passing."
18+
exit 0
19+
else
20+
echo "::error::Merge blocked. Please review the applicable checklist items in your PR description. (If you have removed the checklist items from your description, please re-add them from the template: https://github.com/NREL/GEOPHIRES-X/blob/main/.github/pull_request_template.md#change-checklist)"
21+
exit 1
22+
fi

0 commit comments

Comments
 (0)