GitHub action to automatically update project version and create version tag.
Current version in the project and use semantic versioning as well as conventional commits.
Breaking changes increase the major version, feat
s increase the minor, and fix
es increase the patch version. The rest of the commit types increase the patch by default but can be configured to increase the minor version.
Add a step to your GitHub workflow using the action. For example:
name: my-workflow
run-name: Do stuff + update version
on:
push:
branches:
- '**'
jobs:
do_stuff:
runs-on: ubuntu-latest
name: Do stuff
steps:
- id: echo_stuff
name: Echo stuff
run: echo "Doing stuff"
shell: bash
update_version:
if: ${{ github.ref == 'refs/heads/develop' }}
needs: do_stuff
runs-on: ubuntu-latest
name: Update project version
steps:
- id: new_version
uses: nomasystems/update-project-version@latest
with:
tag-prefix: "v"
version-files: "File1,File2,File3"
The action accepts the following inputs:
Input param | Required | Default value | Description |
---|---|---|---|
committer-email |
✖️ | 'github-actions[bot]@users.noreply.github.com' | Committer e-mail |
committer-username |
✖️ | 'github-actions[bot]' | Committer username |
extra-minor-commit-types |
✖️ | '' | Extra commit types for minor changes (comma separated list) |
extra-patch-commit-types |
✖️ | 'build,chore,ci,docs,perf,refactor,style,test' | Extra commit types for patch changes (comma separated list) |
latest-tag |
✖️ | 'false' | Indicates if an extra tag "latest" should be added |
tag-preffix |
✖️ | '' | Git tag prefix (tag chars before the version chars) |
tag-suffix |
✖️ | '' | Git tag suffix (tag chars after the version chars) |
version-files |
✖️ | '' | Files to update with the new version (comma separated list) |
- Initial tag, from which the action will obtain the current version number
- Current version number in the specified "version-files", which the action will update with the new version
- A commit message must have the form
{type}(#{issue_number}):{message}
- A commit message starting with
xxx!
(beingxxx
any valid type/scope) or including footersBREAKING CHANGE: xxx
orBREAKING-CHANGE: xxx
will result in a major update (increment the 1st number in the version) - A commit message with types
feat
or any type underextra-minor-commit-types
will result in a minor update (increment the 2nd number in the version) - A commit message with types
fix
or any type underextra-patch-commit-types
will result in a patch update (increment the 3rd number in the version)
Pull requests are welcome. Please read the contributing guidelines to know more about contribution.