You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Drop ref: github.ref From the Get-Version Caller Example #2297
The get-version-task.yml caller example in docs/reusable-workflows.md "Adopting the Pure Functions" passes with: ref: ${{ github.ref }}. With an explicit ref, the task's actions/checkout fetches that branch and checks out its tip at fetch time. With an empty ref, checkout uses github.sha (actions/checkout src/input-helper.ts: the commit is set to github.context.sha only when ref is empty).
A caller following the example therefore computes the version on whatever the branch tip is when the job runs, not on the commit that triggered the run. In a publisher, a merge landing between dispatch and the get-version job yields:
a version (X.Y.Z-g<newsha>, or a stable height) describing the new tip,
stamped into an artifact built from github.sha,
tagged at target_commitish: github.sha.
The tag's embedded SHA and height then describe a different commit than the one it points at. A gh run rerun also recomputes a different version from the same GITHUB_SHA.
Evidence
The task's own input comment says empty "falls back to the caller's default checkout ref", which is the safe default. ptr727/homeassistant-purpleair#372 adopted the task with no with: block for this reason, after a local review traced the race.
Suggested fix
Drop with: ref: ${{ github.ref }} from the example, or pass ref: ${{ github.sha }}. Note that a caller should pass ref only to version a different ref deliberately, such as a scheduled run versioning develop.
Activity
Drop the Branch Ref From the Version Example and Document the File-Ta…