Skip to content

Commit b7ae0b6

Browse files
committed
fix: normalise bare SHA BUILDER_REF before refs/tags/ prefix check
Signed-off-by: Kazutomo Deguchi <131741597+shinagawa-web@users.noreply.github.com>
1 parent 4d014fa commit b7ae0b6

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

.github/actions/generate-builder/builder-fetch.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ set -euo pipefail
2828
PREFIX="refs/tags/"
2929

3030
# Extract version.
31+
# detect-workflow-js emits a bare 40-char SHA when the caller pins the
32+
# reusable workflow with @<sha>. Normalise that to the refs/tags/ form
33+
# so the SHA-resolution path below can resolve it to a release tag.
34+
if [[ "$BUILDER_REF" =~ ^[a-f0-9]{40}$ ]]; then
35+
BUILDER_REF="${PREFIX}${BUILDER_REF}"
36+
fi
37+
3138
if [[ "$BUILDER_REF" != "$PREFIX"* ]]; then
3239
echo "Invalid ref: $BUILDER_REF. Expected ref of the form refs/tags/vX.Y.Z"
3340
exit 2

0 commit comments

Comments
 (0)