Skip to content

Commit d545ce1

Browse files
🏗️🔧:take the label back off once answered
The label was removed when the queue refused and left in place when it landed, so a merged pull request went on advertising work the queue had already finished. It is a request rather than a state: once answered, either way, it has been spent. Removing it cannot start another run, since `unlabeled` is not one of the events this workflow listens for, and failing to remove it will not fail a run that has already merged. Signed-off-by: Derek Lewis <DerekNonGeneric@inf.is> Assisted-by: Claude-Code:claude-opus-5
1 parent 2c06bdf commit d545ce1

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

.github/workflows/commit-queue.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,25 @@ jobs:
6565
NUMBER: ${{ github.event.pull_request.number }}
6666
run: node build/tasks/land-pull-request.mts "${NUMBER}"
6767

68+
# The label is a request, not a state: once the queue has answered it,
69+
# one way or the other, it has been spent. Leaving it on a landed pull
70+
# request would say the queue still had something to do.
71+
#
72+
# `unlabeled` is not among the events above, so taking it off cannot
73+
# start another run. Failing to take it off is not worth failing a run
74+
# that has already merged, hence the `|| true`.
75+
- name: Take the label back off
76+
if: always() && steps.token.outcome == 'success'
77+
env:
78+
GH_TOKEN: ${{ steps.token.outputs.token }}
79+
NUMBER: ${{ github.event.pull_request.number }}
80+
run: gh pr edit "$NUMBER" --remove-label commit-queue || true
81+
6882
- name: Say why it did not land
69-
if: failure()
83+
if: failure() && steps.token.outcome == 'success'
7084
env:
7185
GH_TOKEN: ${{ steps.token.outputs.token }}
7286
NUMBER: ${{ github.event.pull_request.number }}
7387
RUN: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
7488
run: |
75-
gh pr edit "$NUMBER" --remove-label commit-queue
76-
gh pr comment "$NUMBER" --body "The commit queue did not land this. See $RUN — the label has been removed, so re-apply it once the reason is dealt with."
89+
gh pr comment "$NUMBER" --body "The commit queue did not land this. See $RUN — the label has been taken back off, so re-applying it is a deliberate second try."

0 commit comments

Comments
 (0)