Skip to content
This repository was archived by the owner on Mar 24, 2026. It is now read-only.

feat: enable shorthand vX tags inherited from latest version - #6

Open
HassanBahati wants to merge 2 commits into
invertase:mainfrom
HassanBahati:enable-major-release-tags
Open

feat: enable shorthand vX tags inherited from latest version#6
HassanBahati wants to merge 2 commits into
invertase:mainfrom
HassanBahati:enable-major-release-tags

Conversation

@HassanBahati

@HassanBahati HassanBahati commented Nov 17, 2024

Copy link
Copy Markdown
Contributor

Currently to use the action you need to define the full version version eg v1.0.0 resulting into invertase/firebase-emulator-action@v1.0.0.

This PR enables usage of vX where X is any major release tag. Resulting into, for example; invertase/firebase-emulator-action@v1

I have tested out this approach via custom-short-hand-tag.yaml for HassanBahati/demo-script-action@v1
image

@HassanBahati HassanBahati changed the title feat: enable shorthand vX tags inherited from major latest version feat: enable shorthand vX tags inherited from latest version Nov 17, 2024

@mikehardy mikehardy left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that should do it

run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git tag -fa ${{ steps.get_version.outputs.major_version }} -m "Update major version tag to ${{ steps.get_version.outputs.full_version }}"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've never made an annotated tag (-a) but -f looks like the way to push that semver major tag up along the releases to the current code, so +1


       -a, --annotate
           Make an unsigned, annotated tag object

       -s, --sign
           Make a GPG-signed tag, using the default e-mail address’s key. The
           default behavior of tag GPG-signing is controlled by tag.gpgSign
           configuration variable if it exists, or disabled otherwise. See
           git-config(1).

       --no-sign
           Override tag.gpgSign configuration variable that is set to force
           each and every tag to be signed.

       -u <key-id>, --local-user=<key-id>
           Make a GPG-signed tag, using the given key.

       -f, --force
           Replace an existing tag with the given name (instead of failing)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

basically I used the -a flag to be able to add an annotated tag object to hold metadata, for this case the message. But doesn't really add more value beyond that.

@mikehardy would recommend getting rid of the annotation and have it as simple as;
git tag -f ${{ steps.get_version.outputs.major_version }}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants