Repository navigation
Bump next from 16.3.8 to 16.4.1 #11
Workflow file for this run
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
| name: 'Link Check: On PR' | |
| # Catch broken internal links in changed content files before merge. | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| issues: write | |
| # Cancel older runs for the same ref to save runner time. | |
| concurrency: | |
| group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | |
| cancel-in-progress: true | |
| jobs: | |
| check-links: | |
| name: Check links | |
| runs-on: ubuntu-latest | |
| if: github.repository == 'github/docs-internal' || github.repository == 'github/docs' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| # Fetch 2 commits so tj-actions/changed-files can diff without extra API calls. | |
| fetch-depth: 2 | |
| - uses: ./.github/actions/node-npm-setup | |
| - uses: ./.github/actions/get-docs-early-access | |
| if: ${{ github.repository == 'github/docs-internal' }} | |
| with: | |
| token: ${{ secrets.DOCS_BOT_PAT_BASE }} | |
| - name: Get changed files | |
| id: changed-files | |
| uses: tj-actions/changed-files@22103cc46bda19c2b464ffe86db46df6922fd323 # v47.0.5 | |
| with: | |
| files: | | |
| content/**/*.md | |
| data/**/*.md | |
| - name: Check links in changed files | |
| if: steps.changed-files.outputs.any_changed == 'true' | |
| env: | |
| FILES_CHANGED: ${{ steps.changed-files.outputs.all_changed_files }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| ACTION_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
| SHOULD_COMMENT: ${{ secrets.DOCS_BOT_PAT_BASE != '' }} | |
| FAIL_ON_FLAW: true | |
| # Cross-page anchor failures appear in PR comments, but rollout keeps them | |
| # from failing builds while false-positive and performance rates settle. | |
| CHECK_ANCHORS: true | |
| FAIL_ON_ANCHOR_FLAW: false | |
| ENABLED_LANGUAGES: en | |
| run: npm run check-links-pr | |
| - name: No content changes | |
| if: steps.changed-files.outputs.any_changed != 'true' | |
| run: echo "No content files changed. Skipping link check." |