Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
## Checklist

*Do not delete any line. Leave **unfinished** elements unchecked so others know how far along you are.\
In the end all checkboxes must be ticked before you can merge*.
In the end all checkboxes must be ticked before you can merge*. (You may skip this list if only .md files are changed.)

- [ ] **I executed the automated model tests (`make test`) after my final commit and all tests pass (`FAIL 0`)**
- [ ] **I adjusted the reporting in [`remind2`](https://github.com/pik-piam/remind2) if and where it was needed**
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/check-pr-description-code.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
on:
pull_request:
types: [opened, reopened, edited, ready_for_review]
branches-ignore:
- 'master'
paths-ignore:
- '**.md'

name: check-pr-checklist

jobs:
check-pr-checklist:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Check PR Checklist
env:
PR_DESCRIPTION: ${{ github.event.pull_request.body }}
run: |
ERROR_FOUND=0

# Check 1: All checkboxes in "Checklist" must be checked
CHECKLIST_SECTION=$(echo "$PR_DESCRIPTION" | sed -n '/## Checklist/,/## Further information (optional)/p')
if echo "$CHECKLIST_SECTION" | grep -q "\[ \]"; then
echo "ERROR: Unchecked checkboxes found in 'Checklist' section."
echo "All checklist items must be checked before merging."
ERROR_FOUND=1
fi

if [ $ERROR_FOUND -eq 1 ]; then
exit 1
fi

echo "Success: All PR template requirements are fulfilled."
18 changes: 7 additions & 11 deletions .github/workflows/check-pr-description.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@ on:
types: [opened, reopened, edited, ready_for_review]
branches-ignore:
- 'master'
paths-ignore:
- '**.md'

name: check-pr-description

jobs:
check-pr-template:
check-pr-code-tasks:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Check PR description
- name: Check PR Description
env:
PR_DESCRIPTION: ${{ github.event.pull_request.body }}
run: |
Expand All @@ -31,16 +35,8 @@ jobs:
ERROR_FOUND=1
fi

# Check 3: All checkboxes in "Checklist" must be checked
CHECKLIST_SECTION=$(echo "$PR_DESCRIPTION" | sed -n '/## Checklist/,/## Further information (optional)/p')
if echo "$CHECKLIST_SECTION" | grep -q "\[ \]"; then
echo "ERROR: Unchecked checkboxes found in 'Checklist' section."
echo "All checklist items must be checked before merging."
ERROR_FOUND=1
fi

if [ $ERROR_FOUND -eq 1 ]; then
exit 1
fi

echo "Success: All PR template requirements are fulfilled."
echo "Success: All PR template requirements are fulfilled."