Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
12 changes: 12 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Checklist

- [ ] I have tested the changes in both light and dark mode.
- [ ] I have run all unit tests and ensured they pass.
- [ ] I have considered the need for new unit tests.
- [ ] I have tested the changes on a cluster.
- [ ] I have included relevant documentation updates.
- [ ] I have an approved Figma design or have reflected my changes in Figma
- [ ] I have verified that the UI/UX is consistent in major browsers (e.g., Chrome, Firefox, Safari, Edge).
- [ ] I have tested the changes on mobile devices or simulators to ensure responsiveness.
- [ ] I have tested expected error states and verified that the user is presented with informative error messages.
- [ ] I have tested the feature with unusual or extreme inputs (e.g., very long strings, empty states, clicking a button multiple times quickly).
40 changes: 40 additions & 0 deletions .github/workflows/checklist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Enforce Checklist

on:
pull_request:
types: [opened, edited, synchronize]

jobs:
check-checklist:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2

# Extract the PR body directly from the GitHub event payload
- name: Validate Checklist
run: |
# Use jq to parse the pull_request body from the event payload
PR_BODY=$(jq -r .pull_request.body "$GITHUB_EVENT_PATH")

# 1. Check for "## Checklist" section
if ! echo "$PR_BODY" | grep -q "^## Checklist"; then
echo "No '## Checklist' section found in the PR description."
exit 1
fi

# 2. Check that there is at least one checkbox line
CHECKBOX_COUNT=$(echo "$PR_BODY" | grep "^- \[" | wc -l)
if [ "$CHECKBOX_COUNT" -eq 0 ]; then
echo "No checklist items found under '## Checklist'."
exit 1
fi

# 3. Ensure all checkbox items are ticked
UNCHECKED_COUNT=$(echo "$PR_BODY" | grep "^- \[ \]" | wc -l)
if [ "$UNCHECKED_COUNT" -gt 0 ]; then
echo "Not all checklist items are checked. Please tick all boxes."
exit 1
fi

echo "All checks passed. The checklist is present and fully checked."
Loading