github-tag-action/README.md

1.5 KiB

GitHub Tag Action

A Github Action to automatically bump and tag master, on merge, with the latest SemVer formatted version. Works on any platform.

Usage

name: Bump version
on:
  push:
    branches:
      - master
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - name: Bump version and push tag
        uses: mathieudutour/github-tag-action@v1
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}

Inputs

  • github_token (required) - Required for permission to tag the repo. Usually ${{ secrets.GITHUB_TOKEN }}.
  • default_bump (optional) - Which type of bump to use when none explicitly provided (default: minor).
  • tag_prefix (optional) - A prefix to the tag name (default: v).
  • release_branches (optional) - Comma separated list of branches (bash reg exp accepted) that will generate the release tags. Other branches and pull-requests generate versions postfixed with the commit hash and do not generate any tag. Examples: master or .* or release.*,hotfix.*,master ...

Outputs

  • new_tag - The value of the newly created tag. Note that if there hasn't been any new commit, this will be undefined.
  • previous_tag - The value of the previous tag (or 0.0.0 if none).

Note: This action creates a lightweight tag.

Credits

anothrNick/github-tag-action - a similar action using a Dockerfile