Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
tag

GitHub Action

gha-versioning

v1.0.2

gha-versioning

tag

gha-versioning

Create (or override existing) vX and vX.Y based on the provided tag. Useful to maintain GitHub Action tags up to date.

Installation

Copy and paste the following snippet into your .yml file.

              

- name: gha-versioning

uses: yoanm/[email protected]

Learn more about this action in yoanm/gha-versioning

Choose a version

gha-versioning 🏷️

GitHub Tag

Lightweight composite github action managing vX and vX.Y tags for a github action.


Designed to act upon created or edited github releases, action will create or override vX and vX.Y tags based on the provided tag.

Note

Action will also override the original tag, in order to keep it as latest tag !

Otherwise, when creating a new github releases with an automatically generated changelog, vX or vX.Y tag will be picked as previous tag rather than the expected previous vX.Y.Z tag.

Usage

Important

  • Do not forget to set contents: write permission !
  • When action is used with another event that release creation (or edition), you must fill the tag input !
name: Publish

on:
  release:
    types: [published, edited]

jobs:
  tag:
    name: Publish vX and vX.Y tags
    runs-on: ubuntu-latest
    permissions:
      contents: write # Required to push new tags !
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Generate vX and vX.Y tags
        uses: yoanm/gha-versioning@v1

Inputs

  • tag: Default to ${{ github.event.release.tag_name }}

  • git-email: Default to github-actions[bot]@users.noreply.github.com.

    Git user email is required when creating tag with a message.

  • git-name: Default to github-actions.

    Git user name is required when creating tag with a message.

Outputs

  • minor-tag: Minor tag created (e.g. vX.Y)
  • major-tag: Major tag created (e.g. vX)