From c11a9d155f17b80c3456df84adf9e76302fec9d7 Mon Sep 17 00:00:00 2001 From: Murat Kaan Meral Date: Tue, 7 Apr 2026 18:46:32 -0400 Subject: [PATCH 1/2] ci: add weekly markdown link check workflow --- .github/workflows/check-markdown-links.yml | 51 ++++++++++++++++++++++ .markdown-link-check.json | 6 +++ 2 files changed, 57 insertions(+) create mode 100644 .github/workflows/check-markdown-links.yml create mode 100644 .markdown-link-check.json diff --git a/.github/workflows/check-markdown-links.yml b/.github/workflows/check-markdown-links.yml new file mode 100644 index 000000000..e3a1c9406 --- /dev/null +++ b/.github/workflows/check-markdown-links.yml @@ -0,0 +1,51 @@ +name: Check Markdown Links + +on: + schedule: + - cron: '0 9 * * 1' # Every Monday at 9am UTC + workflow_dispatch: # Allow manual trigger + +jobs: + check-links: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: gaurav-nelson/github-action-markdown-link-check@v1 + id: link-check + with: + use-quiet-mode: 'yes' + use-verbose-mode: 'yes' + config-file: '.markdown-link-check.json' + continue-on-error: true + + - name: Create issue if links are broken + if: steps.link-check.outcome == 'failure' + uses: actions/github-script@v7 + with: + script: | + const title = '🔗 Broken markdown links detected'; + const label = 'broken-links'; + + // Check for existing open issue to avoid duplicates + const existing = await github.rest.issues.listForRepo({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open', + labels: label, + }); + + if (existing.data.length > 0) { + console.log(`Issue already exists: #${existing.data[0].number}`); + return; + } + + const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`; + + await github.rest.issues.create({ + owner: context.repo.owner, + repo: context.repo.repo, + title, + body: `The weekly markdown link check found broken links.\n\nSee the [workflow run](${runUrl}) for details.`, + labels: [label], + }); diff --git a/.markdown-link-check.json b/.markdown-link-check.json new file mode 100644 index 000000000..a03e7e0a9 --- /dev/null +++ b/.markdown-link-check.json @@ -0,0 +1,6 @@ +{ + "retryOn429": true, + "retryCount": 3, + "fallbackRetryDelay": "30s", + "aliveStatusCodes": [200, 206] +} From e1b84b87756a18078d60293603b68c47015255e8 Mon Sep 17 00:00:00 2001 From: Murat Kaan Meral Date: Wed, 8 Apr 2026 10:03:30 -0400 Subject: [PATCH 2/2] ci: pin markdown link check action to commit sha --- .github/workflows/check-markdown-links.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-markdown-links.yml b/.github/workflows/check-markdown-links.yml index e3a1c9406..2ac596190 100644 --- a/.github/workflows/check-markdown-links.yml +++ b/.github/workflows/check-markdown-links.yml @@ -11,7 +11,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: gaurav-nelson/github-action-markdown-link-check@v1 + - uses: gaurav-nelson/github-action-markdown-link-check@3c3b66f1f7d0900e37b71eca45b63ea9eedfce31 # v1.0.17 id: link-check with: use-quiet-mode: 'yes'