diff --git a/.github/workflows/link-checker.yaml b/.github/workflows/link-checker.yaml new file mode 100644 index 0000000000000..369013692fd31 --- /dev/null +++ b/.github/workflows/link-checker.yaml @@ -0,0 +1,42 @@ +--- +name: "Link Checker" + +on: + push: null + repository_dispatch: null + workflow_dispatch: null + pull_request: + branches: [main] +permissions: + contents: read +jobs: + linkChecker: + name: "Run Link Checker" + runs-on: ubuntu-latest + steps: + - name: "Checkout code" + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: "Restore lychee cache" + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 + id: restore-cache + with: + path: .lycheecache + key: cache-lychee-${{ github.sha }} + restore-keys: cache-lychee- + + - name: "Link Checker" + id: lychee + uses: lycheeverse/lychee-action@e7477775783ea5526144ba13e8db5eec57747ce8 #v2.9.0 + with: + args: >- + './**/*.md' --verbose --no-progress + --retry-wait-time 30 --max-retries 5 + --accept 100..=103,200..=299,429 + --exclude-all-private --max-concurrency 4 + --cache --cache-exclude-status '429, 500..599' --max-cache-age 1d + --remap 'https://github\.com/([^/]+)/([^/]+)/blob/(.+) https://raw.githubusercontent.com/$1/$2/$3' + format: markdown + fail: true