Skip to content

technote-space/get-next-version-action

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

Repository files navigation

Get Next Version Action

CI Status codecov CodeFactor License: MIT

Read this in other languages: English, 日本語.

GitHub Actions to get next version from commit histories.

Table of Contents

Details

Usage

e.g. Add release tag

on:
  pull_request:
    branches:
      - main
    types: [closed]

name: Add release tag

jobs:
  tag:
    name: Add release tag
    runs-on: ubuntu-latest
    if: github.event.pull_request.merged == true && github.event.pull_request.head.ref == 'release/next'
    steps:
      - name: Get next version
        uses: technote-space/get-next-version-action@v1
      - uses: actions/github-script@0.4.0
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          script: |
            github.git.createRef({
              owner: context.repo.owner,
              repo: context.repo.repo,
              ref: `refs/tags/${process.env.NEXT_VERSION}`,
              sha: context.sha
            })

Options

name description default required e.g.
MINOR_UPDATE_TYPES Minor update commit types feat feat, refactor
EXCLUDE_MESSAGES Exclude messages tweaks
BREAKING_CHANGE_NOTES Breaking change notes BREAKING CHANGE BREAKING
SET_ENV_NAME Env name NEXT_VERSION NEW_TAG
GITHUB_TOKEN Access token ${{github.token}} true ${{secrets.ACCESS_TOKEN}}

Outputs

name description e.g.
current current version v1.2.3
next next version v1.3.0

Action event details

Target events

eventName action
pull_request, pull_request_target opened, reopened, synchronize, closed

Author

GitHub (Technote)
Blog