Skip to content

Commit 68f564e

Browse files
committed
Fix create-image-labels action
1 parent e27f3af commit 68f564e

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

.github/actions/build-and-tag-locally/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ runs:
302302
${{ inputs.custom_build != '' && 'CUSTOM_BUILD=true' || '' }}
303303
${{ inputs.custom_build != '' && format('REDIS_DOWNLOAD_URL={0}', env.REDIS_DOWNLOAD_URL) || '' }}
304304
labels: |
305-
${{ steps.get-image-labels.outputs.image_labels }}
305+
${{ steps.get-image-labels.outputs.image-labels }}
306306
org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }}
307307
org.opencontainers.image.revision=${{ github.sha }}
308308

.github/actions/create-image-labels/action.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,17 @@ runs:
4141
local module="$1"
4242
grep MODULE_VERSION modules/$module/Makefile | cut -d '=' -f2 | tr -d ' '
4343
}
44-
echo REDIS_REVISION=$(git rev-parse HEAD) >> "$GITHUB_OUTPUT"
45-
if [ -n "${{ inputs.redisearch_version }}" ]; then
44+
cd redis
45+
if [ -z "${{ inputs.redisearch_version }}" ]; then
4646
echo redisearch_version=$(get_module_version redisearch) >> $GITHUB_ENV
4747
fi
48-
if [ -n "${{ inputs.redisjson_version }}" ]; then
48+
if [ -z "${{ inputs.redisjson_version }}" ]; then
4949
echo redisjson_version=$(get_module_version redisjson) >> $GITHUB_ENV
5050
fi
51-
if [ -n "${{ inputs.redisbloom_version }}" ]; then
51+
if [ -z "${{ inputs.redisbloom_version }}" ]; then
5252
echo redisbloom_version=$(get_module_version redisbloom) >> $GITHUB_ENV
5353
fi
54-
if [ -n "${{ inputs.redistimeseries_version }}" ]; then
54+
if [ -z "${{ inputs.redistimeseries_version }}" ]; then
5555
echo redistimeseries_version=$(get_module_version redistimeseries) >> $GITHUB_ENV
5656
fi
5757
@@ -91,8 +91,8 @@ runs:
9191
created_timestamp=$(date -u --rfc-3339=seconds)
9292
labels+="org.opencontainers.image.created=$created_timestamp"$'\n'
9393
# Modules revisions labels
94-
modules_repos = (redis redisearch redisjson redistimeseries redisbloom)
95-
for module in modules_repos; do
94+
modules_repos=(redisearch redisjson redistimeseries redisbloom)
95+
for module in "${modules_repos[@]}"; do
9696
revision=$(git -C $module rev-parse HEAD)
9797
labels+="io.redis.$module.revision=$revision"$'\n'
9898
done
@@ -103,11 +103,12 @@ runs:
103103
labels+="io.redis.revision=$redis_revision"$'\n'
104104
VER=$(sed -n 's/^.* REDIS_VERSION "\(.*\)"$/\1/g p' < src/version.h)
105105
if [ "$VER" = "255.255.255" ]; then
106-
GITSHA=$(sed -n 's/^.* REDIS_GIT_SHA1 "\(.*\)"$/\1/g p' < src/release.h)
107-
VER="unstable-$GITSHA"
106+
labels+="io.redis.version=unstable"$'\n'
107+
else
108+
labels+="io.redis.version=$VER"$'\n'
108109
fi
109-
labels+="io.redis.version=$VER"$'\n'
110-
labels+="io.redis.source=https://github.com/redis/redis"$'\n
110+
labels+="io.redis.source=https://github.com/redis/redis"$'\n'
111+
echo "labels: $labels"
111112
echo "image_labels<<EOF" >> $GITHUB_OUTPUT
112113
echo "$labels" >> $GITHUB_OUTPUT
113114
echo "EOF" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)