Skip to content

Commit d0a03bb

Browse files
clubandersonclaude
andauthored
🌱 Remove legacy typo and link checker workflows (#171)
* 🌱 Remove legacy caller workflow Replaced by gh-aw agentic workflow in llm-d-infra. Signed-off-by: Andy Anderson <andy@clubanderson.com> Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * ✨ Add GitHub Agentic Workflows for typo, link, and upstream checks Replace legacy CI callers with AI-powered gh-aw workflows: - typo-checker.md: domain-aware typo checking on PR changed files - link-checker.md: smart link checking with transient failure handling - upstream-monitor.md: daily scan for upstream breaking changes - copilot-setup-steps.yml: installs gh-aw CLI extension - .gitattributes: marks lock files as generated - docs/upstream-versions.md: template for tracking dependency pins Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: Andrew Anderson <andy@clubanderson.com> * 🐛 Recompile gh-aw lock files with v0.45.0 - Upgrade from gh-aw v0.33.12 to v0.45.0 - Lock files 8x smaller (50KB vs 400KB) - Fix trailing whitespace that broke pre-commit hooks - Update network config to use ecosystem names Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: Andrew Anderson <andy@clubanderson.com> * 🐛 Fix CI: trailing EOF, upstream-versions link, licenserc - Fix lock files trailing blank line (end-of-file-fixer) - Fix relative link in docs/upstream-versions.md - Add .gitattributes to licenserc excludes where needed Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: Andrew Anderson <andy@clubanderson.com> --------- Signed-off-by: Andy Anderson <andy@clubanderson.com> Signed-off-by: Andrew Anderson <andy@clubanderson.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent bc73c4f commit d0a03bb

File tree

10 files changed

+3563
-8
lines changed

10 files changed

+3563
-8
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.github/workflows/*.lock.yml linguist-generated=true merge=ours
2+
.github/workflows/*.campaign.g.md linguist-generated=true merge=ours

.github/workflows/check-typos.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: "Copilot Setup Steps"
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
paths:
7+
- .github/workflows/copilot-setup-steps.yml
8+
9+
jobs:
10+
copilot-setup-steps:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
steps:
15+
- name: Install gh-aw extension
16+
run: |
17+
curl -fsSL https://raw.githubusercontent.com/githubnext/gh-aw/refs/heads/main/install-gh-aw.sh | bash
18+
19+
- name: Verify gh-aw installation
20+
run: gh aw version

.github/workflows/link-checker.lock.yml

Lines changed: 1047 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/link-checker.md

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
---
2+
description: |
3+
AI-powered link checker for pull requests. Checks only changed markdown files,
4+
distinguishes real broken links from transient failures, and posts actionable
5+
PR comments instead of failing CI on flaky external URLs.
6+
7+
on:
8+
pull_request:
9+
paths:
10+
- "**/*.md"
11+
12+
permissions: read-all
13+
14+
network:
15+
allowed:
16+
- defaults
17+
- github
18+
19+
safe-outputs:
20+
add-comment:
21+
add-labels:
22+
allowed: [broken-links]
23+
24+
tools:
25+
github:
26+
toolsets: [repos, pull_requests]
27+
web-fetch:
28+
bash: [ ":*" ]
29+
30+
timeout-minutes: 10
31+
---
32+
33+
# Link Checker
34+
35+
## Job Description
36+
37+
Your name is ${{ github.workflow }}. You are an **AI-Powered Link Checker** for the repository `${{ github.repository }}`.
38+
39+
### Mission
40+
41+
Check markdown links in changed files on pull requests. Distinguish real broken links from transient network issues. Provide actionable feedback as PR comments instead of failing CI on flaky external URLs.
42+
43+
### Your Workflow
44+
45+
#### Step 1: Identify Changed Markdown Files
46+
47+
Get the list of changed markdown files in this PR:
48+
49+
```bash
50+
gh pr diff ${{ github.event.pull_request.number }} --name-only | grep '\.md$'
51+
```
52+
53+
If no markdown files changed, exit cleanly with a message: "No markdown files changed in this PR."
54+
55+
#### Step 2: Extract and Check Links
56+
57+
For each changed markdown file:
58+
59+
1. Extract all links (both `[text](url)` and bare URLs)
60+
2. Categorize links:
61+
- **Internal links**: relative paths to files in the repo (e.g., `./docs/foo.md`, `../README.md`)
62+
- **Anchor links**: `#section-name` references
63+
- **External links**: `https://...` URLs
64+
65+
3. Check each link:
66+
- **Internal links**: verify the target file exists in the repo using `ls` or `test -f`
67+
- **Anchor links**: verify the heading exists in the target file
68+
- **External links**: use `curl -sL -o /dev/null -w '%{http_code}' --max-time 10` to check
69+
- For external URLs that return 4xx: mark as **definitely broken**
70+
- For external URLs that return 5xx or timeout: retry once after 5 seconds
71+
- For external URLs that still fail after retry: mark as **possibly transient**
72+
73+
#### Step 3: Classify Results
74+
75+
Group results into categories:
76+
77+
- **Broken** (fail): Internal links to non-existent files, 404 external URLs
78+
- **Possibly transient** (warn): External URLs returning 5xx, timeouts, DNS failures
79+
- **OK**: All links that resolve successfully
80+
81+
#### Step 4: Report
82+
83+
If there are broken or possibly transient links, post a **single** PR comment summarizing:
84+
85+
```markdown
86+
## Link Check Results
87+
88+
### Broken Links (action required)
89+
| File | Line | Link | Status |
90+
|------|------|------|--------|
91+
| docs/foo.md | 42 | [example](https://broken.url) | 404 Not Found |
92+
93+
### Possibly Transient (may be temporary)
94+
| File | Line | Link | Status |
95+
|------|------|------|--------|
96+
| docs/bar.md | 15 | [api docs](https://flaky.url) | Timeout |
97+
98+
### Summary
99+
- X broken links found (action required)
100+
- Y possibly transient links found (may resolve on retry)
101+
- Z links checked successfully
102+
```
103+
104+
If ALL broken links are external and returned 5xx or timeout (i.e., all "possibly transient"), do NOT add the `broken-links` label.
105+
106+
If there are definitely broken links (404, internal file missing), add the `broken-links` label.
107+
108+
If all links are OK, do not post a comment.
109+
110+
### Domain-Specific Knowledge
111+
112+
These domains are known to have intermittent availability or require authentication — treat failures as "possibly transient":
113+
- `registry.k8s.io`
114+
- `quay.io`
115+
- `ghcr.io`
116+
- `nvcr.io`
117+
- LinkedIn URLs (always return 999)
118+
- `docs.google.com` (may require auth)
119+
120+
### Important Rules
121+
122+
1. Only check files that changed in this PR — never scan the entire repo
123+
2. Always post at most ONE comment per PR run (update existing if re-running)
124+
3. Do not fail the workflow — use comments and labels for feedback
125+
4. Be concise — developers should be able to fix issues quickly from the comment
126+
127+
### Exit Conditions
128+
129+
- Exit if no markdown files changed
130+
- Exit if all links are valid

0 commit comments

Comments
 (0)