Skip to content

Commit 121691b

Browse files
Copilottuanductran
andcommitted
Update to use lychee-action (archived action alternative)
Co-authored-by: tuanductran <69758022+tuanductran@users.noreply.github.com>
1 parent cc6629c commit 121691b

1 file changed

Lines changed: 29 additions & 8 deletions

File tree

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,46 @@
11
---
2+
# Note: The original broken-link-checker-action
3+
# (technote-space/broken-link-checker-action) was archived in Nov 2022
4+
# and is no longer maintained. This workflow uses lychee-action,
5+
# a well-maintained alternative that provides similar functionality
6+
# with better performance. If you specifically need the original action,
7+
# you can switch back to: uses: technote-space/broken-link-checker-action@v2
8+
29
name: Broken Link Check
310

411
"on":
512
schedule:
613
# Run monthly on the 1st at midnight UTC
714
- cron: '0 0 1 * *'
815
workflow_dispatch: # Allow manual triggering
9-
repository_dispatch:
10-
types: [check-link]
16+
pull_request:
17+
branches: [main, develop]
1118

1219
jobs:
1320
check:
1421
name: Check Broken Links
1522
runs-on: ubuntu-latest
1623

1724
steps:
18-
- name: Broken Link Check
19-
uses: technote-space/broken-link-checker-action@v2
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
28+
- name: Check links with lychee
29+
uses: lycheeverse/lychee-action@v2
2030
with:
21-
TARGET: 'https://github.com/${{ github.repository }}'
22-
RECURSIVE: 'true'
23-
LABELS: 'bug,documentation'
24-
TITLE: 'Broken link found: ${URL}'
31+
# Check all markdown files in repository
32+
args: --verbose --no-progress './**/*.md'
33+
# Fail action on broken links
34+
fail: true
35+
env:
2536
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Create Issue From File
39+
if: failure()
40+
uses: peter-evans/create-issue-from-file@v5
41+
with:
42+
title: Broken Links Detected
43+
content-filepath: ./lychee/out.md
44+
labels: |
45+
bug
46+
documentation

0 commit comments

Comments
 (0)