Skip to content

fix: fail on real label removal errors - #106

Open
thc1006 wants to merge 1 commit into
cncf:mainfrom
thc1006:fix/label-removal-failures
Open

fix: fail on real label removal errors#106
thc1006 wants to merge 1 commit into
cncf:mainfrom
thc1006:fix/label-removal-failures

Conversation

@thc1006

@thc1006 thc1006 commented Aug 26, 2026

Copy link
Copy Markdown

Description

removeLabels() caught every error from octokit.issues.removeLabel and only logged it with core.debug, so /remove, /hold cancel, and /lgtm cancel reported success even when the removal failed with a 403, a 500, or a network error, leaving the label in place.

This keeps the benign case quiet and surfaces the rest: a 404 means the label is already gone, so it stays a debug log, but any other error is rethrown. The callers cancelLabel and remove already propagate, so a real failure now reaches core.setFailed.

Fixes #105

Testing

  • npm run all passes (build, lint, pack, test)
  • a failing removal (500) fails the Action through core.setFailed, via /remove and via the /hold cancel path through cancelLabel
  • a label that is already gone (404) is ignored and the Action still succeeds
  • confirmed the failure test fails without the change

Checklist:

  • I ran npm run all to lint and build my code
  • No new dependencies
  • I have performed a self review of my own code
  • I have commented my code, particularly in hard to understand areas
  • I have made corresponding changes to the documentation (no documentation changes needed)
  • My changes generate no new warnings

@thc1006
thc1006 requested a review from jpmcb as a code owner August 26, 2026 00:01
@thc1006
thc1006 force-pushed the fix/label-removal-failures branch 2 times, most recently from 5a4c849 to 8586142 Compare August 26, 2026 16:28
removeLabels swallowed every removal error with a debug log, so /remove,
/hold cancel, and /lgtm cancel reported success when the removal failed
with a 403, a 500, or a network error. Only swallow a 404 (the label is
already gone) and rethrow anything else, which the callers propagate to
core.setFailed.

Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com>
@thc1006
thc1006 force-pushed the fix/label-removal-failures branch from 8586142 to 63246aa Compare August 26, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Label removal failures are swallowed

1 participant