github-tag-action icon indicating copy to clipboard operation
github-tag-action copied to clipboard

feat: allow the creation of tags without pushing

Open dsayling opened this issue 3 years ago • 0 comments

Changes

  • Add an optional input into the action.yaml to allow users to create a tag without pushing.
    • Default value is true, set to false to not push the tag.
  • Update createTag with a boolean parameter to check if we need to push
    • async createRef moved into conditional check with additional debug log to indicate tag is not pushed.
  • Update action module to extract boolean input
    • Used getBooleanInput as opposed to getInput for better error handling from the actions core lib.
  • Updated existing unittests to verify true is default arg for pushTag param.
  • New unittest for the input set to false explicitly.
  • Update README with section on using the input.

Reasoning

In some cases it might be useful for a user to create a tag based on the current versioning without pushing the tag. For example, in python's setuptools_scm or poetry-dynamic-versioning, a 'dev' or 'prerelease' tag is created by the versioning library based on the current tag. By default, these libraries create a subminor version release and do no commit parsing - only tags - so it's up to the user to bump a minor or major version in the tag.

In a pull_request workflow, before the merge to the default branch, this action could be used to create a local tag so the build process can create a dev version that reflects any api change in the pull request.

dsayling avatar Feb 07 '23 19:02 dsayling