Skip to content

scaffoldly/bump-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

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bump-version action

This action will bump versions, create releases and manage tagging.

If action is prerelease

The following steps are taken:

  • The version is parsed from version-file
  • It prerelease (-#) version (X.Y.Z-#) is appended or incremented using semver
  • The updated version and all modified files are committed (git add .)
  • A tag is pushed with the same name as the new version
  • A draft release is created with the same name with a log of history since the last release

If action is postrelease

The following steps are taken:

  • The version is parsed from the version-file
  • The Default Branch is checked out
  • The prerelease (-#) version (X.Y.Z-#) is lobbed off using semver
  • The updated version is committed
  • A tag is pushed with the same name as the new version
  • The name on the existing published release is updated to the new version

Inputs

action

Required The action to run: 'prerelease' or 'postrelease'

version-file

Required The version file to manage, e.g. 'package.json'

repo-token

Required The GitHub token for this repo

major-tag

Optional: If set, will create/overwrite a tag representing the major release ('v1'). Only applicable during during postrelease

commit-message-prefix

Optional: If set, this prefix will be added to any commit messages

release-branch

Optional: If set, set the branch that version commits will be pushed to

Outputs

This action has no outputs.

Example usage

Run a prerelease

on:
  push:
    branches: [main]
jobs:
  prerelease:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: scaffoldly/bump-version-action@main
        with:
          action: prerelease
          version-file: package.json
          repo-token: ${{ secrets.GITHUB_TOKEN }}

Run a postrelease

on:
  release:
    types: [published]
jobs:
  prerelease:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: scaffoldly/bump-version-action@main
        with:
          action: postrelease
          version-file: package.json
          repo-token: ${{ secrets.GITHUB_TOKEN }}