Change our workflow so that PRs to docs are included in changeset comments #2468
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Fails if a PR doesn't link to the docs repo and is not labeled as "no docs needed". | |
| # Docs PR links must be in changeset frontmatters (as `# docs:` YAML comments), not in the PR body. | |
| # Docs issue links must be in the PR body. | |
| name: Check that the PR links to documentation | |
| on: | |
| merge_group: | |
| pull_request: | |
| branches: | |
| - main | |
| - v2 | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| - labeled | |
| - unlabeled | |
| - edited | |
| jobs: | |
| check-links-to-docs: | |
| name: Check that PR links to documentation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout the repository | |
| uses: actions/checkout@v5 | |
| - name: Set up the environment | |
| uses: ./.github/actions/setup-env | |
| # We need to fetch the base ref because the pull request check inspects the diff between the head and the base ref | |
| - run: git fetch origin "$GITHUB_BASE_REF":"$GITHUB_BASE_REF" | |
| - name: Check if PR links to documentation | |
| if: github.event_name == 'pull_request' | |
| env: | |
| GITHUB_EVENT_PULL_REQUEST_LABELS: ${{ toJson(github.event.pull_request.labels) }} | |
| GITHUB_EVENT_PULL_REQUEST_BODY: ${{ github.event.pull_request.body }} | |
| run: node scripts/validate-pull-request-docs.ts |