|
9 | 9 |
|
10 | 10 | steps: |
11 | 11 | - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6 |
12 | | - - name: lychee Link Checker |
13 | | - id: lychee |
| 12 | + |
| 13 | + # Blocking: fail the build only on genuinely broken links (4xx/5xx, |
| 14 | + # DNS failures, timeouts). Redirects are accepted here so a moved link |
| 15 | + # does not break CI on its own -- the pass below surfaces those. |
| 16 | + - name: Check for broken links |
| 17 | + id: lychee-broken |
| 18 | + uses: lycheeverse/lychee-action@e7477775783ea5526144ba13e8db5eec57747ce8 # v2.9.0 |
| 19 | + with: |
| 20 | + args: --accept=200,206,301,302,307,308,403,429 --max-retries=3 --retry-wait-time=10 "**/*.html" "**/*.md" "**/*.txt" "**/*.json" --exclude "https://opensearch-domain.region.com/" --exclude "https://github.com/\[your*" --exclude "https://localhost:9200" --exclude "https://codecov.io/gh/opensearch-project/opensearch-go/branch/main/graph/badge.svg" |
| 21 | + fail: true |
| 22 | + jobSummary: true |
| 23 | + env: |
| 24 | + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
| 25 | + |
| 26 | + # Non-blocking: surface permanent redirects (301/308) so their links can |
| 27 | + # be updated to point at the final destination. --max-redirects=0 makes |
| 28 | + # lychee report the redirect status instead of following it; 302/307 stay |
| 29 | + # accepted because temporary redirects are not a signal to rewrite a link. |
| 30 | + # fail:false + if:always() so this always reports without breaking CI. |
| 31 | + - name: Report permanently-redirecting links (non-blocking) |
| 32 | + id: lychee-redirects |
| 33 | + if: always() |
14 | 34 | uses: lycheeverse/lychee-action@e7477775783ea5526144ba13e8db5eec57747ce8 # v2.9.0 |
15 | 35 | with: |
16 | | - args: --accept=200,403,429 --max-retries=3 --retry-wait-time=10 "**/*.html" "**/*.md" "**/*.txt" "**/*.json" --exclude "https://opensearch-domain.region.com/" --exclude "https://github.com/\[your*" --exclude "https://localhost:9200" --exclude "https://codecov.io/gh/opensearch-project/opensearch-go/branch/main/graph/badge.svg" |
| 36 | + args: --accept=200,206,302,307,403,429 --max-redirects=0 --max-retries=3 --retry-wait-time=10 "**/*.html" "**/*.md" "**/*.txt" "**/*.json" --exclude "https://opensearch-domain.region.com/" --exclude "https://github.com/\[your*" --exclude "https://localhost:9200" --exclude "https://codecov.io/gh/opensearch-project/opensearch-go/branch/main/graph/badge.svg" |
| 37 | + fail: false |
| 38 | + jobSummary: true |
17 | 39 | env: |
18 | 40 | GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
19 | | - - name: Fail if there were link errors |
20 | | - run: exit ${{ steps.lychee.outputs.exit_code }} |
|
0 commit comments