Skip to content

A Github Action to update MAJOR.MINOR.PATCH tag on merge and update "latest" tag.

License

Notifications You must be signed in to change notification settings

WiktorJ/github-tag-action

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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

github-tag-action

A Github Action to automatically bump and tag master, on merge, with the latest SemVer formatted version, and update latest tag to point to the latest commit.

Build Status Stable Version Latest Release

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: wiktorj/github-tag-action@master
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Options

Environment Variables

  • GITHUB_TOKEN (required) - Required for permission to tag the repo.
  • WITH_V (optional) - Tag version with v character.

Outputs

  • new_tag - The value of the newly created tag.

Note: This action creates a annotated tag.

Bumping

With every commit to master latest tag is updated to the latest commit in the master branch.

Any commit message that includes #major, #minor, or #patch will trigger the respective version bump. If two or more are present, the highest-ranking one will take precedence.

Note: This action will not bump the tag if the HEAD commit has already been tagged.

Workflow

  • Add this action to your repo
  • Commit some changes
  • Either push to master or open a PR
  • On push (or merge) to master, the action will:
    • Get latest tag (different than latest)
    • Bump the tag if commit message contains one of the: #major, #minor or #patch
    • Updates latest tag to point to the latest commit on the master branch
    • Pushes tags updates to github

Credits

fsaintjacques/semver-tool

anothrNick/github-tag-action

Projects using github-tag-action

A list of projects using github-tag-action for reference.

About

A Github Action to update MAJOR.MINOR.PATCH tag on merge and update "latest" tag.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 94.3%
  • Dockerfile 5.7%