Skip to content

Commit bb7d239

Browse files
committed
ci(publish-tool-images): check the pinned version with an if rather than && and ||
1 parent 157898e commit bb7d239

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎.github/workflows/publish-tool-images.yml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ jobs:
5151
run: |
5252
set -euo pipefail
5353
version="$(sed -n 's/^ARG [A-Z_]*_VERSION=//p' "tool-images/${NAME}/Dockerfile")"
54-
[ "$(wc -l <<<"$version")" = 1 ] && [ -n "$version" ] || { echo "tool-images/${NAME}/Dockerfile must pin exactly one ARG <TOOL>_VERSION" >&2; exit 1; }
54+
if [ -z "$version" ] || [ "$(wc -l <<<"$version")" != 1 ]; then
55+
echo "tool-images/${NAME}/Dockerfile must pin exactly one ARG <TOOL>_VERSION" >&2
56+
exit 1
57+
fi
5558
echo "repository=ghcr.io/${OWNER,,}/github-runner-${KIND}-${NAME}" >>"$GITHUB_OUTPUT"
5659
echo "version=${version}" >>"$GITHUB_OUTPUT"
5760

0 commit comments

Comments
 (0)