Repository navigation
Description
Problem
In publish-release.yml, the versioned release is built from a moving branch ref:
get-versionresolves the release version/GitCommitIdfromref: main.build-mainbuilds and pushes the product images fromref: mainas well, andbuild-docker-task.ymlre-resolves its own version internally from that ref.github-releasethen tags the release withget-version'sSemVer2and checks out itsGitCommitId.
If a commit lands on main between get-version and build-main (e.g. during the weekly scheduled publish), the pushed image's embedded version and the release tag can come from different commits — the SemVer2 Docker tag would point at image contents built from a newer commit than the GitHub release of the same tag.
This is the same race fixed in the sibling repos (ptr727/PlexCleaner#723, ptr727/ProjectTemplate#107) by pinning the leaf builds to needs.get-version.outputs.GitCommitId instead of the branch name.
Why it isn't a one-line fix here
The PlexCleaner/ProjectTemplate fix (ref: ${{ needs.get-version.outputs.GitCommitId }}) cannot be applied directly to NxWitness, because build-docker-task.yml overloads inputs.ref for two purposes:
- the git ref to check out / version, and
- the image-matrix branch selector —
Make/Matrix.jsonrows are filtered withselect(.Branch == $ref)(see theget-matrixjob).
Passing a commit SHA would match no .Branch rows and build nothing.
Proposed fix
Decouple the two concerns in build-docker-task.yml:
- Add a distinct
branchinput used only for the matrix row filter (.Branch == $branch) and for tag derivation. - Keep
reffor checkout/version, and let callers pin it to an immutable commit. - In
publish-release.yml, callbuild-mainwithbranch: main+ref: ${{ needs.get-version.outputs.GitCommitId }}andneeds: [get-version, build-base].build-developkeepsbranch: develop(its output is the mutabledeveloptag, which doesn't need release-commit pinning; pin it too if a developget-versionis added). - Update the
test-pull-request.ymlsmoke caller (which passessmoke_branch) accordingly.
Context
Surfaced while back-porting the two-phase CI/CD fixes from PlexCleaner; see PR #413 (which applies the safe smoke-gate change and references this issue). Low practical risk (requires a commit landing on main mid-publish), but worth fixing for release reproducibility.
Activity
Pin release Docker build to versioned commit (#414) (#415)
Pin release Docker build to versioned commit (#414) (#416)