Skip to content

A Github Action automatically bump a semantic version and tag it.

License

Notifications You must be signed in to change notification settings

minddocdev/mou-version-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

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MOU Version Action

A Github Action to automatically bump and tag master with the latest SemVer formatted version.

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: minddocdev/mou-version-action@v1.0.0
      with:
        token: ${{ secrets.GITHUB_TOKEN }}
        prefix: mygroup/

Options

Input Variables

  • token (required) - Required for permission to tag the repo.
  • defaultBump (optional) - Which type of bump to use when none explicitly provided (default: patch).
  • prefix (optional) - Appends the given prefix to the tag (e.g. PREFIX=myprefix-v would create a myprefix-v1.0.0 tag)
  • npm (optional) - Update version in package.json file (default: false).
  • packageJsonPath (optional) - Specify the path of the package.json file (default: package.json).

Outputs

  • tag - The latest tag after running this action.
  • version - The semantic version without any "v" or other prefixes.

Note: This action creates a lightweight tag.

Bumping

Manual Bumping: 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.

Automatic Bumping: If no #major, #minor or #patch tag is contained in the commit messages, it will bump whichever DEFAULT_BUMP is set to (which is minor by default).

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
    • Bump tag with minor version unless any commit message contains #major or #patch
    • Pushes tag to github

Credits

fsaintjacques/semver-tool

anothrNick/github-tag-action

About

A Github Action automatically bump a semantic version and tag it.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 95.2%
  • Dockerfile 4.8%