Inputs
All inputs are optional. Click on the Input Name for more Details.
| Input | Default Value | Short Description of the Input Value |
|---|---|---|
| prefix | v | Tag Prefix for Semantic Versions |
| major | true | Update Major Tag |
| minor | true | Update Minor Tag |
| release | false | Update Release Tag |
| tags | - | Additional Tags to Update |
| tag | github.ref_name | Manually Set Target Tag |
| create | false | Create Target Tag |
| summary | true | Add Summary to Job |
| dry_run | false | Do not Create Tags, Outout Only |
| token | github.token | For use with a PAT to Rollback |
See the Examples section for more options.
Details
prefix
The prefix is applied to the generated version tags. If you release 1.0.0 or v1.0.0, the parsed major/minor is 1 and 1.0 and then with the prefix added becomes v1 and v1.0.
To disable the prefix, set it to an empty string prefix: ''
The prefix is not applied to the specified input tags.
Default: v
major/minor
Both major and minor versions are parsed from the release tag using semver. If you release version 1.0.0 this will update or create a reference for v1 and v1.0. If you are not using semantic versions, set both to false and provide your own tags.
Default: true
release
If you provide a non-release tag 1.2.3-release.1 this would create the release tag 1.2.3.
Default: false
tags
These are extra tags to set. For example, you could maintain a latest tag that always points to the latest release.
These can be a string list "v1,v1.0" or newline delimited.
👀 View Example tags
Extra Tag.
with:
tags: latestCSV with major/minor disabled.
with:
tags: v1,v1.0,latest
major: false
minor: falseNewline with major/minor disabled.
with:
tags: |
v1
v1.0
latest
major: false
minor: falsetag
This is the target tag to parse the sha from. Defaults to the sha that triggered the workflow. To override this behavior you can specify a target tag here from which the target sha will be parsed. This is the sha that all parsed or provided tags are updated too. To create this tag at the current sha set create to true.
Rolling back requires a PAT. See Rolling Back for more details and a manual workflow example.
Default: ${{ github.ref_name }}
create
If true this will create the tag at the current sha of the workflow run.
Default: false
summary
Write a Summary for the job. To disable this set to false.
👀 View Example Job Summary
| Tag | v1.0.1 |
| Sha | 9b5d1797561610366c63dcd48b0764f4cdd91761 |
| Tags | v1,v1.0 |
Tags
v1
v1.0Results
| Tag | Result |
|---|---|
v1 | Updated |
v1.0 | Updated |
SemVer
{
"options": {},
"loose": false,
"includePrerelease": false,
"raw": "v1.0.1",
"major": 1,
"minor": 0,
"patch": 1,
"prerelease": [],
"build": [],
"version": "1.0.1"
}Inputs
prefix: v
major: true
minor: true
tags: ""
tag: ""
summary: true
dry_run: false
Default: true
dry_run
If this is true no tags will be created/updated and will only output the results.
Default: false
token
GitHub workflow tokens do not allow for rolling back or deleting tags. To do this you must create a PAT with the repo and workflow permissions, add it to secrets, and use it. See Rolling Back for more information and an example.
Default: ${{ github.token }}
Examples
Manually set tags.
- name: 'Update Tags'
uses: cssnr/update-version-tags-action@v2
with:
major: false
minor: false
tags: |
v1
v1.0Specify the target tag.
- name: 'Update Tags'
uses: cssnr/update-version-tags-action@v2
with:
tag: v1.0.1
WARNING
These docs are not finished. Please see the README.md on GitHub.
