From 2e27e32060f41619d870ff42df5c91d05f746ad0 Mon Sep 17 00:00:00 2001 From: Kyle O'Connell Date: Tue, 5 Dec 2023 13:11:31 -0500 Subject: [PATCH] added link checking --- .github/workflows/check_links.yml | 28 ++++++++++++++++++++++++++++ .markdown-link-check.json | 26 ++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 .github/workflows/check_links.yml create mode 100644 .markdown-link-check.json diff --git a/.github/workflows/check_links.yml b/.github/workflows/check_links.yml new file mode 100644 index 0000000..5b3d487 --- /dev/null +++ b/.github/workflows/check_links.yml @@ -0,0 +1,28 @@ +name: Check Links + +on: + push: + branches: + - '*' + pull_request: + branches: + - '*' +jobs: + check-links: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: 16 + + - name: Install dependencies + run: | + npm install -g markdown-link-check + + - name: Check links in Markdown files + run: find . -name '*.md' -print0 | xargs -0 -n1 markdown-link-check -q -c .markdown-link-check.json diff --git a/.markdown-link-check.json b/.markdown-link-check.json new file mode 100644 index 0000000..ceaca8c --- /dev/null +++ b/.markdown-link-check.json @@ -0,0 +1,26 @@ +{ + "ignorePatterns": [ + { + "pattern": "^#" + }, + { + "pattern": "^https://iam.nih.gov" + } + ], + "replacementPatterns": [ + { + "pattern": "^/docs", + "replacement": "https://github.com/STRIDES/NIHCloudLabGCP/tree/main/docs" + }, + { + "pattern": "^/tutorials", + "replacement": "https://github.com/STRIDES/NIHCloudLabGCP/tree/main/tutorials" + } + + ], + "timeout": "20s", + "retryOn429": true, + "retryCount": 5, + "fallbackRetryDelay": "30s", + "aliveStatusCodes": [200, 206] +} \ No newline at end of file