Skip to content

Commit

Permalink
Split make linkcheck out into a distinct job [#106]
Browse files Browse the repository at this point in the history
Also add `continue-on-error-comment` step, so that if linkcheck fails,
a comment will be added to the PR, instead of a silent failure with a
green check.
  • Loading branch information
genehack committed Sep 3, 2024
1 parent 654db55 commit 83e03d5
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/docs-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ on:
type: string
default: html

permissions:
pull-requests: write
env:
# Used for `make` steps.
# -n: warn on missing references
Expand Down Expand Up @@ -68,9 +70,6 @@ jobs:
- run: make ${{ inputs.make-target }}
working-directory: ${{ inputs.docs-directory }}

- run: make linkcheck
working-directory: ${{ inputs.docs-directory }}

build-pip:
if: inputs.pip-install-target != ''
runs-on: ubuntu-latest
Expand All @@ -86,5 +85,22 @@ jobs:
- run: make ${{ inputs.make-target }}
working-directory: ${{ inputs.docs-directory }}

- run: make linkcheck
linkcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: ${{ inputs.repo }}

- run: pip install '${{ inputs.pip-install-target }}'

- id: linkcheck
run: make linkcheck
working-directory: ${{ inputs.docs-directory }}
continue-on-error: true

- uses: mainmatter/continue-on-error-comment@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
outcome: ${{ steps.linkcheck.outcome }}
test-id: Linkcheck error: ${{ matrix.code }}

0 comments on commit 83e03d5

Please sign in to comment.