Skip to content

Commit

Permalink
Link checker (ChainSafe#5098)
Browse files Browse the repository at this point in the history
  • Loading branch information
ansermino authored Dec 19, 2024
1 parent 6d28ccd commit d4ad88a
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 51 deletions.
18 changes: 15 additions & 3 deletions docs/.config/lychee.toml → .config/lychee.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,20 @@

verbose = "debug"
no_progress = true
# Requires CAPTCHA verification
exclude = ["https://faucet.calibnet.chainsafe-fil.io/funds.html"]
timeout = 60
exclude_path = [
"./node_modules",
"./docs/node_modules",
"./documentation",
"./target"
]
exclude = [
# Avoid Github rate limits
"github.com/ChainSafe/forest",
# Requires CAPTCHA verification
"faucet.calibnet.chainsafe-fil.io/funds.html"
]
timeout = 30
max_retries = 6
retry_wait_time = 10

output = "lychee-report.md"
36 changes: 0 additions & 36 deletions .github/workflows/docs.yml

This file was deleted.

51 changes: 51 additions & 0 deletions .github/workflows/link-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Link Checker

on:
workflow_dispatch:
schedule:
# Run daily at 9am
- cron: "00 9 * * *"
push:
branches:
- main
paths:
- "**.md"
- "**.mdx"
- "**.html"
- ".github/workflows/link-check.yml"
merge_group:
pull_request:
branches:
- main
paths:
- "**.md"
- "**.mdx"
- "**.html"
- ".github/workflows/link-check.yml"

jobs:
link-check:
name: Link Check
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
steps:
- uses: actions/checkout@v4

- name: Link Checker
id: lychee
uses: lycheeverse/lychee-action@v2
with:
args: --config ./.config/lychee.toml './**/*.md' './**/*.mdx' './**/*.html'

- name: Create Issue From File
if: env.lychee_exit_code != 0 && github.event_name == 'schedule'
uses: peter-evans/create-issue-from-file@v5
with:
title: Link Checker Report
content-filepath: ./lychee-report.md

- name: Fail job on error
if: env.lychee_exit_code != 0 && github.event_name != 'schedule'
run: exit 1
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -388,3 +388,5 @@ rust-project.json
# .pnp.*

# End of https://www.toptal.com/developers/gitignore/api/go,rust,rust-analyzer,osx,visualstudiocode,intellij+all,yarn,node,ruby

lychee-report.md
2 changes: 0 additions & 2 deletions .lycheeignore

This file was deleted.

10 changes: 0 additions & 10 deletions lychee.toml

This file was deleted.

0 comments on commit d4ad88a

Please sign in to comment.