|
1 | 1 | --- |
2 | 2 | on: |
3 | | - workflow_run: |
4 | | - workflows: ["Release"] |
5 | | - types: [completed] |
6 | | - branches: [main] |
| 3 | + release: |
| 4 | + types: [published] |
7 | 5 | workflow_dispatch: |
8 | 6 | inputs: |
9 | 7 | version: |
@@ -39,28 +37,7 @@ You are a deterministic release-driven recompiler for the **ado-aw** project. Ev |
39 | 37 |
|
40 | 38 | 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. |
41 | 39 |
|
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. |
64 | 41 |
|
65 | 42 | ## Step 1 — Resolve the target ado-aw version |
66 | 43 |
|
@@ -88,7 +65,7 @@ If the resolved tag is malformed (does not match `v[0-9]+\.[0-9]+\.[0-9]+(-[A-Za |
88 | 65 |
|
89 | 66 | ## Step 2 — Download and verify the released `ado-aw-linux-x64` binary |
90 | 67 |
|
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. |
92 | 69 |
|
93 | 70 | ```bash |
94 | 71 | set -euo pipefail |
@@ -265,7 +242,6 @@ The `safe-outputs.close-pull-request` configuration on this workflow targets any |
265 | 242 |
|
266 | 243 | ## When NOT to open a PR |
267 | 244 |
|
268 | | -- `workflow_run` fired for a Release-workflow run that did not succeed on `main` (Step 0). |
269 | 245 | - The resolved tag is missing or malformed (Step 1) — emit `missing-data`. |
270 | 246 | - Release assets never appear within the bounded retry window (Step 2) — emit `report-incomplete`. |
271 | 247 | - `ado-aw --version` does not contain `BARE` (Step 2) — emit `missing-data`. |
|
0 commit comments