Add Standar version incredibly fast into your project!
- 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.
- Follow the Conventional Commits Specification in your repository.
- Create a
.github/workflows/bumpversion.yaml
with the 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/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- run: echo ${{ steps.get_version.outputs.version }}
- run: echo ${{ steps.get_version.outputs.type }}
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 | - |
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]
The only way to use this is to switch to the standard :