-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flavor is ignored in output, despite being parsed properly #270
Comments
Yes indeed. I think we could allow a global prefix being set if value is empty, like: - id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
latest=auto
prefix=${{ matrix.package }}-,onlatest=true
suffix=
tags: |
type=ref,event=pr,prefix=
type=sha,prefix= WDYT? As a workaround you can set the same prefix for - id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
latest=auto
prefix=${{ matrix.package }}-,onlatest=true
suffix=
tags: |
type=ref,event=pr,prefix=${{ matrix.package }}-
type=sha,prefix=${{ matrix.package }}- |
oh i see; yes, it was unexpected that i think your workaround is probably a better solution than requiring the empty prefix, at least as it stands today. i think what i'd prefer is for the prefix to only be user-provided, and as this is my first use of this action though, i'm probably not best qualified to decide what's expected or unexpected, just my opinion. your workaround has helped me understand the problem and solved my issue; I super appreciate it. i'll leave this ticket open in case it's something you want to address, or feel free to close if not. |
@fardog I think I will do another implementation using a - id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
latest=auto
prefix=${{ matrix.package }}-,onlatest=true,mode=replace
suffix=
tags: |
type=ref,event=pr
type=sha
WDYT? |
@crazy-max this seems like a very reasonable way to let someone pick the behavior that they want; looks good to me! |
I was expecting the flavor prefix to show up before the tag prefix:
Would yield something like: for a pr: ubuntu-focal-arm64-pr-6 |
Facing the same issue for suffix |
fwiw, I was similarly expecting that I could clear or change the "sha-" prefix in my tags like |
Behaviour
Even though I've specified a
flavor
which contains a prefix, and it is parsed properly, it doesn't result in a prefix on the docker tags which are produced. This prefix is being used in amatrix
to allow two different packages to be built into images. Apologies if I'm missing something obvious (it feels like I must be?).I'm using the following flavor:
I've tried this with a few different combinations, including both with tags specified and without, as well as messing with the
onlatest
, but none of this appears to change the behavior.Thanks tons!
Steps to reproduce this issue
flavors
defined, which specifies a prefixExpected behaviour
Docker tags should be generated with a prefix; in the case of the above, it should be
ghcr.io/fardog/primebot:twitter-pr-12
.Actual behaviour
Docker tags ignore the prefix; e.g.
ghcr.io/fardog/primebot:pr-12
Configuration
The repository URL contains a few different attempts within that PR, none of the configs I attempted were successful however.
Logs
logs_32.zip
Attached; also here is a screenshot of relevant output.
The text was updated successfully, but these errors were encountered: