Behaviour
From this README.md, steps.meta.outputs.tags is typed as a String.
However, when trying to use the Docker image built in a following step,
when a new image as been built,
steps.meta.outputs.tags value seems to be <image>:<tag>\n<image>:latest
This \n character causes calls to docker run ... ${{ steps.meta.outputs.tags }} to fail,
as the CI shell interprets the string following the newline as a command that does not exist.
Steps to reproduce this issue
- Clone https://github.com/voyages-sncf-technologies/vboard
- Create a new tag
- Observe the Actions pipeline result
Expected behaviour
I tried to use ${{ steps.meta.outputs.tags[0] }} instead,
but this gets inetrpreted as an empty string (on non-tag builds at least).
Actual behaviour
Neither ${{ steps.meta.outputs.tags }} nor ${{ steps.meta.outputs.tags[0] }}
can actually be used in a docker command following usage of docker/metadata-action@v3 & docker/build-push-action@v2
Configuration
docker-build-push-ws:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker/metadata-action@v3
id: meta
with:
images: vboard/vboard-ws
- uses: docker/login-action@v1
if: startsWith(github.ref, 'refs/tags/')
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: docker/build-push-action@v2
with:
context: vboard-ws
push: ${{ startsWith(github.ref, 'refs/tags/') }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Validating the image built can start without any error
run: docker run -e SPRING_PROFILES_ACTIVE=test -e EXIT_AFTER_INIT=true ${{ steps.meta.outputs.tags }}
Logs
vboard-build-3883855145.log
Behaviour
From this
README.md,steps.meta.outputs.tagsis typed as a String.However, when trying to use the Docker image built in a following step,
when a new image as been built,
steps.meta.outputs.tagsvalue seems to be<image>:<tag>\n<image>:latestThis
\ncharacter causes calls todocker run ... ${{ steps.meta.outputs.tags }}to fail,as the CI shell interprets the string following the newline as a command that does not exist.
Steps to reproduce this issue
Expected behaviour
I tried to use
${{ steps.meta.outputs.tags[0] }}instead,but this gets inetrpreted as an empty string (on non-tag builds at least).
Actual behaviour
Neither
${{ steps.meta.outputs.tags }}nor${{ steps.meta.outputs.tags[0] }}can actually be used in a
dockercommand following usage ofdocker/metadata-action@v3&docker/build-push-action@v2Configuration
Logs
vboard-build-3883855145.log