From a77a3a19720f7b2dbe405455b799a8f1c3db4adf Mon Sep 17 00:00:00 2001 From: jonaskir6 <116752112+jonaskir6@users.noreply.github.com> Date: Sun, 20 Aug 2023 18:39:40 +0200 Subject: [PATCH 1/4] added link validity check to workflow --- .github/workflows/check-links-config.json | 22 +++++++++++ .github/workflows/check-links.yml | 48 +++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 .github/workflows/check-links-config.json create mode 100644 .github/workflows/check-links.yml diff --git a/.github/workflows/check-links-config.json b/.github/workflows/check-links-config.json new file mode 100644 index 0000000000..822546845f --- /dev/null +++ b/.github/workflows/check-links-config.json @@ -0,0 +1,22 @@ +{ + "ignorePatterns": [ + { + "pattern": "http(s)?://\\d+\\.\\d+\\.\\d+\\.\\d+" + }, + { + "pattern": "http(s)?://localhost" + }, + { + "pattern": "http(s)?://example.com" + } + ], + "aliveStatusCodes": [429, 200], + "httpHeaders": [ + { + "urls": ["https://docs.github.com/"], + "headers": { + "Accept-Encoding": "zstd, br, gzip, deflate" + } + } + ] +} \ No newline at end of file diff --git a/.github/workflows/check-links.yml b/.github/workflows/check-links.yml new file mode 100644 index 0000000000..f6c7f934b0 --- /dev/null +++ b/.github/workflows/check-links.yml @@ -0,0 +1,48 @@ +name: Check links +on: + push: + branches: [main] + pull_request: + + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true + +jobs: + changedfiles: + name: changed files + runs-on: ubuntu-latest + env: + PR_HEAD: ${{ github.event.pull_request.head.sha }} + outputs: + md: ${{ steps.changes.outputs.md }} + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Get changed files + id: changes + run: | + echo "md=$(git diff --name-only --diff-filter=ACMRTUXB $(git merge-base origin/main $PR_HEAD) $PR_HEAD | grep .md$ | xargs)" >> $GITHUB_OUTPUT + check-links: + runs-on: ubuntu-latest + needs: changedfiles + if: ${{needs.changedfiles.outputs.md}} + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install markdown-link-check + run: npm install -g markdown-link-check + + - name: Run markdown-link-check + run: | + markdown-link-check \ + --verbose \ + --config .github/workflows/check_links_config.json \ + ${{needs.changedfiles.outputs.md}} \ + || { echo "Check that anchor links are lowercase"; exit 1; } \ No newline at end of file From 8387282dee314c560165d20282b3930fa9b5c85a Mon Sep 17 00:00:00 2001 From: jonaskir6 <116752112+jonaskir6@users.noreply.github.com> Date: Sun, 20 Aug 2023 23:49:38 +0200 Subject: [PATCH 2/4] Update check-links.yml --- .github/workflows/check-links.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-links.yml b/.github/workflows/check-links.yml index f6c7f934b0..76c783f72b 100644 --- a/.github/workflows/check-links.yml +++ b/.github/workflows/check-links.yml @@ -3,7 +3,7 @@ on: push: branches: [main] pull_request: - + branches: [main] concurrency: group: ${{ github.workflow }}-${{ github.head_ref }} From 2e0db2cfddae6df7eb0ed2d84267465514d1d888 Mon Sep 17 00:00:00 2001 From: jonaskir6 <116752112+jonaskir6@users.noreply.github.com> Date: Thu, 12 Oct 2023 11:05:24 +0200 Subject: [PATCH 3/4] added missing newline at the end of file --- .github/workflows/check-links.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/check-links.yml b/.github/workflows/check-links.yml index 76c783f72b..d475489bb8 100644 --- a/.github/workflows/check-links.yml +++ b/.github/workflows/check-links.yml @@ -45,4 +45,5 @@ jobs: --verbose \ --config .github/workflows/check_links_config.json \ ${{needs.changedfiles.outputs.md}} \ - || { echo "Check that anchor links are lowercase"; exit 1; } \ No newline at end of file + || { echo "Check that anchor links are lowercase"; exit 1; } + From bacdc8531d4d44e7645b65b388825408c3c031f9 Mon Sep 17 00:00:00 2001 From: jonaskir6 <116752112+jonaskir6@users.noreply.github.com> Date: Mon, 16 Oct 2023 11:40:27 +0200 Subject: [PATCH 4/4] added newline at the end of check-links-config.json --- .github/workflows/check-links-config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-links-config.json b/.github/workflows/check-links-config.json index 822546845f..82ca9c0c33 100644 --- a/.github/workflows/check-links-config.json +++ b/.github/workflows/check-links-config.json @@ -19,4 +19,4 @@ } } ] -} \ No newline at end of file +}