Update Version Tags Action
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@v2name: "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@v2Hash 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: writePermissions 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@v2
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.
Updating Actions
If you prefer to manually update actions, then azat-io/actions-up was created to allow you to easily and securely do this using an interactive CLI with optional excludes.
I also created cssnr/actions-up-action that will run this for you automatically and generate a markdown table for pull requests.
View Example Markdown Table
Scanned 8 workflows, checked 12 actions and found 6 updates.Results
| Name | File | Breaking | Latest |
|---|---|---|---|
| cssnr/check-build-action | check-build.yaml | - | v1.1.0 |
| cssnr/label-creator-action | labeler.yaml | - | v1.0.2 |
| cssnr/mirror-repository-action | mirror.yaml | - | v1.2.0 |
| cssnr/update-version-tags-action | release.yaml | - | v1.3.1 |
| cssnr/package-changelog-action | release.yaml | ⚠️ | v2.0.0 |
| cssnr/update-version-tags-action | tags.yaml | - | v1.3.1 |
WARNING
These docs are not finished. Please see the README.md on GitHub.
