BenjaminG / standard-version_action

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Standar version

Add Standar version incredibly fast into your project!

Features

  • Allow prerelease
  • Super easy to setup
  • Automatically bump version
  • Automatically create changelog
  • Update package.json your repo with the new version

Are you using conventional commits and semver?

Then you are ready to use this github action.

Usage

  1. Follow the Conventional Commits Specification in your repository.
  2. Create a .github/workflows/bumpversion.yaml with the Sample Workflow

Sample Workflow

name: Bump version

on:
  push:
    branches:
      - master

jobs:
  bump_version:
    if: "!startsWith(github.event.head_commit.message, 'bump:')"
    runs-on: ubuntu-latest
    name: "Bump version and create changelog with commitizen"
    steps:
      - name: Check out
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
          token: "${{ secrets.GITHUB_TOKEN }}"
      - id: get_version
        name: Create bump and changelog
        uses: Sha-code/standard-version_action@1.0.8
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
      - run: echo ${{ steps.get_version.outputs.version }}
      - run: echo ${{ steps.get_version.outputs.type }}

Variables

Name Description Default
github_token Token for the repo. Can be passed in using ${{ secrets.GITHUB_TOKEN }} required -
dry_run Run without creating commit, output to stdout false
repository Repository name to push. Default or empty value represents current github repository current one
branch Destination branch to push changes master
prerelease Set as prerelease {alpha,beta,rc} choose type of prerelease -

Troubleshooting

Other actions are not triggered when the tag is pushed

This problem occurs because secrets.GITHUB_TOKEN does not trigger other actions by design.

To solve it you must use a personal access token in the checkout and the commitizen steps.

Follow the instructions in [commitizen's documentation][cz-docs-ga]

I'm not using conventional commits, I'm using my own set of rules on commits

The only way to use this is to switch to the standard :

Read more about standard

About


Languages

Language:Shell 95.0%Language:Dockerfile 5.0%