Skip to content
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

17 Commits
 
 
 
 

Repository files navigation

Next Version Action

This GitHub action calculates the next semantic version (major.minor.patch) based on the latest Git tag.

Usage

- name: Get next version
  id: get_version
  uses: danielboxer/next-version-action@v1
  with:
    # which part of the version to increment (major, minor, patch)
    increment: patch
    # optional: manually set a version instead of auto-incrementing
    version: null
    # optional: add "v" prefix to version
    use_v_prefix: null

- name: Create release
  uses: softprops/action-gh-release@v2
  with:
    # use the new version generated by this action
    tag_name: ${{ steps.get_version.outputs.new_version }}

This action can be combined with workflow_dispatch inputs to create a GUI for automating releases more easily:

Workflow GUI Example

on:
  workflow_dispatch:
    inputs:
      increment:
        description: "Which part of the version to increment"
        type: choice
        options:
          - major
          - minor
          - patch
        default: "patch"
        required: true

      version:
        description: "Override version increment"
        required: false

...
  
steps:
  - name: Get Next Version
    id: get_version
    uses: danielboxer/next-version-action@v1
    with:
      increment: ${{ github.event.inputs.increment }}
      version: ${{ github.event.inputs.version }}
      use_v_prefix: true

Notes

  • If no previous tag exists, defaults to 0.1.0

About

GitHub action to get the next semantic version based on git tags

Resources

Stars

Watchers

Forks

Releases

Used by

Contributors