Skip to content

Commit 58630e6

Browse files
authored
Fix manual developer docs run mode default (#108)
1 parent 7249bb0 commit 58630e6

3 files changed

Lines changed: 17 additions & 5 deletions

File tree

.github/workflows/developer-docs-agent.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@ name: Build With WordPress Developer Docs Agent
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
run_kind:
7+
description: Documentation run mode
8+
required: false
9+
default: maintenance
10+
type: choice
11+
options:
12+
- maintenance
13+
- bootstrap
514
push:
615
branches:
716
- trunk
@@ -21,7 +30,7 @@ jobs:
2130
uses: Automattic/docs-agent/.github/workflows/maintain-docs.yml@main
2231
with:
2332
audience: technical
24-
run_kind: ${{ github.event_name == 'workflow_dispatch' && 'bootstrap' || 'maintenance' }}
33+
run_kind: ${{ github.event.inputs.run_kind || 'maintenance' }}
2534
base_ref: trunk
2635
docs_branch: docs-agent/build-with-wordpress-developer-docs
2736
writable_paths: README.md,docs/**,plugins/**/README.md
@@ -42,7 +51,7 @@ jobs:
4251
prompt: |
4352
Maintain developer-facing documentation for Build with WordPress.
4453
45-
Manual dispatch runs the native technical documentation bootstrap package. Push-triggered runs use the native technical documentation maintenance package and should make the smallest source-grounded documentation update needed for newly merged code or finish with no changes when documentation is current.
54+
Manual dispatch defaults to the native technical documentation maintenance package; select bootstrap only to intentionally re-bootstrap the documentation. Push-triggered runs use the native technical documentation maintenance package and should make the smallest source-grounded documentation update needed for newly merged code or finish with no changes when documentation is current.
4655
4756
Write repository documentation with `docs/README.md` as the index, focused topic pages under `docs/**`, and `plugins/**/README.md` only when a plugin package needs local developer-facing contract notes. Cover the repository purpose, package layout, generated plugin artifacts, build and verification commands, skill packaging, Studio integration points, and contributor workflows.
4857

docs/contributor-workflows.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,13 @@ The repository includes GitHub Actions workflows for documentation maintenance a
147147
- `developer-docs-agent.yml` runs the technical documentation agent lane for bootstrap and maintenance documentation updates.
148148
- `skills-agent.yml` runs the skills maintenance lane.
149149

150-
Manual documentation bootstrap runs should create or improve the initial documentation structure. Push-triggered maintenance runs should make the smallest source-grounded documentation update needed for newly merged code or finish with no changes when docs are current.
150+
Manual documentation runs default to maintenance and should make the smallest source-grounded documentation update needed for newly merged code or finish with no changes when docs are current. Select bootstrap only to intentionally create or improve the initial documentation structure.
151151

152152
### Developer docs workflow contract
153153

154154
`developer-docs-agent.yml` calls the reusable `Automattic/docs-agent/.github/workflows/maintain-docs.yml` workflow for the technical documentation lane. The caller grants its `github.token` the publication permissions declared by the workflow and explicitly forwards `OPENAI_API_KEY` for live runs and the required `EXTERNAL_PACKAGE_SOURCE_POLICY` package allowlist.
155155

156-
- `workflow_dispatch` runs with `run_kind: bootstrap`; pushes to `trunk` run with `run_kind: maintenance`.
156+
- `workflow_dispatch` offers `run_kind` choices of `maintenance` (the default) and `bootstrap`; pushes to `trunk` run with `run_kind: maintenance`.
157157
- `docs_branch` is `docs-agent/build-with-wordpress-developer-docs` and `base_ref` is `trunk`.
158158
- writable documentation paths are limited to `README.md`, `docs/**`, and `plugins/**/README.md`.
159159
- Docs Agent selects its native package from the immutable reusable-workflow revision GitHub resolves for the run. The technical bootstrap lane requires a published PR; maintenance permits a no-change result.

tests/docs-agent-workflows.test.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ for (const workflow of workflows) {
8585
assert.doesNotMatch(source, /runtime-agent-full-run|runtime_(?:provider|profile|profiles|execution|dependencies|task|config)|datamachine|homeboy/i)
8686

8787
if (workflow.runKind) {
88-
assert.match(source, /run_kind: \$\{\{ github\.event_name == 'workflow_dispatch' && 'bootstrap' \|\| 'maintenance' \}\}/)
88+
const dispatchInputs = source.match(/ workflow_dispatch:\n inputs:\n([\s\S]*?) push:/)?.[1]
89+
assert.ok(dispatchInputs, "Developer Docs workflow must offer a manual run mode")
90+
assert.match(dispatchInputs, / run_kind:\n description: Documentation run mode\n required: false\n default: maintenance\n type: choice\n options:\n - maintenance\n - bootstrap/)
91+
assert.match(source, /run_kind: \$\{\{ github\.event\.inputs\.run_kind \|\| 'maintenance' \}\}/)
8992
} else {
9093
assert.doesNotMatch(source, /^ run_kind:/m)
9194
}

0 commit comments

Comments
 (0)