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_tagsparameter 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
tagsorextra_tagsof 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 Related StackOverflow Question
@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:
tagslabelsKept:
imagessep-tagssep-labelsRemoved:
tag-shatag-edgetag-edge-branchtag-semvertag-matchtag-match-grouptag-latesttag-scheduletag-customtag-custom-onlylabel-customMigration
tag-shaDefaults:
enable=falselatest=falseprefix=sha-suffix=tag-edge/tag-edge-branchDefaults:
enable=falselatest=falsebranch=${default_branch}tag-semverDefaults:
enable=truelatest=truepattern=prefix=suffix=tag-match/tag-match-groupDefaults:
enable=falselatest=truegroup=prefix=suffix=tag-latestWill be available for all types through
latest=true|falsekeypair.tag-scheduleDefaults:
enable=falselatest=falsepattern=prefix=suffix=tag-custom/tag-custom-onlyDefaults:
enable=falselatest=falselabelsFlavor
We could also add a new
flavorsinput to handle suffix/prefix/… for all tags:Prefix and suffix all tags
Prefix and suffix a specific tag
Optional keys
enable,latest,prefix,suffixinputs are optional.@LongLiveCHIEF Ok I changed things a bit. I have opened a PR #50 still WIP where we can continue to discuss it.