Skip to content

Commit 24f12bb

Browse files
authored
Create MonthlyLinkCheck.yml
1 parent 469d95b commit 24f12bb

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Monthly Link Check
2+
on:
3+
pull_request:
4+
branches: [main]
5+
schedule:
6+
- cron: '0 0 1 * *' # Runs at midnight on the first day of every month
7+
workflow_dispatch: # Allows manual triggering of the workflow
8+
jobs:
9+
linkChecker:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
issues: write
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 1
17+
- name: Check Links
18+
id: lychee
19+
uses: lycheeverse/lychee-action@v2
20+
with:
21+
args: --accept=200,403,429 --base . --verbose --no-progress './**/*.md' './**/*.html' './**/*.rst'
22+
token: ${{ secrets.CUSTOM_TOKEN }}
23+
fail: true
24+
25+
- name: Create Issue From File
26+
if: failure() && (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
27+
uses: peter-evans/create-issue-from-file@v5
28+
with:
29+
title: Broken links detected in docs 🔗
30+
content-filepath: ./lychee/out.md
31+
labels: 'incorrect links'
32+
#token: ${{ secrets.CUSTOM_TOKEN }}
33+
34+
35+
- name: Suggestions
36+
if: failure()
37+
run: |
38+
echo -e "\nPlease review the links reported in the Check links step above."
39+
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"
40+
exit 1

0 commit comments

Comments
 (0)