Linkcheck #110
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: Linkcheck | |
| on: | |
| schedule: | |
| - cron: '1 2 * * 3' | |
| workflow_dispatch: | |
| jobs: | |
| linkcheck: | |
| name: Linkcheck | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup Nix Environment | |
| uses: ./.github/actions/setup-nix | |
| with: | |
| authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | |
| tools: docs.linkcheck.bin | |
| - name: Run Linkcheck | |
| id: linkcheck | |
| run: postgrest-docs-linkcheck | |
| # This actions creates the github token using the postgrest app secrets | |
| - name: Create Github App Token (Runs only on linkcheck failure) | |
| id: app-token | |
| if: ${{ failure() && steps.linkcheck.outcome == 'failure' }} # only create the token on linkcheck failure | |
| uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 | |
| with: | |
| app-id: ${{ vars.POSTGREST_CI_APP_ID }} | |
| private-key: ${{ secrets.POSTGREST_CI_PRIVATE_KEY }} | |
| permission-issues: write # required for commenting on issues | |
| - name: Notify on linkcheck failure by commenting on GH Issue 4106 | |
| if: ${{ failure() && steps.linkcheck.outcome == 'failure' }} | |
| uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0 | |
| with: | |
| token: ${{ steps.app-token.outputs.token }} | |
| issue-number: 4106 | |
| body: | | |
| **Linkcheck Job Failed!** | |
| A broken link was detected in the docs. Please check the [failed run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for details. |