Skip to content

Commit 06fdf32

Browse files
committed
docs: update syncLabel JSDoc to match revised early-return logic
Signed-off-by: darshit2308 <darshit2308@gmail.com>
1 parent 222e06b commit 06fdf32

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)