Skip to content

Commit fa976b2

Browse files
committed
chore(ci): automatically determine release image tag
1 parent ecb17a5 commit fa976b2

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

.execs/release.flow

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,27 @@ executables:
108108
args:
109109
- envKey: IMAGE_TAG
110110
flag: tag
111-
required: true
111+
required: false
112112
- envKey: REGISTRY
113113
default: ghcr.io
114114
flag: registry
115115
cmd: |
116116
set -euo pipefail
117117

118+
# Determine IMAGE_TAG if not provided
119+
if [ -z "${IMAGE_TAG:-}" ]; then
120+
if [ -n "${VERSION:-}" ]; then
121+
IMAGE_TAG="${VERSION}"
122+
elif [[ "${GITHUB_REF:-}" == refs/tags/* ]]; then
123+
IMAGE_TAG="${GITHUB_REF#refs/tags/}"
124+
elif [ -n "${GITHUB_SHA:-}" ]; then
125+
IMAGE_TAG="${GITHUB_SHA:0:12}"
126+
else
127+
echo "ERROR: Unable to determine IMAGE_TAG automatically."
128+
exit 1
129+
fi
130+
fi
131+
118132
echo "Publishing multi-arch Docker images to ${REGISTRY}..."
119133
echo " Tag: ${IMAGE_TAG}"
120134
echo ""

0 commit comments

Comments
 (0)