Skip to content

Commit b7a6c13

Browse files
authored
fix(link-check): use toml file for config (#780)
2 parents 84fdece + 4cf57f8 commit b7a6c13

File tree

3 files changed

+35
-14
lines changed

3 files changed

+35
-14
lines changed

.github/workflows/check-external-links.yml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,36 @@ jobs:
1111
permissions:
1212
issues: write
1313
steps:
14+
- uses: actions/checkout@v4
1415
- name: Restore lychee cache
1516
uses: actions/cache@v4
1617
with:
1718
path: .lycheecache
18-
key: cache-lychee-${{ github.sha }}
19+
key: cache-lychee-${{ hashFiles('lychee.toml') }}
1920
restore-keys: cache-lychee-
20-
- uses: actions/checkout@v4
2121
- name: Link Checker
2222
id: lychee
2323
uses: lycheeverse/lychee-action@v2
2424
with:
2525
lycheeVersion: "latest"
2626
args: |
27-
--cache
28-
--verbose
29-
--accept '100..=103,200..=299,400,403'
30-
--base https://dev.flare.network/
31-
--no-progress
32-
--insecure
33-
--exclude '^(/|https://dev\.flare\.network/|https?://localhost(?::[0-9]+)?/|https://fdc-verifiers-testnet\.flare\.network/|https://github\.com/flare-foundation/flare-hardhat-starter/|https://github\.com/flare-foundation/flare-foundry-starter/|https://sepolia\.etherscan\.io/|https://metamask\.io/|https://openweathermap\.org/|https://www\.gnu\.org/)'
27+
--config lychee.toml
3428
.
3529
fail: true
3630
env:
3731
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
38-
- name: Create Issue From File
32+
- name: Comment on PR if broken links found
3933
if: steps.lychee.outputs.exit_code != 0
40-
uses: peter-evans/create-issue-from-file@v5
34+
uses: thollander/actions-comment-pull-request@v3
4135
with:
42-
title: Link Checker Report
43-
content-filepath: ./lychee/out.md
44-
labels: report, automated issue
36+
message: |
37+
### 🚨 Broken links detected
38+
<details>
39+
<summary>Click to expand</summary>
40+
41+
```markdown
42+
${{ steps.lychee.outputs.report }}
43+
```
44+
</details>
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ yarn-error.log*
2121

2222
.vscode
2323
.idea
24+
.lycheecache
2425

2526
flare-smart-contracts-v2/
2627
flare-smart-contracts/

lychee.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
base_url = "https://dev.flare.network/"
2+
verbose = "info"
3+
cache = true
4+
accept = ["200", "429", "403"]
5+
no_progress = true
6+
exclude = [
7+
'^/',
8+
'https://dev\.flare\.network/',
9+
'https?://localhost(?::[0-9]+)?/',
10+
'https://fdc-verifiers-testnet\.flare\.network/',
11+
'https://github\.com/flare-foundation/flare-hardhat-starter/',
12+
'https://github\.com/flare-foundation/flare-foundry-starter/',
13+
'https://sepolia\.etherscan\.io/',
14+
'https://metamask\.io/',
15+
'https://openweathermap\.org/',
16+
'https://www\.gnu\.org/',
17+
'https://swapi\.dev/',
18+
]

0 commit comments

Comments
 (0)