Skip to content

Commit

Permalink
github: fix "Generate next docker tag" log output
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
stefano-garzarella authored and alxiord committed Jul 25, 2024
1 parent e3e63b1 commit 2dc3b8c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2dc3b8c

Please sign in to comment.