Repository navigation
71 lines (67 loc) · 3.18 KB
/
Copy pathauto-queue-t1.yml
File metadata and controls
71 lines (67 loc) · 3.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Auto-queue T0/T1
# #3248. A T2/T3 pull request enters the merge queue when `pass-label.yml` writes its `pass` label from a
# counting verdict. A T0/T1 pull request needs no verdict, so no label ever appears and nothing starts its
# queue entry: every one of them waits for a person to press "Add to merge queue" (5 of the 12 T1 merges
# in the week to 2026-11-20 did, 17–37 minutes after they were ready). This workflow is that trigger.
#
# Report mode is the default and the shipped state. The decision — "would enqueue" or "refused, and why" —
# goes to the job summary and nothing else is written: no comment, no label, no body edit. The switch to
# pressing the button is the repository variable `AUTO_QUEUE_T1_MODE=execute`, set by FlyBot Lead after
# the owner reads a day of summaries, or a single `workflow_dispatch` with `mode: execute`.
#
# Three events, so a ready pull request is seen twice over: the `Test` run it just finished (fast path), a
# five-minute sweep (the safety net for a Run that ended before its checks were all reported), and a
# manual dispatch. The job checks out `main` and never the pull request's code, so a fork's tree is never
# executed here.
#
# Which heads this trigger may start: a branch of this repository, or the team's fork when BOTH hold —
# `head repo == HugoXK/FlyBot` AND `author == HugoXK`. Every other fork is refused, including a head whose
# repository carries that name but whose author does not (owner decision 2026-11-20; `headRefusal()` in
# `auto-queue-t1.mjs` is the one implementation, and the three tests pin the three directions).
#
# `actions: write` is a deliberate, single-purpose escalation beyond the design's list in the issue: it
# exists only for the one `Test` dispatch on `main` after an enqueue lands, because a merge made with a
# `GITHUB_TOKEN` starts no push pipeline by itself. No other write happens in this job — no other
# workflow dispatch, no secret read, no repository write — and the permission belongs to this job alone:
# do not copy it into another job or widen it to `actions: write` elsewhere in this repository.
on:
workflow_run:
workflows: [Test]
types: [completed]
schedule:
- cron: '*/5 * * * *'
workflow_dispatch:
inputs:
mode:
description: 'report (presses nothing) or execute (enqueues)'
type: choice
options: [report, execute]
default: report
concurrency:
group: auto-queue-t1
cancel-in-progress: false
permissions:
contents: read
pull-requests: write
checks: read
actions: write
jobs:
decide:
name: auto-queue-t1
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: main
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
- name: Decide, and enqueue only in execute mode
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
AUTO_QUEUE_T1_MODE: ${{ vars.AUTO_QUEUE_T1_MODE }}
INPUT_MODE: ${{ inputs.mode }}
run: node .github/scripts/auto-queue-t1.mjs