diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..184208b74 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,4 @@ +### Docs Checklist +Please ensure you have addressed documentation updates if needed as part of this PR: +- [ ] I have created a separate PR on the sequence docs repository for documentation updates: [Link to docs PR](https://github.com/0xsequence/docs/pulls) +- [ ] No documentation update is needed for this change. diff --git a/.github/workflows/validate-pr-template.yml b/.github/workflows/validate-pr-template.yml new file mode 100644 index 000000000..49768f795 --- /dev/null +++ b/.github/workflows/validate-pr-template.yml @@ -0,0 +1,27 @@ +name: Validate Docs PR Template + +on: + pull_request: + types: [opened, edited, synchronize] + +jobs: + validate-template: + runs-on: ubuntu-latest + + steps: + - name: Check PR Template Completion + run: | + # Fetch the pull request body + PR_BODY=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ + -H "Accept: application/vnd.github.v3+json" \ + https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }} \ + | jq -r '.body') + + # Check if one of the required checkboxes in the 'Docs Checklist' is marked + 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 + echo "Error: The 'Docs Checklist' section in the PR template has not been completed properly." + echo "Please ensure you have checked one of the options in the 'Docs Checklist' section." + exit 1 + fi + + echo "Docs Checklist is complete."