Skip to content

Commit c48ca29

Browse files
jamesadevineCopilot
andcommitted
fix(workflows): switch recompile trigger to release:published and drop broken Step 0
The previous workflow_run-based trigger fired on every push to main, and its Step 0 bail-out tried to read github.event.workflow_run.{conclusion,head_branch} from \ inside the AWF chroot sandbox. The event file isn't reliably readable by the sandbox user, so jq silently returned empty for both fields and the agent bailed on every invocation. - Switch the trigger from workflow_run on the Release workflow to release: published, which only fires when a release is actually published. Step 2's bounded retry still handles the brief window between release creation and asset upload by the release.yml build job. - Remove Step 0 entirely. The 'no new release published' case is already handled by Step 4 (no diff -> noop) and the 'release published but assets missing' case is already handled by Step 2 (bounded retry -> report-incomplete on timeout). - Drop the corresponding bullet from the 'When NOT to open a PR' list. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 665ad0e commit c48ca29

2 files changed

Lines changed: 23 additions & 55 deletions

File tree

.github/workflows/recompile-safe-output-fixtures.lock.yml

Lines changed: 19 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/recompile-safe-output-fixtures.md

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
---
22
on:
3-
workflow_run:
4-
workflows: ["Release"]
5-
types: [completed]
6-
branches: [main]
3+
release:
4+
types: [published]
75
workflow_dispatch:
86
inputs:
97
version:
@@ -39,28 +37,7 @@ You are a deterministic release-driven recompiler for the **ado-aw** project. Ev
3937

4038
Your goal each run is to land **at most one** focused PR that recompiles `tests/safe-outputs/*.lock.yml` against the **latest released** `ado-aw` binary. If nothing in the directory actually changes after recompilation, emit `noop` and exit.
4139

42-
## Step 0 — Bail out early on irrelevant `workflow_run` triggers
43-
44-
This workflow may be triggered by `workflow_run` after the `Release` workflow completes. The Release workflow runs on every push to `main`; only successful runs that actually published a release have new artifacts.
45-
46-
If invoked via `workflow_run`:
47-
48-
```bash
49-
TRIGGER="${GITHUB_EVENT_NAME:-unknown}"
50-
echo "trigger=$TRIGGER"
51-
if [ "$TRIGGER" = "workflow_run" ]; then
52-
CONCLUSION="$(jq -r '.workflow_run.conclusion // empty' "$GITHUB_EVENT_PATH" 2>/dev/null || echo "")"
53-
HEAD_BRANCH="$(jq -r '.workflow_run.head_branch // empty' "$GITHUB_EVENT_PATH" 2>/dev/null || echo "")"
54-
echo "release_conclusion=$CONCLUSION head_branch=$HEAD_BRANCH"
55-
if [ "$CONCLUSION" != "success" ] || [ "$HEAD_BRANCH" != "main" ]; then
56-
echo "Release run did not succeed on main; nothing to recompile."
57-
# Emit noop and stop. Do not proceed to any further steps.
58-
exit 0
59-
fi
60-
fi
61-
```
62-
63-
If you exit here, emit `noop` with a one-line reason naming `$CONCLUSION` and `$HEAD_BRANCH` so the run is observable, and do not perform any other steps.
40+
> **Note on triggers.** This workflow is invoked by the `release` event when a new ado-aw release is published, or manually via `workflow_dispatch`. Release-please publishes the GitHub Release first; the `build` job inside the `Release` workflow then uploads the platform binaries and `checksums.txt`. By the time the `release` event fires both should be present, but Step 2 below adds a bounded retry so a slightly delayed asset upload does not cause a hard failure.
6441
6542
## Step 1 — Resolve the target ado-aw version
6643

@@ -88,7 +65,7 @@ If the resolved tag is malformed (does not match `v[0-9]+\.[0-9]+\.[0-9]+(-[A-Za
8865

8966
## Step 2 — Download and verify the released `ado-aw-linux-x64` binary
9067

91-
Release-please publishes the GitHub Release first; the `build` job inside the `Release` workflow then uploads the platform binaries and `checksums.txt`. By the time `workflow_run` fires, both should be present, but add a bounded retry so a slightly delayed asset upload does not cause a hard failure.
68+
Release-please publishes the GitHub Release first; the `build` job inside the `Release` workflow then uploads the platform binaries and `checksums.txt`. By the time the `release` event fires both should be present, but add a bounded retry so a slightly delayed asset upload does not cause a hard failure.
9269

9370
```bash
9471
set -euo pipefail
@@ -265,7 +242,6 @@ The `safe-outputs.close-pull-request` configuration on this workflow targets any
265242

266243
## When NOT to open a PR
267244

268-
- `workflow_run` fired for a Release-workflow run that did not succeed on `main` (Step 0).
269245
- The resolved tag is missing or malformed (Step 1) — emit `missing-data`.
270246
- Release assets never appear within the bounded retry window (Step 2) — emit `report-incomplete`.
271247
- `ado-aw --version` does not contain `BARE` (Step 2) — emit `missing-data`.

0 commit comments

Comments
 (0)