You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|| echo "Could not enable auto-merge (common when PR modifies .github/workflows/* using GITHUB_TOKEN fallback, or release guard, or other). Approval from prior step still applies; use manual merge if needed."
Copy file name to clipboardExpand all lines: AGENTS.md
+51Lines changed: 51 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -126,3 +126,54 @@ All I/O-dependent functions accept an `inputs` object with injectable callbacks
126
126
- All relative imports must use `.js` extensions (`from "./foo.js"`, not `from "./foo"`). Required by `moduleResolution: "node16"`.
127
127
- All commits require a `Signed-off-by` line (DCO). Use `git commit -s`.
128
128
- When adding commands to `package.json`, update the expected count in `test/suite/index.ts`.
129
+
-**Branch & PR workflow (never push a branch and stop):** For any trackable work,
130
+
after the first `git push` immediately create a draft PR (`gh pr create --draft`).
131
+
Continue development with normal `git push` (updates the draft PR + CI).
132
+
Only run `gh pr ready <number>` (and enable auto-merge if needed) when the
133
+
changes are ready for review/merge. This ensures every pushed branch is
134
+
backed by an open (draft) PR from the start. See `~/.grok/skills/owned-repo-gate/SKILL.md`.
135
+
136
+
-**Auto-approve self-modification:** PRs that change `.github/workflows/auto-approve.yml`
137
+
cause GitHub to emit only "push" validation runs (0 jobs, failure) using the PR's workflow content
138
+
(the pull_request runs use the definition from main). The approve step runs early using
139
+
GITHUB_TOKEN (before wf-changes detection or merge logic) so reviews are added when the
140
+
pull_request workflow runs from main. The Enable auto-merge step uses `|| echo` so the
141
+
workflow reports success even when merge enable falls back or is restricted. In rare cases
142
+
where no review appears, use the emergency bypass in ci-branch-protection skill + #159
143
+
(add bypass actor, `gh pr merge --admin`, remove bypass immediately). See also patchloom's
144
+
auto-approve.yml for the reference pattern.
145
+
146
+
## Release PRs - Strong Guard
147
+
148
+
Release PRs (created by release-please, titled "chore: release ..." or "chore(main): release ...", or labeled `autorelease: pending`) MUST NEVER be merged (with `gh pr merge`, `--auto`, or otherwise) without the user's explicit approval.
149
+
150
+
Merging a release PR:
151
+
- Publishes a new version of the VSIX
152
+
- Creates git tags
153
+
- Triggers the full release pipeline (Marketplace, Open VSX, attestation bundles)
154
+
- The user controls release cadence, not the agent.
155
+
156
+
### Required procedure (strong guard)
157
+
158
+
When you encounter a release PR (during triage, gate check, `gh pr list`, or status):
159
+
160
+
1. Report it clearly: "Release PR #N (vX.Y.Z) is ready to merge."
161
+
2. Use the `ask_user_question` tool (or direct question) to ask: "Should I merge it?"
162
+
3.**Only after receiving an explicit "yes" (or equivalent affirmative) from the user in this session**, proceed.
163
+
4. Before executing any merge command, run the guard:
164
+
```
165
+
bash scripts/guard-no-release-merge.sh <number>
166
+
```
167
+
The script will abort with guidance unless `ALLOW_RELEASE_MERGE=yes` is set (only after user yes).
168
+
5. If checks pass and user said yes: `gh pr merge <number> --squash` (or let auto if user directed).
169
+
170
+
This rule was strengthened after an incident where `gh pr merge 144 --auto` (under a broad "merge everything" instruction) resulted in v0.0.5 being published without explicit per-release "yes".
171
+
172
+
### Defense in depth
173
+
174
+
- Workflow: `.github/workflows/auto-approve.yml` uses author + label check + wf-changes to never enable `--auto` for release PRs.
175
+
- Script: `scripts/guard-no-release-merge.sh` provides a hard runtime guard for shell commands.
176
+
- Documentation: This section + global AGENTS.md rule.
177
+
- Branch protection + ruleset: still enforces checks, but does not replace user approval for releases.
178
+
179
+
Never bypass the guard "just this once" or rationalize. Ask every time.
0 commit comments