Skip to content

Commit 92748a6

Browse files
ci: skip README.md files in liche link check
Signed-off-by: Arnob kumar saha <arnob@appscode.com>
1 parent c62344d commit 92748a6

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ jobs:
5151
5252
- name: Check links
5353
run: |
54-
liche -r docs -d $(pwd) -c 10 -p -h -l -s -x '^(.*golang.org.*|.*github.com.*|.*api.slack.com.*|.*twitter.com.*|.*linode.com.*|.*helm.sh.*|.*k8s.io.*|.*percona.com.*|.*kubernetes.io.*|.*search-guard.com.*|.*hub.docker.com.*|.*appscode.com.*|.*mongodb.com.*|.*community.arm.com.*|.*cluster.com.*|.*proxysql.com.*|.*postgresql.org.*|.*kafka.com.*|.*stackoverflow.com.*|.*redis.io.*|.*elastic.co.*|.*mysql.*|.*developer.hashicorp.com.*|.*pgpool.net.*|.*clickhouse.com.*|.*portal.azure.com.*|.*vultr.com.*)$'
54+
liche -r docs -d $(pwd) -c 10 -p -h -l -s -i '^README\.md$' -x '^(.*golang.org.*|.*github.com.*|.*api.slack.com.*|.*twitter.com.*|.*linode.com.*|.*helm.sh.*|.*k8s.io.*|.*percona.com.*|.*kubernetes.io.*|.*search-guard.com.*|.*hub.docker.com.*|.*appscode.com.*|.*mongodb.com.*|.*community.arm.com.*|.*cluster.com.*|.*proxysql.com.*|.*postgresql.org.*|.*kafka.com.*|.*stackoverflow.com.*|.*redis.io.*|.*elastic.co.*|.*mysql.*|.*developer.hashicorp.com.*|.*pgpool.net.*|.*clickhouse.com.*|.*portal.azure.com.*|.*vultr.com.*)$'
5555
max_retries=5
5656
retry_count=0
5757
while [ $retry_count -lt $max_retries ]; do
58-
if liche -r docs -d $(pwd) -c 10 -p -h -l -s -x '^(.*golang.org.*|.*github.com.*|.*api.slack.com.*|.*twitter.com.*|.*linode.com.*|.*helm.sh.*|.*k8s.io.*|.*percona.com.*|.*kubernetes.io.*|.*search-guard.com.*|.*hub.docker.com.*|.*appscode.com.*|.*mongodb.com.*|.*community.arm.com.*|.*cluster.com.*|.*proxysql.com.*|.*postgresql.org.*|.*kafka.com.*|.*stackoverflow.com.*|.*redis.io.*|.*elastic.co.*|.*mysql.*|.*developer.hashicorp.com.*|.*pgpool.net.*|.*clickhouse.com.*|.*portal.azure.com.*|.*vultr.com.*)$'; then
58+
if liche -r docs -d $(pwd) -c 10 -p -h -l -s -i '^README\.md$' -x '^(.*golang.org.*|.*github.com.*|.*api.slack.com.*|.*twitter.com.*|.*linode.com.*|.*helm.sh.*|.*k8s.io.*|.*percona.com.*|.*kubernetes.io.*|.*search-guard.com.*|.*hub.docker.com.*|.*appscode.com.*|.*mongodb.com.*|.*community.arm.com.*|.*cluster.com.*|.*proxysql.com.*|.*postgresql.org.*|.*kafka.com.*|.*stackoverflow.com.*|.*redis.io.*|.*elastic.co.*|.*mysql.*|.*developer.hashicorp.com.*|.*pgpool.net.*|.*clickhouse.com.*|.*portal.azure.com.*|.*vultr.com.*)$'; then
5959
echo "Link check passed"
6060
exit 0
6161
fi

CLAUDE.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,19 @@ form (`#134`), because `.md#anchor` doesn't resolve but `.md` alone does.
1919
## liche (CI link checker)
2020

2121
CI uses a custom fork (`appscodelabs/liche`, branch `arnob-strip-prefix`) with
22-
an extra flag: `-s, --strip-relative-prefix` — strips one leading `../` from
22+
extra flags: `-s, --strip-relative-prefix` — strips one leading `../` from
2323
each relative link before checking it against the filesystem. This exists
2424
*because* of the extra-`../` convention above: it lets the checker validate
2525
against real on-disk paths without every link failing.
2626

27+
`-i, --skip-filename <regex>` excludes files by base name from being scanned
28+
entirely — CI passes `-i '^README\.md$'` because leftover `README.md` files
29+
(see the section below) intentionally use non-standard link paths that
30+
aren't meant to be checked.
31+
2732
To check a file the same way CI does:
2833
```
29-
liche -p -h -l -s <file.md>
34+
liche -p -h -l -s -i '^README\.md$' <file.md>
3035
```
3136
Never validate without `-s` and conclude links are broken — that check
3237
deliberately ignores the site's real routing.

0 commit comments

Comments
 (0)