Skip to content

Commit cb69e7d

Browse files
clubandersonclaude
andcommitted
🌱 Standardize governance workflows, pre-commit, and tooling
- Replace local governance workflows with thin callers to llm-d-infra reusable workflows - Add pre-commit config and CI integration Consolidates llm-d#613 and llm-d#614. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: Andrew Anderson <andy@clubanderson.com>
1 parent cdd8760 commit cb69e7d

File tree

11 files changed

+101
-165
lines changed

11 files changed

+101
-165
lines changed
Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
11
name: Check Typos
2-
32
on:
43
pull_request:
54
push:
65

76
jobs:
87
typos:
9-
runs-on: ubuntu-latest
10-
11-
steps:
12-
- name: Checkout code
13-
uses: actions/checkout@v6
14-
15-
- name: Check typos
16-
uses: crate-ci/typos@v1.43.0
17-
8+
uses: llm-d/llm-d-infra/.github/workflows/reusable-typos.yml@main

‎.github/workflows/ci-pr-checks.yaml‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,13 @@ jobs:
4040
- name: Checkout source
4141
uses: actions/checkout@v6
4242

43-
- name: Sanity check repo contents
44-
run: ls -la
43+
- name: Set up Python (for pre-commit and CGO)
44+
uses: actions/setup-python@v5
45+
with:
46+
python-version: '3.12'
47+
48+
- name: Run pre-commit checks
49+
uses: pre-commit/action@v3.0.1
4550

4651
- name: Extract Go version from go.mod
4752
run: sed -En 's/^go (.*)$/GO_VERSION=\1/p' go.mod >> $GITHUB_ENV
Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,9 @@
1-
name: Check Signed Commits in PR
2-
3-
on:
4-
pull_request_target:
1+
name: Check Signed Commits
2+
on: pull_request_target
53

64
jobs:
7-
check-signed-commits:
8-
name: Check signed commits in PR
9-
runs-on: ubuntu-latest
5+
signed-commits:
6+
uses: llm-d/llm-d-infra/.github/workflows/reusable-signed-commits.yml@main
107
permissions:
118
contents: read
12-
pull-requests: write # Required to post comments on PRs
13-
steps:
14-
- name: Check signed commits in PR
15-
uses: 1Password/check-signed-commits-action@v1 # Use the action
16-
with:
17-
comment: |
18-
🚨 Unsigned commits detected! Please sign your commits.
19-
20-
For instructions on how to set up GPG/SSH signing and verify your commits, please see [GitHub Documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification).
9+
pull-requests: write
Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,11 @@
1-
name: Markdown Link Checker
2-
1+
name: Markdown Link Check
32
on:
43
push:
5-
branches: [ main ]
4+
branches: [main]
65
pull_request:
7-
branches: [ main ]
6+
branches: [main]
87
workflow_dispatch:
98

109
jobs:
11-
lychee:
12-
name: Check Markdown Links
13-
runs-on: ubuntu-latest
14-
15-
steps:
16-
- name: Checkout code
17-
uses: actions/checkout@v6
18-
19-
- name: Run lychee link checker
20-
uses: lycheeverse/lychee-action@v2.7.0
21-
with:
22-
args: '--config .lychee.toml --verbose --no-progress **/*.md'
23-
fail: true
10+
links:
11+
uses: llm-d/llm-d-infra/.github/workflows/reusable-md-link-check.yml@main
Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
1-
name: Label non-main PRs
2-
1+
name: Non-Main Gatekeeper
32
on:
43
pull_request:
54
types: [opened, edited, synchronize, reopened]
65

76
jobs:
8-
add-label:
9-
runs-on: ubuntu-latest
10-
steps:
11-
- name: Add labels when base branch is not main
12-
if: github.event.pull_request.base.ref != 'main'
13-
uses: actions-ecosystem/action-add-labels@v1
14-
with:
15-
github_token: ${{ secrets.GITHUB_TOKEN }}
16-
labels: |
17-
do-not-merge/hold
7+
gatekeeper:
8+
uses: llm-d/llm-d-infra/.github/workflows/reusable-non-main-gatekeeper.yml@main
Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,15 @@
1-
# Run specified actions or jobs for issue and PR comments
2-
3-
name: "Prow github actions"
1+
name: Prow Commands
42
on:
53
issue_comment:
64
types: [created]
75

8-
# Grant additional permissions to the GITHUB_TOKEN
96
permissions:
10-
# Allow labeling issues
117
issues: write
12-
# Allow adding a review to a pull request
138
pull-requests: write
149

1510
jobs:
16-
prow-execute:
17-
runs-on: ubuntu-latest
18-
steps:
19-
- uses: jpmcb/prow-github-actions@v2.0.0
20-
with:
21-
github-token: "${{ secrets.GITHUB_TOKEN }}"
22-
prow-commands: "/assign
23-
/unassign
24-
/approve
25-
/retitle
26-
/area
27-
/kind
28-
/priority
29-
/remove
30-
/lgtm
31-
/close
32-
/reopen
33-
/lock
34-
/milestone
35-
/hold
36-
/cc
37-
/uncc"
11+
prow:
12+
uses: llm-d/llm-d-infra/.github/workflows/reusable-prow-commands.yml@main
13+
permissions:
14+
issues: write
15+
pull-requests: write
Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
1-
# This Github workflow will check every 5m for PRs with the lgtm label and will attempt to automatically merge them.
2-
# If the hold label is present, it will block automatic merging.
3-
4-
name: "Prow merge on lgtm label"
1+
name: Prow Auto-merge
52
on:
63
schedule:
7-
- cron: "*/5 * * * *" # every 5 minutes
4+
- cron: "*/5 * * * *"
85

96
jobs:
107
auto-merge:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- uses: jpmcb/prow-github-actions@v2.0.0
14-
with:
15-
jobs: 'lgtm'
16-
github-token: "${{ secrets.GITHUB_TOKEN }}"
17-
merge-method: 'squash'
18-
8+
uses: llm-d/llm-d-infra/.github/workflows/reusable-prow-automerge.yml@main
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
name: Run Jobs on PR
1+
name: Prow Remove LGTM
22
on: pull_request
33

44
jobs:
5-
execute:
6-
runs-on: ubuntu-latest
7-
steps:
8-
- uses: jpmcb/prow-github-actions@v2.0.0
9-
with:
10-
jobs: lgtm
11-
github-token: '${{ secrets.GITHUB_TOKEN }}'
5+
remove-lgtm:
6+
uses: llm-d/llm-d-infra/.github/workflows/reusable-prow-remove-lgtm.yml@main
Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,11 @@
1-
name: 'Mark stale issues'
2-
1+
name: Mark Stale Issues
32
on:
43
schedule:
54
- cron: '0 1 * * *'
65

76
jobs:
8-
stale-issues:
9-
runs-on: ubuntu-latest
7+
stale:
8+
uses: llm-d/llm-d-infra/.github/workflows/reusable-stale.yml@main
109
permissions:
1110
issues: write
1211
pull-requests: write
13-
steps:
14-
- name: 'Mark stale issues and PRs'
15-
uses: actions/stale@v10
16-
with:
17-
days-before-issue-stale: 90
18-
days-before-pr-stale: 21
19-
days-before-close: -1
20-
stale-issue-label: 'lifecycle/stale'
21-
exempt-issue-labels: 'lifecycle/rotten'
22-
stale-issue-message: 'This issue is marked as stale after 90d of inactivity. After an additional 30d of inactivity (15d to become rotten, then 15d more), it will be closed. To prevent this issue from being closed, add a comment or remove the `lifecycle/stale` label.'
23-
stale-pr-label: 'lifecycle/stale'
24-
exempt-pr-labels: 'lifecycle/rotten'
25-
stale-pr-message: 'This PR is marked as stale after 21d of inactivity. After an additional 14d of inactivity (7d to become rotten, then 7d more), it will be closed. To prevent this PR from being closed, add a comment or remove the `lifecycle/stale` label.'
26-
27-
- name: 'Mark items rotten'
28-
uses: actions/stale@v10
29-
with:
30-
days-before-issue-stale: 15
31-
days-before-pr-stale: 7
32-
days-before-close: -1
33-
stale-issue-label: 'lifecycle/rotten'
34-
stale-pr-label: 'lifecycle/rotten'
35-
only-labels: 'lifecycle/stale'
36-
labels-to-remove-when-stale: 'lifecycle/stale'
37-
38-
- name: 'Close rotten items'
39-
uses: actions/stale@v10
40-
with:
41-
days-before-stale: -1
42-
days-before-issue-close: 15
43-
days-before-pr-close: 7
44-
stale-issue-label: 'lifecycle/rotten'
45-
stale-issue-message: 'This issue is being closed after 120d of inactivity.'
46-
stale-pr-label: 'lifecycle/rotten'
47-
stale-pr-message: 'This PR is being closed after 35d of inactivity.'
Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,12 @@
1-
name: 'Unstale Issue'
2-
1+
name: Unstale Issues
32
on:
43
issues:
5-
types: [ reopened ]
4+
types: [reopened]
65
issue_comment:
7-
types: [ created ]
6+
types: [created]
87

98
jobs:
10-
remove-stale:
11-
runs-on: ubuntu-latest
9+
unstale:
10+
uses: llm-d/llm-d-infra/.github/workflows/reusable-unstale.yml@main
1211
permissions:
1312
issues: write
14-
if: >-
15-
github.event.issue.state == 'open' &&
16-
(contains(github.event.issue.labels.*.name, 'lifecycle/stale') ||
17-
contains(github.event.issue.labels.*.name, 'lifecycle/rotten'))
18-
steps:
19-
- name: 'Checkout repository'
20-
uses: actions/checkout@v6
21-
22-
- name: 'Remove stale labels'
23-
env:
24-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25-
run: |
26-
echo "Removing 'stale' label from issue #${{ github.event.issue.number }}"
27-
gh issue edit ${{ github.event.issue.number }} --remove-label "lifecycle/stale,lifecycle/rotten"

0 commit comments

Comments
 (0)