Open
Description
Behaviour
My context is kind of mono repository that each project has itself life-cycle.
Currently, I separate GitHub release tag as: project/semver
Steps to reproduce this issue
- Input
# Ref context
refs/tags/project1/v1.0.0
# GH docker meta
tags: type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=sha
type=match,pattern=project1\/v(.*),group=1
- Output
project1-v1.0.0
It should be 1.0.0
???
Expected behaviour
I'm wondering how to make tag chaining from match
to semver
. I have not yet understand prefix/suffix/value for what purpose.
In my case: I expect tag output is
1.0.0
1.0
latest
Another thing, typo in https://github.com/crazy-max/ghaction-docker-meta#typematch
tags: |
type=group,enable=true,priority=800,prefix=,suffix=,pattern=,group=0,value=
Should be type=match
?
Activity
crazy-max commentedon Apr 1, 2021
@zero88
That's because your pattern is incorrect I guess. What is the value of
GITHUB_REF
in your pipeline? I would need the link to your repo to know why. I think I will add more logs in this action to enhance the bug reports.Also you got
project1-v1.0.0
because it matchestype=ref,event=tag
. But again I would need a link to your repo to be sure.Same as before I would need the link to your repo/workflow to understand what you want and the current behavior.
Yes good catch! Feel free to open a PR to fix the README thanks :)
zero88 commentedon Apr 2, 2021
My current project is private repo, but I can reproduce in my test project.
I updated
github_ref
in description also:I don't think my pattern is wrong. I guess your implementation normalizes tag with
/
then regex matching. I tried both escape\/
and non escape/
, still doesn't workIf I understand your description correctly:
type=ref
priority = 600 <type=match
priority = 800,gh-action
handles greater priority first, then it makes a chaining processmatch
->ref
refs/tags/project1/v1.0.0
->1.0.0
, I need provideghaction input
as:Then I should receive:
1.0.0
,1.0
,latest
Fix README (#56)
crazy-max commentedon Apr 3, 2021
@zero88 I have improved the logging. Can you give me the output of the meta step please?
Monorepo docker/metadata-action#56
Monorepo docker/metadata-action#56
Monorepo docker/metadata-action#56
zero88 commentedon Apr 5, 2021
@crazy-max
Please check this one: https://github.com/zero88/gh-test/runs/2267140740?check_suite_focus=true
Compare step
project_context
(from mine) anddocker_context
(yours)It is release workflow.
Other runs seem fine from
main
topr
: https://github.com/zero88/gh-test/actions/workflows/p1.ymlcrazy-max commentedon Apr 5, 2021
@zero88 I think the following should work:
or
zero88 commentedon Apr 6, 2021
@crazy-max Thank you for your response.
After your suggestion, it works.
But, 2 points that make me confusing:
Regex pattern
/
will be escaped to-
in prepare step then you do regex matching? So iffeature/a/b-c
thenfeature-a-b-c
? So it doesn't clear to identify which one is/
or-
semver
(without pre-release/metadata), it should be\d+\.\d+\.\d+
in strict mode. Then12.1.0
is valid but1a3.4
is invalidPriority
property: it seems not correct usage, or not yet join a processing party as my expectation in above comment.I want to release sub project with tag as
<sub_project_name>/<sem_ver>
So, my solution is
match
is first pattern with highest priority then its output will be input of other follow patterns. Do you consider to include this trick in future? I can contribute if you want, but not today, might be next month :)Click to expand!
crazy-max commentedon Apr 8, 2021
@zero88
Yes that's it, I think we should check matches before escaping.
priority
only allows to manage tags sorting.We can think about that. Maybe smth like that:
15 remaining items