forked from opensearch-project/opensearch-go
-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (34 loc) · 2.09 KB
/
Copy pathlinks.yml
File metadata and controls
40 lines (34 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Link Checker
on: [push, pull_request]
jobs:
linkchecker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v6
# Blocking: fail the build only on genuinely broken links (4xx/5xx,
# DNS failures, timeouts). Redirects are accepted here so a moved link
# does not break CI on its own -- the pass below surfaces those.
- name: Check for broken links
id: lychee-broken
uses: lycheeverse/lychee-action@e7477775783ea5526144ba13e8db5eec57747ce8 # v2.9.0
with:
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"
fail: true
jobSummary: true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
# Non-blocking: surface permanent redirects (301/308) so their links can
# be updated to point at the final destination. --max-redirects=0 makes
# lychee report the redirect status instead of following it; 302/307 stay
# accepted because temporary redirects are not a signal to rewrite a link.
# fail:false + if:always() so this always reports without breaking CI.
- name: Report permanently-redirecting links (non-blocking)
id: lychee-redirects
if: always()
uses: lycheeverse/lychee-action@e7477775783ea5526144ba13e8db5eec57747ce8 # v2.9.0
with:
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"
fail: false
jobSummary: true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}