Skip to content

Commit 408e4e0

Browse files
committed
✨ Add governance workflows and tooling conformance
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
1 parent 4e41cfe commit 408e4e0

20 files changed

+3667
-42
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/aw/actions-lock.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"entries": {
3+
"actions/github-script@v8": {
4+
"repo": "actions/github-script",
5+
"version": "v8",
6+
"sha": "ed597411d8f924073f98dfc5c65a23a2325f34cd"
7+
},
8+
"github/gh-aw/actions/setup@v0.45.0": {
9+
"repo": "github/gh-aw/actions/setup",
10+
"version": "v0.45.0",
11+
"sha": "58d1d157fbac0f1204798500faefc4f7461ebe28"
12+
}
13+
}
14+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: Check Signed Commits
2+
on: pull_request_target
3+
4+
jobs:
5+
signed-commits:
6+
uses: llm-d/llm-d-infra/.github/workflows/reusable-signed-commits.yml@main
7+
permissions:
8+
contents: read
9+
pull-requests: write
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
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: Non-Main Gatekeeper
2+
on:
3+
pull_request:
4+
types: [opened, edited, synchronize, reopened]
5+
6+
jobs:
7+
gatekeeper:
8+
uses: llm-d/llm-d-infra/.github/workflows/reusable-non-main-gatekeeper.yml@main

.github/workflows/prow-github.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Prow Commands
2+
on:
3+
issue_comment:
4+
types: [created]
5+
6+
permissions:
7+
issues: write
8+
pull-requests: write
9+
10+
jobs:
11+
prow:
12+
uses: llm-d/llm-d-infra/.github/workflows/reusable-prow-commands.yml@main
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: Prow Auto-merge
2+
on:
3+
schedule:
4+
- cron: "*/5 * * * *"
5+
6+
jobs:
7+
auto-merge:
8+
uses: llm-d/llm-d-infra/.github/workflows/reusable-prow-automerge.yml@main
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name: Prow Remove LGTM
2+
on: pull_request
3+
4+
jobs:
5+
remove-lgtm:
6+
uses: llm-d/llm-d-infra/.github/workflows/reusable-prow-remove-lgtm.yml@main

0 commit comments

Comments
 (0)