[gha][binary sizes] Use the input context to read the toolchain_version #150
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.
This workflow is failing to run when new swift toolchain releases are created because
toolchain_version
is resolved to the branch name ("main") after the initialcontext
job, rather than the newly released swift toolchain version. The bug is in the callee (release-swift-toolchain-binary-sizes.yml) rather than the caller (workflow-run-release-swift-toolchain-binary-sizes.yml), which is correctly looking up and passing the toolchain version along in its workflow invocation.This is happening because the callee reads the
toolchain_version
input usinggithub.event.inputs
which is empty if the caller is triggered by aworkflow_run
event which has no inputs: The caller'sgithub.event.inputs
is always forwarded to the callee forworkflow_run
event triggers.This was not caught during testing because in presubmit we trigger the caller using
pull_request
rather thanworkflow_run
, and we look for a hard-coded test toolchain version since no latest version is available. This change switches the callee to use theinput
context which always has the correct value regardless of whether the triggering event isworkflow_call
(whereby we inheritgithub.event
from the caller) orworkflow_dispatch
(whereby the inputs are passed directly to the workflow by the user).