fix(ci): refresh-amis must dispatch the publisher, not rely on its push - #173
Merged
Conversation
Commits pushed with GITHUB_TOKEN do not trigger workflows, so the AMI-map push never fired publish-template.yml — which watches pushes touching aws/template.yaml. The refreshed map landed on master and never reached the S3 template the 1-click Launch buttons serve. Not theoretical: 5542d8f (2026-07-06) is the only AMI bump that has ever landed, and there is no publish-template run for it — 60 runs going back to 2026-07-04, 55 push-triggered and 5 manual, none with that SHA. aws-ci.yml never validated it either. Every 1-click launch since has used a template whose AMI map was published by an unrelated merge rather than by the job that changed it. Add an explicit `gh workflow run publish-template.yml` after a successful push, gated on a step output so a no-change run stays a no-op. Needs `actions: write`. The alternative is pushing under a PAT or GitHub App so the push itself triggers downstream workflows, which would additionally give the AMI bump a review gate. Rejected for now: it re-enables workflow cascades for every job sharing that identity, and this job's output is a generated map. Worth revisiting if the bump ever needs review. publish-template.yml runs `cfn-lint aws/template.yaml` before uploading, so the dispatched run validates the map it is about to publish. No AWS cost, IAM, or networking impact. Checks run: file validated as parsing, with permissions, the new step id, and the `if:` gate confirmed to resolve. The loop itself cannot be verified until this is on master and an AMI bump lands — `workflow_dispatch` on refresh-amis is the way to force it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PsqGhkpjsb4kKAdVz25xKN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commits pushed with
GITHUB_TOKENdo not trigger workflows, sorefresh-amis.yml's push never firedpublish-template.yml— which watches pushes touchingaws/template.yaml. The refreshed AMI map landed on master and never reached the S3 template the 1-click Launch buttons serve.This has already happened.
5542d8f(2026-07-06) is the only AMI bump that has ever landed, and there is nopublish-templaterun for it: 60 runs going back to 2026-07-04, 55 push-triggered and 5workflow_dispatch, none carrying that SHA.aws-ci.ymlnever validated it either. Every 1-click launch since has been served a template whose AMI map was published by an unrelated merge rather than by the job that changed it.The four subsequent refreshes (13/20/27 Jul, 3 Aug) each finished in ~10s with "No AMI changes", so nothing has re-triggered the publisher in the meantime.
The fix
Dispatch the publisher explicitly after a successful push, gated on a step output so a no-change run stays a no-op. Requires
actions: write.Why not a PAT / GitHub App
Pushing under a PAT or App would make the push itself trigger downstream workflows, and would additionally give the AMI bump a review gate — which is attractive, since
aws/template.yamldefines the public launch path and is currently the one file that reaches production without review.Rejected for now: it re-enables workflow cascades for every job sharing that identity, and this job's output is a generated map with no judgement in it. It is also the reason the bot-actor guard in #172's
agent-pr.ymlmatters — the moment an elevated identity exists in this repo, that guard stops being redundant. Keeping the two concerns separate is deliberate: this PR changes no identity, so #172 can merge independently in either order.Worth revisiting if the AMI bump ever needs review.
Checks run
permissions, the new stepid, and theif:gate confirmed to resolve as intended.publish-template.ymlalready hasworkflow_dispatch:, so it is dispatchable; it also runscfn-lint aws/template.yamlbefore uploading, so the dispatched run validates the map it is about to publish.workflow_dispatchon Refresh NixOS AMIs once a new AMI is available, then confirm apublish-templaterun appears for the resulting commit.No AWS cost, IAM, or networking impact.
🤖 Generated with Claude Code
https://claude.ai/code/session_01PsqGhkpjsb4kKAdVz25xKN