Open CAMOBAP opened 2 years ago
@CAMOBAP You have this warning because you're using type=semver
: https://github.com/metanorma/metanorma-docker/blob/abc2919a7793838262a48697931b4e267c3a56f0/.github/workflows/build-push.yml#L78-L84
tags: |
type=edge,branch=main
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
If your tag doesn't support semver and you just want the tag, then just replace type=semver
with:
tags: |
type=edge,branch=main
type=ref,event=branch
type=ref,event=pr
type=ref,event=tag
@crazy-max thanks for the suggestion. The problem is solved actually, my point is that this warning is silent, you can find it only if other steps fail. Isn't it better if the step will fail instead of the warning message?
Isn't it better if the step will fail instead of the warning message?
Yes maybe we could add a strict mode to the action for semver and maybe also for invalid chars in image name and tags. Not sure if it should be global or per entries:
tags: |
type=edge,branch=main
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}},strict=true
type=semver,pattern={{major}}.{{minor}},strict=true
type=semver,pattern={{major}},strict=true
Or through flavor
?:
flavor: |
strict=semver,image,tag
Need to think about it. Open to suggestions.
If you ask me (as a user) it will be nice to just extra input strict
which handles all such situations (wrong/bad input). Some advance use cases like via flavor
also can be useful, but for me strict: true
will be enough
Behaviour
Steps to reproduce this issue
Warning: v1.5.15pre1 is not a valid semver. More info: https://semver.org/
Expected behavior
It will be nice to add some
strict
input to treat all warnings as errors. And if the version is invalid thedocker/metadata-action
step will failsActual behaviour
I suppose current behavior is right
This ticket just to understand if this feature is useful for someone else