Skip to content

Monthly Link Check #3280

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

Merged
merged 5 commits into from
Mar 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/MonthlyLinkCheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#Runs once a month and checks links in the repo to ensure they are valid
#If action fails, it creates an issue with the failing links and an "incorrect link" label
#If link is valid but failing, it can be added to the .lycheeignore file
#Action can also be run manually as needed.


name: Monthly Link Check
on:
schedule:
- cron: '0 0 1 * *' # Runs at midnight on the first day of every month
workflow_dispatch: # Allows manual triggering of the workflow
jobs:
linkChecker:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Check Links
id: lychee
uses: lycheeverse/lychee-action@v2
with:
args: --accept=200,403,429 --base . --verbose --no-progress './**/*.md' './**/*.html' './**/*.rst'
token: ${{ secrets.CUSTOM_TOKEN }}
fail: true

- name: Create Issue From File
if: failure() && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
uses: peter-evans/create-issue-from-file@v5
with:
title: Broken links detected in docs 🔗
content-filepath: ./lychee/out.md
labels: 'incorrect link'
#token: ${{ secrets.CUSTOM_TOKEN }}


- name: Suggestions
if: failure()
run: |
echo -e "\nPlease review the links reported in the Check links step above."
echo -e "If a link is valid but fails due to a CAPTCHA challenge, IP blocking, login requirements, etc., consider adding such links to .lycheeignore file to bypass future checks.\n"
exit 1
Loading