Skip to content

Commit 468dc4c

Browse files
authored
Merge pull request #89 from lightspeedwp/claude/scaffold-github-workflows-011CV5ZbC47wBxTymxvUwGqQ
PR: Set up GitHub Actions workflows and automation scaffolds
2 parents 120b84c + d6ff4c6 commit 468dc4c

18 files changed

+293
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Canonical labels (seed). Extend as needed.
2+
- name: area:docs
3+
color: 0E6BA8
4+
description: Documentation, READMEs, indices
5+
- name: area:workflows
6+
color: FA9F42
7+
description: GitHub Actions and CI guardrails
8+
- name: area:agents
9+
color: 111827
10+
description: Repo agents, scripts, and AIOps
11+
- name: v0.2.0
12+
color: F3F4F6
13+
description: Target for next promotion cycle
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- wordpress
2+
- community
3+
- tooling
4+
- data
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
- .github
2+
- tour-operator
3+
- to-reviews
4+
- to-specials
5+
- to-starter-theme
6+
- to-team
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "Changelog",
4+
"type": "object",
5+
"properties": {
6+
"version": { "type": "string" },
7+
"date": { "type": "string", "format": "date" },
8+
"sections": {
9+
"type": "object",
10+
"properties": {
11+
"Added": { "type": "array", "items": { "type": "string" } },
12+
"Changed": { "type": "array", "items": { "type": "string" } },
13+
"Fixed": { "type": "array", "items": { "type": "string" } }
14+
},
15+
"additionalProperties": false
16+
}
17+
},
18+
"required": ["version", "date"]
19+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "Front Matter",
4+
"type": "object",
5+
"properties": {
6+
"title": { "type": "string", "minLength": 3 },
7+
"apply_to": { "type": "array", "items": { "type": "string" } },
8+
"scope": { "enum": ["community", "domain"] },
9+
"repo_category": { "type": "string" },
10+
"repo_name": { "type": "array", "items": { "type": "string" } }
11+
},
12+
"required": ["title", "apply_to"],
13+
"additionalProperties": true
14+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "Version",
4+
"type": "object",
5+
"properties": { "version": { "type": "string", "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$" } },
6+
"required": ["version"],
7+
"additionalProperties": false
8+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Instructions (WordPress Domain)
2+
- **Scope:** domain
3+
- **Owners:** Docs
4+
- **Note:** WordPress-only guidance lives here; root stays community-only
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Collections Indexer
2+
on:
3+
pull_request:
4+
branches: [ develop ]
5+
paths:
6+
- ".github/collections/**"
7+
- ".github/prompts/**"
8+
- ".github/chatmodes/**"
9+
- ".github/instructions/**"
10+
workflow_dispatch:
11+
12+
jobs:
13+
index:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
concurrency:
18+
group: collections-indexer-${{ github.ref }}
19+
cancel-in-progress: true
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Setup Node
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '20'
26+
- name: Install dependencies
27+
run: npm ci
28+
- name: Build index
29+
run: npx ts-node scripts/build-collections-index.ts
30+
- name: Validate references
31+
run: npx ts-node scripts/build-collections-index.ts --validate

.github/workflows/labeler.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Labeler
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, reopened]
5+
branches: [ develop ]
6+
7+
jobs:
8+
label:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
pull-requests: write
12+
contents: read
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Load canonical labels
16+
id: labels
17+
run: |
18+
echo "labels=$(yq -o=json .github/automation/canonical/labels.yml)" >> $GITHUB_OUTPUT
19+
- name: Apply labels (dry-run supported)
20+
env:
21+
DRY_RUN: ${{ inputs.dry_run || 'false' }}
22+
run: |
23+
# TODO: implement minimal JS that maps paths/titles to labels; no deletions of human labels
24+
echo "Applied canonical labels (dry-run=$DRY_RUN)" >> $GITHUB_STEP_SUMMARY
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Quality Gates
2+
on:
3+
pull_request:
4+
branches: [ develop ]
5+
workflow_dispatch:
6+
7+
jobs:
8+
gates:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Setup Node
15+
uses: actions/setup-node@v4
16+
with: { node-version: '20' }
17+
18+
- name: Install tools
19+
run: |
20+
npm install --no-save markdownlint-cli ajv ajv-formats yaml
21+
pipx install yamllint
22+
curl -sSL https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash | bash -s -- -b $HOME/bin
23+
echo "$HOME/bin" >> $GITHUB_PATH
24+
25+
- name: Changed files
26+
id: changed
27+
uses: tj-actions/changed-files@v45
28+
29+
- name: Changed Markdown files
30+
id: changed_md
31+
uses: tj-actions/changed-files@v45
32+
with:
33+
files: '**/*.md'
34+
35+
- name: yamllint
36+
if: contains(steps.changed.outputs.all_modified_files, '.yml') || contains(steps.changed.outputs.all_modified_files, '.yaml')
37+
run: yamllint .
38+
39+
- name: markdownlint
40+
if: steps.changed_md.outputs.any_modified == 'true'
41+
run: npx markdownlint '**/*.md' --config .markdownlint.jsonc
42+
43+
- name: actionlint
44+
run: actionlint
45+
46+
- name: Build canonicals JSON
47+
run: node scripts/canonical-to-json.js
48+
49+
- name: Validate front-matter
50+
run: node scripts/validate-frontmatter.js
51+
52+
- name: Validate version
53+
run: node scripts/validate-version.js
54+
55+
- name: Validate changelog
56+
run: node scripts/validate-changelog.js
57+
58+
- name: Summary
59+
if: always()
60+
run: |
61+
cat <<'MD' >> $GITHUB_STEP_SUMMARY
62+
### Quality Gates — develop
63+
- Lints & schema validators ran on changed files
64+
- Review failures above; fix and re-run
65+
- Owners: Workflows (primary), Docs (front-matter)
66+
MD

0 commit comments

Comments
 (0)