Skip to content

Commit 29f704f

Browse files
authored
chore: add action to check for dead links (#3992)
# Description ## Problem\* Resolves <!-- Link to GitHub Issue --> ## Summary\* Testing this atm ## Additional Context ## Documentation\* Check one: - [ ] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[Exceptional Case]** Documentation to be submitted in a separate PR. # PR Checklist\* - [ ] I have tested the changes locally. - [ ] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings.
1 parent b4e1ed2 commit 29f704f

4 files changed

Lines changed: 53 additions & 11 deletions

File tree

.github/DEAD_LINKS_IN_DOCS.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: "Docs contains dead links"
3+
assignees: signorecello catmcgee critesjosh jzaki Savio-Sou
4+
labels: documentation
5+
---
6+
7+
Some of the external links in the docs are now dead. This is likely due to the thing being linked to being moved.
8+
9+
Check the [Check Markdown links]({{env.WORKFLOW_URL}}) workflow for details.
10+
11+
This issue was raised by the workflow `{{env.WORKFLOW_NAME}}`

.github/NIGHTLY_TEST_FAILURE.md

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Check Markdown links
2+
3+
on:
4+
schedule:
5+
# Run a check at 9 AM UTC
6+
- cron: "0 9 * * *"
7+
8+
# This will cancel previous runs when a branch or PR is updated
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }}
11+
cancel-in-progress: true
12+
13+
14+
jobs:
15+
markdown-link-check:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@master
19+
- uses: gaurav-nelson/github-action-markdown-link-check@v1
20+
with:
21+
use-quiet-mode: 'yes'
22+
config-file: ./docs/link-check.config.json
23+
folder-path: ./docs
24+
25+
# Raise an issue if the previous step failed due to dead links being found
26+
- name: Alert on dead links
27+
uses: JasonEtco/create-an-issue@v2
28+
if: ${{ failure() }}
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
WORKFLOW_NAME: ${{ github.workflow }}
32+
WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/job/${{ github.job }}
33+
with:
34+
update_existing: true
35+
filename: .github/DEAD_LINKS_IN_DOCS.md

docs/link-check.config.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"ignorePatterns": [
3+
{
4+
"pattern": "^[^\/]+\/[^\/].*$|^\/[^\/].*$"
5+
}
6+
]
7+
}

0 commit comments

Comments
 (0)