fix: fail on real label removal errors - #106
Open
thc1006 wants to merge 1 commit into
Open
Conversation
thc1006
force-pushed
the
fix/label-removal-failures
branch
2 times, most recently
from
August 26, 2026 16:28
5a4c849 to
8586142
Compare
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
force-pushed
the
fix/label-removal-failures
branch
from
August 26, 2026 16:34
8586142 to
63246aa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
removeLabels()caught every error fromoctokit.issues.removeLabeland only logged it withcore.debug, so/remove,/hold cancel, and/lgtm cancelreported 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
cancelLabelandremovealready propagate, so a real failure now reachescore.setFailed.Fixes #105
Testing
npm run allpasses (build, lint, pack, test)core.setFailed, via/removeand via the/hold cancelpath throughcancelLabelChecklist:
npm run allto lint and build my code