diff --git a/docs/.config/lychee.toml b/.config/lychee.toml similarity index 50% rename from docs/.config/lychee.toml rename to .config/lychee.toml index 75ec001d9783..7470adcf3ed0 100644 --- a/docs/.config/lychee.toml +++ b/.config/lychee.toml @@ -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" \ No newline at end of file diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 6e646d1a2e57..000000000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Docs - -# Cancel workflow if there is a new change to the branch. -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} - -on: - push: - branches: - - main - paths: - - '**.md' - - '.github/workflows/docs.yml' - merge_group: - pull_request: - branches: - - main - paths: - - '**.md' - - '.github/workflows/docs.yml' - -jobs: - check-docs: - name: Markdown Lint - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - name: Lint Markdown - run: make md-check - - name: Link check - uses: lycheeverse/lychee-action@v2.1.0 - with: - args: '*.md .github/*.md .github/**/*.md .config/*.md' - # Fail action on broken links - fail: true diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml new file mode 100644 index 000000000000..cb08d8fdfbb1 --- /dev/null +++ b/.github/workflows/link-check.yml @@ -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 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 367b7bd99bcc..b43bcd96de3a 100644 --- a/.gitignore +++ b/.gitignore @@ -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 \ No newline at end of file diff --git a/.lycheeignore b/.lycheeignore deleted file mode 100644 index 3267ed33694d..000000000000 --- a/.lycheeignore +++ /dev/null @@ -1,2 +0,0 @@ -http://open-rpc.org/ -https://github.com/ diff --git a/lychee.toml b/lychee.toml deleted file mode 100644 index 5c67cac2047d..000000000000 --- a/lychee.toml +++ /dev/null @@ -1,10 +0,0 @@ -# This is the common config used by lychee, our dead html link checker -# See the github actions workflows to see the inputs -# https://github.com/lycheeverse/lychee/blob/2109470dc380eaf66944b6bcfa86230e0a58e58f/lychee-bin/src/options.rs#L152 - -verbose = "debug" -no_progress = true -exclude = ["twitter.com"] -timeout = 60 -max_retries = 6 -retry_wait_time = 10