diff --git a/.github/workflows/queue.yml b/.github/workflows/queue.yml index b4cb104eb18..925431dfcbc 100644 --- a/.github/workflows/queue.yml +++ b/.github/workflows/queue.yml @@ -17,6 +17,11 @@ on: types: [opened, synchronize, reopened, edited] merge_group: types: [checks_requested] + # Reports the skipped context on a branch's head without a pull_request + # event. A PR whose test merge commit predates this workflow gets no + # pull_request run from it (GitHub runs PR workflows from that commit), so + # `gh workflow run queue.yml --ref ` gives it the context. + workflow_dispatch: permissions: contents: read diff --git a/sh/gh/alert.sh b/sh/gh/alert.sh index 246c4c63725..0ee5447a7c4 100755 --- a/sh/gh/alert.sh +++ b/sh/gh/alert.sh @@ -116,7 +116,8 @@ const files = (await Bun.stdin.text()).split("\n").filter(Boolean); // only by these needs no entry. const UNWATCHED = new Set(["pull_request", "pull_request_target", "merge_group", "workflow_call"]); // These workflows validate branches, warm caches, or run an agent on request; none publishes. -const CI_ONLY = new Set(["Cache", "OBS", "Platform", "Pullfrog", "Quest", "Runner VM"]); +// A Queue dispatch only reports the skipped merge queue context on a branch head. +const CI_ONLY = new Set(["Cache", "OBS", "Platform", "Pullfrog", "Quest", "Queue", "Runner VM"]); const names = []; for (const file of files) { const doc = Bun.YAML.parse(await Bun.file(file).text()); diff --git a/sh/gh/queue.test.ts b/sh/gh/queue.test.ts index 6e5073d6168..274edac4667 100644 --- a/sh/gh/queue.test.ts +++ b/sh/gh/queue.test.ts @@ -46,6 +46,8 @@ assert.equal(await Bun.file(".github/workflows/land.yml").exists(), false, "no w // host's runner, read-only and without secrets. const queue = await workflow("queue"); assert.deepEqual(queue.on.merge_group, { types: ["checks_requested"] }); +// A dispatch only reports the skipped context on a branch head. +assert.ok("workflow_dispatch" in queue.on); assert.deepEqual(queue.on.pull_request.branches, ["main"]); assert.ok(queue.on.pull_request.types.includes("edited"), "retargeting to main must report the context"); assert.equal(queue.on.pull_request.paths, undefined, "the required context must always report");