File tree Expand file tree Collapse file tree
.github/scripts/review-sync Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -177,12 +177,14 @@ function determineLabel(approvals) {
177177 * Sync the queue label on a single PR.
178178 *
179179 * Order of operations (non-negotiable):
180- * 1. Check if the correct label is already present → skip if yes
181- * 2. ADD the correct label first
182- * 3. THEN remove any stale queue labels
180+ * 1. Compute stale queue labels on the PR
181+ * 2. Skip only if correct label is already present AND no stale labels exist
182+ * 3. ADD the correct label first
183+ * 4. THEN remove any stale queue labels
183184 *
184185 * This ensures a PR never has zero queue labels, even if the process
185- * crashes mid-run.
186+ * crashes mid-run. Stale labels are always cleaned up, even when the
187+ * correct label was already present.
186188 *
187189 * @param {object } github - Octokit instance
188190 * @param {string } owner - Repository owner
You can’t perform that action at this time.
0 commit comments