diff --git a/.github/lychee.toml b/.github/lychee.toml new file mode 100644 index 00000000..a228cd08 --- /dev/null +++ b/.github/lychee.toml @@ -0,0 +1,11 @@ +include-fragments = true + +accept = ["200..=299", "429"] + +exclude = [ + "^http(s)?://localhost", + "^http(s)?://example.com" +] + +# better to be safe and avoid failures +max-retries = 6 diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index f2966c90..2f594043 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -15,8 +15,6 @@ env: # Make sure to exit early if cache segment download times out after 2 minutes. # We limit cache download as a whole to 5 minutes. SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2 - # renovate: datasource=github-releases depName=tcort/markdown-link-check - MD_LINK_CHECK_VERSION: "3.12.2" concurrency: group: ${{ github.workflow }}-${{ github.head_ref }} @@ -84,14 +82,10 @@ jobs: - name: Render .chloggen changelog entries if: ${{ !contains(github.event.pull_request.labels.*.name, 'dependencies') && !contains(github.event.pull_request.labels.*.name, 'Skip Changelog') && !contains(github.event.pull_request.title, '[chore]')}} run: make chlog-preview > changelog_preview.md - - name: Install markdown-link-check + - name: Link Checker if: ${{ !contains(github.event.pull_request.labels.*.name, 'dependencies') && !contains(github.event.pull_request.labels.*.name, 'Skip Changelog') && !contains(github.event.pull_request.title, '[chore]')}} - run: npm install -g markdown-link-check@${{ env.MD_LINK_CHECK_VERSION }} - - name: Run markdown-link-check - if: ${{ !contains(github.event.pull_request.labels.*.name, 'dependencies') && !contains(github.event.pull_request.labels.*.name, 'Skip Changelog') && !contains(github.event.pull_request.title, '[chore]')}} - run: | - markdown-link-check \ - --verbose \ - --config .github/workflows/check_links_config.json \ - changelog_preview.md \ - || { echo "Check that anchor links are lowercase"; exit 1; } + id: lychee + uses: lycheeverse/lychee-action@f613c4a64e50d792e0b31ec34bbcbba12263c6a6 + with: + args: "--verbose --no-progress ./changelog_preview.md --config .github/lychee.toml" + failIfEmpty: false diff --git a/.github/workflows/check_links_config.json b/.github/workflows/check_links_config.json deleted file mode 100644 index 84c68f6f..00000000 --- a/.github/workflows/check_links_config.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "ignorePatterns": [ - { - "pattern": "http(s)?://\\d+\\.\\d+\\.\\d+\\.\\d+" - }, - { - "pattern": "http(s)?://localhost" - }, - { - "pattern": "http(s)?://example.com" - }, - { - "pattern": "#warnings" - } - ], - "aliveStatusCodes": [429, 200], - "httpHeaders": [ - { - "urls": ["https://docs.github.com/"], - "headers": { - "Accept-Encoding": "zstd, br, gzip, deflate" - } - } - ] -}