Fix rc-smoke.yml resolving the wrong branch on automatic trigger - #465
Merged
Merged
Conversation
workflow_run events only expose head_sha/head_branch for the ref rc-release.yml was dispatched WITH (e.g. development), never the releases/** branch its own prepare-branch job creates during the run. Trusting those fields meant every automatic smoke run checked out development (still at the last real release's version), saw a non-RC pubspec version, and silently skipped — since rc-smoke.yml was added in #446 (Apr 26, 2026), the automatic path has never actually smoke-tested a real RC. Fix: resolve the actual RC from the GitHub prerelease that create-prerelease just published (tag_name + created_at, sanity checked against the triggering run's completion time within 30 min), derive the release branch from that tag using the same naming convention rc-release.yml computes, and check that branch out instead. Manual workflow_dispatch path (rc_version/release_branch inputs) is unaffected — it already worked correctly, as verified by manually running it for 6.18.1-rc1/rc2. No new secrets needed — reading releases via the API only requires the default GITHUB_TOKEN's existing read access. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Dani-Koza-AF
approved these changes
Jul 26, 2026
Dani-Koza-AF
left a comment
Collaborator
There was a problem hiding this comment.
looks like a legit fix
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.
Summary
rc-smoke.yml's automatic (workflow_run) trigger has never actually smoke-tested a real RC since it was added in #446 (2026-04-26). Root cause:workflow_runevents only exposehead_sha/head_branchfor the refrc-release.ymlwas dispatched with (e.g.development), never thereleases/**branch its ownprepare-branchjob creates during the run. So every automatic smoke run checked outdevelopment, saw its stale (last real release's)pubspec.yamlversion, concluded "not an RC," and silently skipped — withconclusion: success, so nothing ever flagged it as broken.Confirmed directly against the
6.18.1-rc1/rc2RCs cut in this session: both automatic smoke runs skipped withpubspec version is not an RC (6.18.0); skipping.The manualworkflow_dispatchpath (with explicitrc_version/release_branchinputs) was unaffected and worked correctly both times.Fix
Instead of trusting
workflow_run.head_sha/head_branch, resolve the actual RC from the GitHub prerelease thatcreate-prereleasejust published:GET /repos/{owner}/{repo}/releases, filter toprerelease: true, take the most recently created one.created_atis within 30 minutes of the triggering run's completion (workflow_run.updated_at) — guards against picking up a stale/unrelated tag.releases/${MAJOR}.x.x/${MAJOR_MINOR}.x/${VERSION}conventionrc-release.ymlalready computes.pubspec.yamlon it actually matches the resolved version.No new secrets required — this only reads public release metadata via the default
GITHUB_TOKEN.Test plan
ruby -ryaml -e "YAML.load_file(...)"— valid YAML.rc-smoke/pub.devactually running (not silently skipping) on its automatic trigger.🤖 Generated with Claude Code