/action-bump-calver

GitHub Action to bump the calver version up

Primary LanguageTypeScriptApache License 2.0Apache-2.0

Action Bump Calver

release license

This is a GitHub Action to bump the given calver version up.

For example:

  • current_version=v20.01.0, now()=2021/01/01 -> new_version=v21.01.0
  • current_version=20.01.0, now()=2021/01/01 -> new_version=21.01.0
  • current_version=v21.01.0, now()=2021/01/01 -> new_version=v21.01.1

It would be more useful to use this with other GitHub Actions' outputs.

Inputs

NAME DESCRIPTION TYPE REQUIRED DEFAULT
current_version The current version. string true N/A

Outputs

NAME DESCRIPTION TYPE
new_version The bumped calver version. string

Example

Simple

name: Push a new tag

on:
  push:
    branches:
      - master

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - uses: actions-ecosystem/action-get-latest-tag@v1
        id: get-latest-tag

      - uses: ShotaKitazawa/action-bump-calver@v1
        id: bump-calver
        with:
          current_version: ${{ steps.get-latest-tag.outputs.tag }}

      - uses: actions-ecosystem/action-push-tag@v1
        with:
          tag: ${{ steps.bump-calver.outputs.new_version }}
          message: '${{ steps.bump-calver.outputs.new_version }}: PR #${{ github.event.pull_request.number }} ${{ github.event.pull_request.title }}'

Note

This action is inspired by actions-ecosystem/action-bump-semver