Update Version Tags
Update Version Tags on Push or Release for Semantic Versions or Custom Tags.
Zero configuration to maintain both major vN
-> vN.x.x
and minor vN.N
-> vN.N.x
tags.
This is useful if you want to automatically update additional tags, to point to your pushed/released tag. For example, many GitHub Actions maintain a vN
and vN.N
tag that points to the latest release of the vN.x.x
branch.
To get started, create or update your workflow file and review the permissions.
Workflow
Add the step to an existing workflow or create a new one.
- name: "Update Tags"
uses: cssnr/update-version-tags-action@v1
name: "Release"
on:
release:
types: [published]
jobs:
release:
name: "Release"
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: write
steps:
- name: "Update Tags"
uses: cssnr/update-version-tags-action@v1
Hash Copied to Clipboard
Check out the Rolling Tags for more tag options.
Make sure to add the required Permissions.
See the Inputs Documentation for additional options and default values.
Permissions
This action requires the following permissions:
permissions:
contents: write
Permissions documentation for Workflows and Actions.
Rolling Back
To roll back or manually update tags, copy this workflow: tags.yaml
To rollback tags you must use a PAT with the repo
and workflow
permissions. The target sha
will be parsed from the target tag
provided in the UI.
For example, if you releases v1.0.1
but wanted to roll back to v1.0.0
. You would run the workflow with tag v1.0.0
it would update the v1
and v1.0
tags (or what ever tags you manually specify) to point back to the sha of tag v1.0.0
.
View Rollback Workflow
name: "Tags"
on:
workflow_dispatch:
inputs:
tag:
description: "Target Tag"
required: true
jobs:
tags:
name: "Tags"
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: write
steps:
- name: "Update Tags"
uses: cssnr/update-version-tags-action@v1
with:
tag: ${{ inputs.tag }}
token: ${{ secrets.GH_PAT }}
Rolling Tags
The following rolling tags are maintained to improve stability across updates.
Version Tag | Rolling | Bugs | Feat. | Name | Target | Example |
---|---|---|---|---|---|---|
✅ | ✅ | ✅ | Major | vN.x.x | vN | |
✅ | ✅ | ❌ | Minor | vN.N.x | vN.N | |
❌ | ❌ | ❌ | Micro | vN.N.N | vN.N.N |
You can view the release notes for each version on the releases page.
The Major tag is recommended. It is the most up-to-date and always backwards compatible. Breaking changes would result in a Major version bump. At a minimum you should use a Minor tag.
Tags Security Notice
As shown above, tags are mutable; however, commit hashes are not. Therefore, if security is your top priority, you should pin your actions to a specific commit hash.
WARNING
These docs are not finished. Please see the README.md on GitHub.