|
| 1 | +--- |
| 2 | +applyTo: ".github/workflows/**/*.md" |
| 3 | +description: Rules for editing gh-aw agentic workflow Markdown files. |
| 4 | +--- |
| 5 | + |
| 6 | +# Agentic Workflow Edit Rules (`gh aw`) |
| 7 | + |
| 8 | +This repository authors GitHub Actions agentic workflows in Markdown using |
| 9 | +[`gh aw`](https://github.com/githubnext/gh-aw). Each workflow `.md` file under |
| 10 | +`.github/workflows/` compiles to a sibling `.lock.yml`, and **only the |
| 11 | +`.lock.yml` is executed by GitHub Actions at runtime.** |
| 12 | + |
| 13 | +## Mandatory rule |
| 14 | + |
| 15 | +Whenever you create, edit, rename, or delete a file matching |
| 16 | +`.github/workflows/**/*.md`, you **MUST**, in the **same commit / PR**: |
| 17 | + |
| 18 | +1. Run `gh aw compile` from the repository root. |
| 19 | +2. Stage and commit the regenerated sibling `<name>.lock.yml`. |
| 20 | +3. If you deleted a workflow `.md`, also delete its `.lock.yml`. |
| 21 | + |
| 22 | +If the `.lock.yml` is stale or missing, the workflow fails at runtime |
| 23 | +(see PR #4279 for the exact failure mode). The |
| 24 | +`Verify gh aw lock files` CI check will block the PR in that case. |
| 25 | + |
| 26 | +## How to verify locally |
| 27 | + |
| 28 | +```bash |
| 29 | +gh aw compile |
| 30 | +git status # both the .md and .lock.yml should appear |
| 31 | +gh aw compile # second run must be a no-op (clean diff) |
| 32 | +``` |
| 33 | + |
| 34 | +## Code-review checklist |
| 35 | + |
| 36 | +When reviewing a PR that touches `.github/workflows/**/*.md`: |
| 37 | + |
| 38 | +- [ ] A matching `.lock.yml` is updated in the same PR. |
| 39 | +- [ ] `gh aw compile` produces no further diff on top of the PR. |
| 40 | +- [ ] If new tools, network endpoints, or permissions are added in the `.md`, |
| 41 | + they are present in the regenerated `.lock.yml`. |
| 42 | + |
| 43 | +## Out of scope |
| 44 | + |
| 45 | +- Do **not** hand-edit `.lock.yml` files. They are generated; edit the `.md` |
| 46 | + source and recompile. |
| 47 | +- For deeper authoring guidance (creating, debugging, upgrading workflows), |
| 48 | + invoke the `agentic-workflows` agent at |
| 49 | + `.github/agents/agentic-workflows.agent.md`. |
0 commit comments