How to Version a Custom Action With Tags and a Major Branch
Publish an exact tag per release and a moving major tag (v1) so consumers pin to a stable major line.
Cut a precise tag such as v1.2.0 for each release, then move a major tag v1 to that commit. Consumers reference @v1 and get compatible updates automatically.
Steps
- Tag the release commit with a full semver tag (
v1.2.0). - Force-update the major tag
v1to the same commit. - Push both tags; consumers reference
owner/action@v1.
Moving the major tag
Terminal
git tag v1.2.0
git tag -f v1 v1.2.0
git push origin v1.2.0
git push origin -f v1How consumers pin
.github/workflows/ci.yml
steps:
- uses: my-org/my-action@v1 # tracks the v1 major line
- uses: my-org/my-action@v1.2.0 # pinned to an exact releaseGotchas
- Never move a full semver tag; only the major (
v1) tag moves. - Security-sensitive consumers pin by full SHA instead of any tag.
Related guides
How to Publish a Custom Action to the GitHub MarketplacePublish a custom action to the GitHub Marketplace by adding a name, description, and branding to action.yml,…
How to Use a Local Action With uses Dot SlashReference an action stored in your own repository with uses and a relative path starting with dot slash, afte…
How to Add Pre and Post Steps to a Custom ActionRun setup before and cleanup after a JavaScript action with the pre and post keys in action.yml, which run en…