Skip to content

Automate updating major version tag#45

Merged
manuq merged 1 commit intomainfrom
push-oxovquoopkyv
Jul 8, 2025
Merged

Automate updating major version tag#45
manuq merged 1 commit intomainfrom
push-oxovquoopkyv

Conversation

@wjt
Copy link
Member

@wjt wjt commented Jul 8, 2025

Following the general convention for GitHub actions, whenever we tag (for example) v1.0.9, we also update the v1 tag to match. This allows users of the action to write:

uses: endlessm/amalgamate-pages@v1

and automatically receive minor updates to the action.

So far I have been doing this by hand:

# Tag the new version as normal
git tag -s -m 'Version 1.0.9' v1.0.9

# Now force-update the v1 tag to match
git tag --force -s v1 -m "Update v1 tag" v1.0.9^{}

# And push both
git push origin v1.0.9 +v1

The v1.0.9^{} syntax means that the v1 tag points to the commit that v1.0.9 points at, rather than to the v1.0.9 tag (which in turn points to that commit). Nested tags cause git to warn you as follows when you create them:

hint: You have created a nested tag. The object referred to by your new tag is
hint: already a tag. If you meant to tag the object that it points to, use:
hint:
hint: 	git tag -f test v1.0.9^{}
hint: Disable this message with "git config advice.nestedTag false"

This process is not obvious and is error-prone. It would be more convenient to be able to make the precise version tag as normal (either from the git command line, or from the GitHub Releases web interface) and have the major version tag be updated automatically.

Add a workflow that performs this process.

Fixes #44

Following the general convention for GitHub actions, whenever we tag
(for example) v1.0.9, we also update the v1 tag to match. This allows
users of the action to write:

    uses: endlessm/amalgamate-pages@v1

and automatically receive minor updates to the action.

So far I have been doing this by hand:

    # Tag the new version as normal
    git tag -s -m 'Version 1.0.9' v1.0.9

    # Now force-update the v1 tag to match
    git tag --force -s v1 -m "Update v1 tag" v1.0.9^{}

    # And push both
    git push origin v1.0.9 +v1

The v1.0.9^{} syntax means that the v1 tag points to the commit that
v1.0.9 points at, rather than to the v1.0.9 tag (which in turn points to
that commit). Nested tags cause git to warn you as follows when you
create them:

    hint: You have created a nested tag. The object referred to by your new tag is
    hint: already a tag. If you meant to tag the object that it points to, use:
    hint:
    hint: 	git tag -f test v1.0.9^{}
    hint: Disable this message with "git config advice.nestedTag false"

This process is not obvious and is error-prone. It would be more
convenient to be able to make the precise version tag as normal (either
from the git command line, or from the GitHub Releases web interface)
and have the major version tag be updated automatically.

Add a workflow that performs this process.

Fixes #44
@wjt wjt requested a review from manuq July 8, 2025 11:13
@wjt
Copy link
Member Author

wjt commented Jul 8, 2025

Annoyingly this can't really be tested without performing a minor release. My suggestion is that, if there are no glaringly obvious problems, we merge this, make a minor release (to pick up #43), and see if it works :)

Copy link
Contributor

@manuq manuq left a comment

Choose a reason for hiding this comment

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

This sounds like it could work. So yeah no problem performing a minor release to give it a try.

@manuq manuq merged commit 3c34ebf into main Jul 8, 2025
1 check passed
@manuq manuq deleted the push-oxovquoopkyv branch July 8, 2025 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automate updating v1 tag

2 participants

Comments