Skip to content

Commit 193f440

Browse files
BenBtgCopilot
andcommitted
fix(bug-fix): make status label application conditional on label existence
Address Copilot feedback about missing status labels causing runtime failures. The workflow previously instructed unconditional application of `needs-assessment`, `fix-blocked`, and `fix-proposed`. In repositories where those labels are not pre-created, `add_labels` fails and can break the run. Updated Steps 1/3/4/8 to require existence checks before adding those labels: - add the label only if it exists - otherwise skip labeling and explicitly note that in the comment This preserves the status-label UX when labels exist while keeping execution robust in repos that have not created every optional status label yet. Recompiled with gh-aw v0.79.8 and kept checkout v7.0.0 pin fixups. Assisted-by: GitHub Copilot (model: Claude Opus 4.8, autonomous) Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 1ba53c6 commit 193f440

2 files changed

Lines changed: 18 additions & 10 deletions

File tree

.github/workflows/bug-fix.lock.yml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/bug-fix.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ If **no** assessment comment exists on the issue:
8787
1. Add **one** comment explaining that a fix cannot be proposed because no
8888
`bug-assess` assessment was found, and ask a maintainer to apply the
8989
`bug-assess` label first so the assessment stage can run.
90-
2. Add the `needs-assessment` label.
90+
2. If the `needs-assessment` label already exists in this repository, add it.
91+
If it does not exist, skip labeling and note that in the comment.
9192
3. **Stop.** Do not read the codebase, do not edit files, do not open a PR.
9293

9394
## Step 2 — Recover the Slug and the Contract
@@ -144,8 +145,9 @@ fetch it only under these rules:
144145
Before changing any code, check the assessment's verdict:
145146

146147
- **Invalid** — there is nothing to fix. Add **one** comment stating that the
147-
assessment marked this report invalid (quote its reason), add the
148-
`fix-blocked` label, and **stop**. Do not open a PR.
148+
assessment marked this report invalid (quote its reason). If the
149+
`fix-blocked` label exists in this repository, add it; otherwise skip labeling
150+
and note that in the comment. Then **stop**. Do not open a PR.
149151
- **Likely valid, needs reproduction** with unresolved `[NEEDS CLARIFICATION]`
150152
items — the fix would be a guess. Add **one** comment listing the open
151153
questions that block a confident fix, add the `needs-reproduction` label, and
@@ -172,8 +174,10 @@ Implement the **preferred** remediation from the assessment:
172174
did not call for.
173175
- If you discover the assessment was **wrong** (the proposed fix does not work,
174176
or the root cause is elsewhere), **stop modifying code**. Revert your partial
175-
edits, add a comment summarizing the new finding, add the `fix-blocked` label,
176-
recommend re-running `bug-assess`, and **stop** without opening a PR.
177+
edits, add a comment summarizing the new finding. If the `fix-blocked` label
178+
exists in this repository, add it; otherwise skip labeling and note that in
179+
the comment. Recommend re-running `bug-assess`, and **stop** without opening a
180+
PR.
177181

178182
## Step 5 — Run Local Checks
179183

@@ -275,10 +279,14 @@ the PR for detail rather than pasting the full diff.
275279

276280
## Step 8 — Apply a Status Label
277281

278-
After opening the PR and commenting, add the `fix-proposed` label to the issue.
279-
Add **exactly one** status label per run: if you stopped early in Steps 1/3/4 you
280-
will already have applied `needs-assessment`, `needs-reproduction`, or
281-
`fix-blocked` instead — do not also add `fix-proposed` in those cases.
282+
After opening the PR and commenting, if the `fix-proposed` label exists in this
283+
repository, add it. If it does not exist, skip labeling and note that in the
284+
comment.
285+
286+
Add **exactly one** status label per run when the label exists: if you stopped
287+
early in Steps 1/3/4 you will already have applied `needs-assessment`,
288+
`needs-reproduction`, or `fix-blocked` instead — do not also add `fix-proposed`
289+
in those cases.
282290

283291
## Guardrails
284292

0 commit comments

Comments
 (0)