From bdd8bce4e2e1f2d794a0e0e4cbb72ab48e7162e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Harper?= Date: Wed, 15 Nov 2023 18:38:27 -0500 Subject: [PATCH] ci: add a workflow to validate links in Markdown files (#41) --- .github/workflows/check-links.yml | 20 +++++++++ .markdownlinkcheck.json | 70 +++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 .github/workflows/check-links.yml create mode 100644 .markdownlinkcheck.json diff --git a/.github/workflows/check-links.yml b/.github/workflows/check-links.yml new file mode 100644 index 0000000..44ac999 --- /dev/null +++ b/.github/workflows/check-links.yml @@ -0,0 +1,20 @@ +--- +name: Markdown Links Validation + +on: [push, workflow_dispatch] + +jobs: + markdown-link-check: + runs-on: ubuntu-latest + steps: + + - name: Checkout this repository + uses: actions/checkout@v3.5.3 + + - name: Validate Links in Markdown files + if: always() + uses: gaurav-nelson/github-action-markdown-link-check@1.0.15 + with: + config-file: '.markdownlinkcheck.json' + use-quiet-mode: 'yes' + file-extension: .md diff --git a/.markdownlinkcheck.json b/.markdownlinkcheck.json new file mode 100644 index 0000000..9cf1eba --- /dev/null +++ b/.markdownlinkcheck.json @@ -0,0 +1,70 @@ +{ + "ignorePatterns": [ + { + "pattern": "^https://www.linkedin.com.*" + }, + { + "pattern": ".*\\]$" + }, + { + "pattern": "https://www.enterprisetimes.co.uk*" + }, + { + "pattern": "https://www.pexels.com*" + }, + { + "pattern": "https://www.pngrepo.com" + }, + { + "pattern": "https://tdwi.org*" + }, + { + "pattern": "https://www.fakepersongenerator.com*" + }, + { + "pattern": "https://dash.readme.com*" + }, + { + "pattern": "https://cfpland.com*" + }, + { + "pattern": "https://n8n.io*" + }, + { + "pattern": "https://confs.tech*" + }, + { + "pattern": "https://businesswire.com*" + }, + { + "pattern": "https://www.tmcnet.com*" + }, + { + "pattern": "https://.*kubefirst.dev*" + }, + { + "pattern": "http://localhost*" + }, + { + "pattern": "https://gitlab.com*" + }, + { + "pattern": "https://.*vultr.com*" + } + ], + "replacementPatterns": [ + { + "pattern": "{require(\"(*)\").default}", + "replacement": "*" + }, + { + "pattern": "^/img/*", + "replacement": "/static/img/*" + } + ], + "timeout": "30s", + "retryOn429": true, + "retryCount": 2, + "fallbackRetryDelay": "1m", + "aliveStatusCodes": [200, 429] +}