Skip to content

Commit e1213ae

Browse files
fix(build-nix-image): only modify numerical tags
Signed-off-by: Cameron Smith <cameron.ray.smith@gmail.com>
1 parent 68d3753 commit e1213ae

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

.github/actions/build-nix-image/action.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,20 +63,20 @@ runs:
6363
if [ "${{ inputs.triggerEventName }}" == "pull_request" ]; then
6464
echo "GIT_SHA=$CI_GITHUB_EVENT_PULL_REQUEST_HEAD_SHA" >> $GITHUB_ENV
6565
echo "GIT_SHA_SHORT=$CI_GITHUB_EVENT_PULL_REQUEST_HEAD_SHA_SHORT" >> $GITHUB_ENV
66-
# elif [ -n "${{ inputs.releaseVersion }}" ]; then
67-
# tag_base="${{ inputs.releaseVersion }}"
68-
69-
# if [[ $tag_base =~ ^[0-9] ]]; then
70-
# tag="v$tag_base"
71-
# else
72-
# tag="$tag_base"
73-
# fi
66+
elif [ -n "${{ inputs.releaseVersion }}" ]; then
67+
tag_base="${{ inputs.releaseVersion }}"
68+
echo "tag_base=$tag_base"
69+
if [[ $tag_base =~ ^[0-9] ]]; then
70+
tag="v$tag_base"
71+
else
72+
tag="$tag_base"
73+
fi
7474
75-
# sha=$(git rev-parse "$tag")
76-
# short_sha=$(git rev-parse --short "$tag")
75+
sha=$(git rev-parse "$tag")
76+
short_sha=$(git rev-parse --short "$tag")
7777
78-
# echo "GIT_SHA=$sha" >> $GITHUB_ENV
79-
# echo "GIT_SHA_SHORT=$short_sha" >> $GITHUB_ENV
78+
echo "GIT_SHA=$sha" >> $GITHUB_ENV
79+
echo "GIT_SHA_SHORT=$short_sha" >> $GITHUB_ENV
8080
else
8181
echo "GIT_SHA=$CI_GITHUB_SHA" >> $GITHUB_ENV
8282
echo "GIT_SHA_SHORT=$CI_GITHUB_SHA_SHORT" >> $GITHUB_ENV

0 commit comments

Comments
 (0)