From f361b3a87f4eade41c895837c216047e16c7a0d3 Mon Sep 17 00:00:00 2001 From: undergoundwires Date: Sun, 26 Jan 2025 15:09:47 +0100 Subject: [PATCH] Add external URL health checks in CI/CD This commit adds automated checks for dead external URLs in the documentation during CI/CD pipeline. It configures `remark-lint-no-dead-urls` plugin with custom ignore patterns to handle false positives. This commit adds URL aliveness checks in CI/CD that was previously missing, adding ignore rules for false negatives. Changes: - Add missing external URL checking in GitHub workflow. - Add ignore patterns for false negatives. - Remove fail fast feature from quality checks to receive results from all commands. --- .github/workflows/quality-checks.yaml | 2 ++ .remark-lint-no-dead-urls.mjs | 19 +++++++++++++++++++ README.md | 2 +- package.json | 2 +- 4 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 .remark-lint-no-dead-urls.mjs diff --git a/.github/workflows/quality-checks.yaml b/.github/workflows/quality-checks.yaml index d65862a..ccb3b2e 100644 --- a/.github/workflows/quality-checks.yaml +++ b/.github/workflows/quality-checks.yaml @@ -11,7 +11,9 @@ jobs: - lint:css - lint:md - lint:md:urls:relative + - lint:md:urls:external - lint:md:consistency + fail-fast: false # Still interested to see results from other commands steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.remark-lint-no-dead-urls.mjs b/.remark-lint-no-dead-urls.mjs new file mode 100644 index 0000000..c8764cc --- /dev/null +++ b/.remark-lint-no-dead-urls.mjs @@ -0,0 +1,19 @@ +import remarkLintNoDeadUrls from 'remark-lint-no-dead-urls'; + +/** @type {import('remark-lint-no-dead-urls').Options} */ +const Options = { + skipUrlPatterns: [ + // These return 403 (Forbidden) to checks + 'codepen.io', // 'https://codepen.io' + ].map(buildUrlPattern), +}; + +/** @type {Omit