Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add action to check for dead links #3992

Merged
merged 11 commits into from
Jan 11, 2024
11 changes: 11 additions & 0 deletions .github/DEAD_LINKS_IN_DOCS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: "Docs contains dead links"
assignees: signorecello catmcgee critesjosh jzaki Savio-Sou
labels: documentation
---

Some of the external links in the docs are now dead. This is likely due to the thing being linked to being moved.

Check the [Check Markdown links]({{env.WORKFLOW_URL}}) workflow for details.

This issue was raised by the workflow `{{env.WORKFLOW_NAME}}`
11 changes: 0 additions & 11 deletions .github/NIGHTLY_TEST_FAILURE.md

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/docs-dead-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Check Markdown links

on:
schedule:
# Run a check at 9 AM UTC
- cron: "0 9 * * *"

# This will cancel previous runs when a branch or PR is updated
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }}
cancel-in-progress: true


jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-quiet-mode: 'yes'
config-file: ./docs/link-check.config.json
folder-path: ./docs

# Raise an issue if the previous step failed due to dead links being found
- name: Alert on dead links
uses: JasonEtco/create-an-issue@v2
if: ${{ failure() }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WORKFLOW_NAME: ${{ github.workflow }}
WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/job/${{ github.job }}
with:
update_existing: true
filename: .github/DEAD_LINKS_IN_DOCS.md
7 changes: 7 additions & 0 deletions docs/link-check.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"ignorePatterns": [
{
"pattern": "^[^\/]+\/[^\/].*$|^\/[^\/].*$"
}
]
}