Skip to content

Commit

Permalink
chore: add action to check for dead links (#3992)
Browse files Browse the repository at this point in the history
# 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.
  • Loading branch information
TomAFrench authored Jan 11, 2024
1 parent b4e1ed2 commit 29f704f
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 11 deletions.
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": "^[^\/]+\/[^\/].*$|^\/[^\/].*$"
}
]
}

0 comments on commit 29f704f

Please sign in to comment.