Skip to content

cssnr/update-version-tags-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Tags Test Quality Gate Status GitHub Release Version GitHub Last Commit Codeberg Last Commit GitHub Top Language GitHub Org Stars Discord

Update Version Tags Action

Update Version Tags on Push or Release for Semantic Versions or Custom Tags.

Automatically maintain both Major 1.x.x and/or Minor 1.1.x Tags. For GitHub Actions you can just copy and paste this workflow: tags.yaml

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 v1 and v1.x tags that points to the latest release of the 1.x.x branch.

Note

Please submit a Feature Request for new features or Open an Issue if you find any bugs.

Inputs

input required default description
token Yes - ${{ secrets.GITHUB_TOKEN }}
prefix No v Tag Prefix (empty to disable)
major No true Update Major Tag *
minor No true Update Minor Tag *
tags No - Specify Tags to Update *

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.

tags - The prefix is not applied to specified tags. These can be a string list "v1,v1.0" or newline delimited |. If you only want to update the specified tags make sure to set both major and minor to false.

- name: 'Update Tags'
  uses: cssnr/update-version-tags-action@v1
  with:
      token: ${{ secrets.GITHUB_TOKEN }}

Outputs

output description
tags Comma Seperated String of Parsed Tags
- name: 'Update Tags'
  uses: cssnr/update-version-tags-action@v1
  id: tags
  with:
      token: ${{ secrets.GITHUB_TOKEN }}

- name: 'Echo Tags'
  run: echo ${{ steps.tags.outputs.tags }}

Examples

This is the workflow used by this Action to update tags on release: tags.yaml

name: 'Tags'

on:
    release:
        types: [published]

jobs:
    tags:
        name: 'Tags'
        runs-on: ubuntu-latest
        timeout-minutes: 5

        steps:
            - name: 'Update Tags'
              uses: cssnr/update-version-tags-action@v1
              with:
                  token: ${{ secrets.GITHUB_TOKEN }}

Specifying the tags to update:

- name: 'Update Tags'
  uses: cssnr/update-version-tags-action@v1
  with:
      token: ${{ secrets.GITHUB_TOKEN }}
      prefix: 'v'
      major: false
      minor: false
      tags: |
          v1
          v1.0

Support

For general help or to request a feature, see:

If you are experiencing an issue/bug or getting unexpected results, you can:

Contributing

Currently, the best way to contribute to this project is to star this project on GitHub.

Additionally, you can support other GitHub Actions I have published:

For a full list of current projects to support visit: https://cssnr.github.io/