From cfdbc6d01779b0d5b1d88e892c0cdb6dd70b641c Mon Sep 17 00:00:00 2001 From: David Ansermino <14164624+ansermino@users.noreply.github.com> Date: Wed, 18 Dec 2024 12:34:36 -0500 Subject: [PATCH 1/9] Adds link check workflow, remove docs workflow --- lychee.toml => .config/lychee.toml | 0 .github/workflows/docs.yml | 36 ------------------------------ 2 files changed, 36 deletions(-) rename lychee.toml => .config/lychee.toml (100%) delete mode 100644 .github/workflows/docs.yml diff --git a/lychee.toml b/.config/lychee.toml similarity index 100% rename from lychee.toml rename to .config/lychee.toml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 6e646d1a2e5..00000000000 --- 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 From 234416f95a9d610e35a84316b174e208ec702351 Mon Sep 17 00:00:00 2001 From: David Ansermino <14164624+ansermino@users.noreply.github.com> Date: Wed, 18 Dec 2024 13:22:42 -0500 Subject: [PATCH 2/9] Update lychee config --- .config/lychee.toml | 15 +++++++-- .github/workflows/docs-check.yml | 4 +-- .github/workflows/link-check.yml | 52 ++++++++++++++++++++++++++++++++ .gitignore | 2 ++ .lycheeignore | 2 -- docs/.config/lychee.toml | 11 ------- 6 files changed, 68 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/link-check.yml delete mode 100644 .lycheeignore delete mode 100644 docs/.config/lychee.toml diff --git a/.config/lychee.toml b/.config/lychee.toml index 5c67cac2047..3aadc9bb218 100644 --- a/.config/lychee.toml +++ b/.config/lychee.toml @@ -2,9 +2,18 @@ # 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"] +verbose = "trace" +no_progress = false +exclude_path = ["./node_modules", "./docs/node_modules", "./documentation", "./target"] +exclude = [ + "open-rpc.org", + "github.com", + "twitter.com", + # Requires CAPTCHA verification + "faucet.calibnet.chainsafe-fil.io/funds.html" +] timeout = 60 max_retries = 6 retry_wait_time = 10 + +output = "lychee-report.md" \ No newline at end of file diff --git a/.github/workflows/docs-check.yml b/.github/workflows/docs-check.yml index 88000697fc8..89d3984825d 100644 --- a/.github/workflows/docs-check.yml +++ b/.github/workflows/docs-check.yml @@ -22,7 +22,7 @@ on: jobs: docs-check: - name: Check + name: Lint & Build runs-on: ubuntu-latest defaults: run: @@ -40,4 +40,4 @@ jobs: - run: yarn typecheck - run: yarn spellcheck - run: yarn format-check - - run: yarn build + - run: yarn build \ No newline at end of file diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml new file mode 100644 index 00000000000..da121917646 --- /dev/null +++ b/.github/workflows/link-check.yml @@ -0,0 +1,52 @@ +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 + labels: automated issue + + - 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 367b7bd99bc..b43bcd96de3 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 3267ed33694..00000000000 --- a/.lycheeignore +++ /dev/null @@ -1,2 +0,0 @@ -http://open-rpc.org/ -https://github.com/ diff --git a/docs/.config/lychee.toml b/docs/.config/lychee.toml deleted file mode 100644 index 75ec001d978..00000000000 --- a/docs/.config/lychee.toml +++ /dev/null @@ -1,11 +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 -# Requires CAPTCHA verification -exclude = ["https://faucet.calibnet.chainsafe-fil.io/funds.html"] -timeout = 60 -max_retries = 6 -retry_wait_time = 10 From 6d0828e7115de07090ff6d62f43be58c61c3b474 Mon Sep 17 00:00:00 2001 From: David Ansermino <14164624+ansermino@users.noreply.github.com> Date: Wed, 18 Dec 2024 13:28:24 -0500 Subject: [PATCH 3/9] Use single glob pattern --- .github/workflows/docs-check.yml | 4 ++-- .github/workflows/link-check.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docs-check.yml b/.github/workflows/docs-check.yml index 89d3984825d..88000697fc8 100644 --- a/.github/workflows/docs-check.yml +++ b/.github/workflows/docs-check.yml @@ -22,7 +22,7 @@ on: jobs: docs-check: - name: Lint & Build + name: Check runs-on: ubuntu-latest defaults: run: @@ -40,4 +40,4 @@ jobs: - run: yarn typecheck - run: yarn spellcheck - run: yarn format-check - - run: yarn build \ No newline at end of file + - run: yarn build diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml index da121917646..a3268ff2545 100644 --- a/.github/workflows/link-check.yml +++ b/.github/workflows/link-check.yml @@ -37,7 +37,7 @@ jobs: id: lychee uses: lycheeverse/lychee-action@v2 with: - args: --config ./.config/lychee.toml '**/*.md' '**/*.mdx''**/*.html' + args: --config ./.config/lychee.toml **/*.{md,mdx,html} - name: Create Issue From File if: env.lychee_exit_code != 0 && github.event_name == 'schedule' From 63ba90c68cb2599699935944eee6dece8275f282 Mon Sep 17 00:00:00 2001 From: David Ansermino <14164624+ansermino@users.noreply.github.com> Date: Wed, 18 Dec 2024 13:53:20 -0500 Subject: [PATCH 4/9] Add quotes to path --- .github/workflows/link-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml index a3268ff2545..755828abe45 100644 --- a/.github/workflows/link-check.yml +++ b/.github/workflows/link-check.yml @@ -37,7 +37,7 @@ jobs: id: lychee uses: lycheeverse/lychee-action@v2 with: - args: --config ./.config/lychee.toml **/*.{md,mdx,html} + args: --config "./.config/lychee.toml" '**/*.{md,mdx,html}' - name: Create Issue From File if: env.lychee_exit_code != 0 && github.event_name == 'schedule' From 8345707b600dfd1cf91c663a11e452c1e69b09aa Mon Sep 17 00:00:00 2001 From: David Ansermino <14164624+ansermino@users.noreply.github.com> Date: Wed, 18 Dec 2024 13:57:03 -0500 Subject: [PATCH 5/9] Single quotes only --- .github/workflows/link-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml index 755828abe45..b7c71dbb3be 100644 --- a/.github/workflows/link-check.yml +++ b/.github/workflows/link-check.yml @@ -37,7 +37,7 @@ jobs: id: lychee uses: lycheeverse/lychee-action@v2 with: - args: --config "./.config/lychee.toml" '**/*.{md,mdx,html}' + args: --config './.config/lychee.toml' '**/*.{md,mdx,html}' - name: Create Issue From File if: env.lychee_exit_code != 0 && github.event_name == 'schedule' From 739155e3e62906ec9ae2dc16e08aa8607106a114 Mon Sep 17 00:00:00 2001 From: David Ansermino <14164624+ansermino@users.noreply.github.com> Date: Wed, 18 Dec 2024 14:00:46 -0500 Subject: [PATCH 6/9] Quote me --- .github/workflows/link-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml index b7c71dbb3be..dd87a2f0060 100644 --- a/.github/workflows/link-check.yml +++ b/.github/workflows/link-check.yml @@ -37,7 +37,7 @@ jobs: id: lychee uses: lycheeverse/lychee-action@v2 with: - args: --config './.config/lychee.toml' '**/*.{md,mdx,html}' + args: "--config ./.config/lychee.toml **/*.{md,mdx,html}" - name: Create Issue From File if: env.lychee_exit_code != 0 && github.event_name == 'schedule' From cc35bdfb87ac1c58f46ab794af561307eca04437 Mon Sep 17 00:00:00 2001 From: David Ansermino <14164624+ansermino@users.noreply.github.com> Date: Wed, 18 Dec 2024 15:31:20 -0500 Subject: [PATCH 7/9] Fixed broken input selection --- .github/workflows/link-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml index dd87a2f0060..3637cc5bbeb 100644 --- a/.github/workflows/link-check.yml +++ b/.github/workflows/link-check.yml @@ -37,7 +37,7 @@ jobs: id: lychee uses: lycheeverse/lychee-action@v2 with: - args: "--config ./.config/lychee.toml **/*.{md,mdx,html}" + args: --config ./.config/lychee.toml './**/*.md' './**/*.mdx' './**/*.html' - name: Create Issue From File if: env.lychee_exit_code != 0 && github.event_name == 'schedule' From b7cca5e290eb292fe76efc802700a4926ebcf302 Mon Sep 17 00:00:00 2001 From: David Ansermino <14164624+ansermino@users.noreply.github.com> Date: Wed, 18 Dec 2024 15:42:07 -0500 Subject: [PATCH 8/9] Remove exclusions --- .config/lychee.toml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.config/lychee.toml b/.config/lychee.toml index 3aadc9bb218..b8745fbf1a6 100644 --- a/.config/lychee.toml +++ b/.config/lychee.toml @@ -2,17 +2,17 @@ # See the github actions workflows to see the inputs # https://github.com/lycheeverse/lychee/blob/2109470dc380eaf66944b6bcfa86230e0a58e58f/lychee-bin/src/options.rs#L152 -verbose = "trace" -no_progress = false +verbose = "debug" +no_progress = true exclude_path = ["./node_modules", "./docs/node_modules", "./documentation", "./target"] exclude = [ - "open-rpc.org", - "github.com", - "twitter.com", +# "open-rpc.org", + "github.com/ChainSafe/forest", +# "twitter.com", # Requires CAPTCHA verification "faucet.calibnet.chainsafe-fil.io/funds.html" ] -timeout = 60 +timeout = 30 max_retries = 6 retry_wait_time = 10 From 232843ca9f4be3359984d202aa28ea29add2698b Mon Sep 17 00:00:00 2001 From: David Ansermino <14164624+ansermino@users.noreply.github.com> Date: Wed, 18 Dec 2024 15:50:39 -0500 Subject: [PATCH 9/9] Cleanup --- .config/lychee.toml | 10 +++++++--- .github/workflows/link-check.yml | 1 - 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.config/lychee.toml b/.config/lychee.toml index b8745fbf1a6..7470adcf3ed 100644 --- a/.config/lychee.toml +++ b/.config/lychee.toml @@ -4,11 +4,15 @@ verbose = "debug" no_progress = true -exclude_path = ["./node_modules", "./docs/node_modules", "./documentation", "./target"] +exclude_path = [ + "./node_modules", + "./docs/node_modules", + "./documentation", + "./target" +] exclude = [ -# "open-rpc.org", + # Avoid Github rate limits "github.com/ChainSafe/forest", -# "twitter.com", # Requires CAPTCHA verification "faucet.calibnet.chainsafe-fil.io/funds.html" ] diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml index 3637cc5bbeb..cb08d8fdfbb 100644 --- a/.github/workflows/link-check.yml +++ b/.github/workflows/link-check.yml @@ -45,7 +45,6 @@ jobs: with: title: Link Checker Report content-filepath: ./lychee-report.md - labels: automated issue - name: Fail job on error if: env.lychee_exit_code != 0 && github.event_name != 'schedule'