Skip to content

Commit 5b87b89

Browse files
committed
fix: throw on non-404 stale label removal errors
Addresses CodeRabbit review feedback. Previously, if the API failed to remove a stale label (e.g. due to rate limits or network issues), the error was logged but execution continued. Since the new label was already added earlier in the function, this left the PR in an invalid state with multiple mutually-exclusive queue labels. Now, non-404 errors are explicitly re-thrown to fail the workflow and alert maintainers, preventing broken label states. Signed-off-by: darshit2308 <darshit2308@gmail.com>
1 parent 96acaa5 commit 5b87b89

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

.github/scripts/review-sync/helpers/labels.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ async function syncLabel(github, owner, repo, pr, dryRun) {
162162
} else {
163163
const message = error instanceof Error ? error.message : String(error);
164164
console.error(` ✗ Failed to remove "${stale}": ${message}`);
165+
throw error; // Re-throw to prevent silently leaving PR in a broken multi-label state
165166
}
166167
}
167168
}

0 commit comments

Comments
 (0)