From 2dc3b8c29282a898bb2018045ad665cb8eb9f9e6 Mon Sep 17 00:00:00 2001 From: Stefano Garzarella Date: Wed, 24 Jul 2024 10:04:51 +0200 Subject: [PATCH] github: fix "Generate next docker tag" log output The current output of the "Generate next docker tag" step is: Run echo "VERSION=$(./docker.sh print-next-version)" >> $GITHUB_ENV Next version to be published is: The next version is not printed, because `$GITHUB_ENV` is loaded at the next step. So at this point we cannot access variables that we are setting in this step. Use a temporary NEXT_VERSION variable where we save the next version to print it correctly. Signed-off-by: Stefano Garzarella --- .github/workflows/docker-publish.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 3c4089f..b978031 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -49,8 +49,9 @@ jobs: # NOTE: The tag contains the full docker container name + tag as it is requested # by the build-and-push step. run: | - echo "VERSION=$(./docker.sh print-next-version)" >> $GITHUB_ENV - echo "Next version to be published is: ${{ env.VERSION }}" + NEXT_VERSION=$(./docker.sh print-next-version) + echo "VERSION=${NEXT_VERSION}" >> $GITHUB_ENV + echo "Next version to be published is: ${NEXT_VERSION}" # Build and push Docker image with Buildx (don't push on PR) # https://github.com/docker/build-push-action