Proposal: Redesign tagging input/outputs to be independent
See original GitHub issueI still use this action for labeling features, but if you’re open to it, I’d really like you to consider importing my actions tag handling capabilities due to their power, simplicity, and flexibility.
To give you an example, here’s a snippet from a repo where I’m using the latest functionality I’ve implemented, snippet pulled from https://github.com/OctoPrint/octoprint-docker/blob/master/.github/workflows/octoprint-release.yml#L69-L87:
-
id: buildxy
run: echo '::set-output name=buildxy::${{ (github.event.action == 'deploy'|| github.event.action == 'released') && github.event.client_payload.tag_name == steps.stable-octoprint.outputs.release }}'
-
name: Tagging Strategy
id: tagging
uses: HackerHappyHour/tagging-strategy@v3
with:
image_name: octoprint/octoprint
tag_name: ${{ github.event.client_payload.tag_name }}
tags: |
%X%::${{ steps.buildxy.outputs.buildxy }}
%X.Y%::${{ steps.buildxy.outputs.buildxy }}
%X.Y.Z%
extra_tags: |
latest::${{ steps.stable-octoprint.outputs.release == github.event.client_payload.tag_name }}
edge::${{ github.event.action == 'prereleased' || github.event.client_payload.tag_name == steps.latest-octoprint.outputs.release }}
canary::${{ github.event.action == 'canary' }}
bleeding::${{ github.event.action == 'bleeding' }}
This one snippet demonstrates the how i think the approach to tagging should work in ghaction-dockermeta:
- explicit control over the conditions of each and every tag,
- semver parsing
- no interdependent input parameters,
- output compatible with docker/build-push-action
- supports tag suffixes #15
- supports additional non-semver custom tags #24 via
extra_tags
- compatible with externally triggered events
- sha tags (via
extra_tags
parameter in a similar way to your{{raw}}
usage
Bonus
As far as I can tell, refactoring tag inputs to work as they do in HackerHappyHour/tagging-strategy@v3+ would close the following open issues as well:
- #29 (since the base tag input isn’t resolved by the action but passed in by the user, the user can pass in whatever they want)
- #27 (simply changing the order in the
tags
orextra_tags
of HackerHappyHour/tagging-strategy accomplishes this) - #25 (you can see in the example above how HackerHappyHour/tagging-strategy already does this)
- #13 (HackerHappyHour/tagging-strategy already supports this, examples here, here and in the testing fixtures)
I doubt my action will ever get any users (even though I obviously have a super high opinion of it 😏 ), but you’ve got the benefit of having been in the docker action space since actions launched, and the have visibility and reach. I’d love for the work I did to benefit your users and carry over here.
Would you be willing to consider a redesign to bring support for this usage technique? I’d really love to be able to archive my project and merge it with yours!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:13 (4 by maintainers)
Top GitHub Comments
@LongLiveCHIEF I have started to work on this yesterday. Here is a draft of what I plan to put in place for a v2:
New:
tags
labels
Kept:
images
sep-tags
sep-labels
Removed:
tag-sha
tag-edge
tag-edge-branch
tag-semver
tag-match
tag-match-group
tag-latest
tag-schedule
tag-custom
tag-custom-only
label-custom
Migration
tag-sha
Defaults:
enable=false
latest=false
prefix=sha-
suffix=
tag-edge
/tag-edge-branch
Defaults:
enable=false
latest=false
branch=${default_branch}
tag-semver
Defaults:
enable=true
latest=true
pattern=
prefix=
suffix=
tag-match
/tag-match-group
Defaults:
enable=false
latest=true
group=
prefix=
suffix=
tag-latest
Will be available for all types through
latest=true|false
keypair.tag-schedule
Defaults:
enable=false
latest=false
pattern=
prefix=
suffix=
tag-custom
/tag-custom-only
Defaults:
enable=false
latest=false
labels
Flavor
We could also add a new
flavors
input to handle suffix/prefix/… for all tags:Prefix and suffix all tags
Prefix and suffix a specific tag
Optional keys
enable
,latest
,prefix
,suffix
inputs are optional.@LongLiveCHIEF Ok I changed things a bit. I have opened a PR #50 still WIP where we can continue to discuss it.