Skip to content

Commit 084c2f9

Browse files
Added docs check pr template and github action (#227)
1 parent d882f9c commit 084c2f9

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

.github/pull_request_template.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
### Docs Checklist
2+
Please ensure you have addressed documentation updates if needed as part of this PR:
3+
- [ ] I have created a separate PR on the sequence docs repository for documentation updates: [Link to docs PR](https://github.com/0xsequence/docs/pulls)
4+
- [ ] No documentation update is needed for this change.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Validate Docs PR Template
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, synchronize]
6+
7+
jobs:
8+
validate-template:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Check PR Template Completion
13+
run: |
14+
# Fetch the pull request body
15+
PR_BODY=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
16+
-H "Accept: application/vnd.github.v3+json" \
17+
https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }} \
18+
| jq -r '.body')
19+
20+
# Check if one of the required checkboxes in the 'Docs Checklist' is marked
21+
if ! echo "$PR_BODY" | grep -Eq '\[x\] I have created a separate PR on the sequence docs repository for documentation updates|\[x\] No documentation update is needed for this change'; then
22+
echo "Error: The 'Docs Checklist' section in the PR template has not been completed properly."
23+
echo "Please ensure you have checked one of the options in the 'Docs Checklist' section."
24+
exit 1
25+
fi
26+
27+
echo "Docs Checklist is complete."

0 commit comments

Comments
 (0)