Uses parse-commit-message
to detect if the version should be incremented to major
(breaking change), minor
(feature without breaking change), patch
(bug fix), or none
(no new release). If the commit message is a pull request merge message, that commit will be none
.
This works by getting all the commit messages. It works on the push
event, and on pull request events.
This project uses Pnpm to install dependencies. Use pnpm/action-setup
before using this action.
This variable is needed for getting commits of a pull request. If running on the push
event, this variable is not used.
Will be either none
, patch
, minor
, or major
.
Will be a JSON object where the keys are the scopes, and the values are the increments.
# ...
jobs:
release:
runs-on: ubuntu-latest
steps:
# ...
- name: Setup Pnpm
uses: pnpm/action-setup@v2.0.1
with:
version: 6.4
run_install: true
- id: get_increment
name: Get Increment
uses: ChocolateLoverRaj/detect-increment@v1.2
- run: |
echo ${{ steps.get_increment.outputs.increment }}
echo ${{ steps.get_increment.outputs.increments_by_scopes }}
The example above will echo the increment. The output can be used with other steps, like automatically releasing a new version of a package.
Note that it says uses: ChocolateLoverRaj/detect-increment@v1.2
. v1.2
is a tag that will be updated to have the latest patch release. By using this tag, you can get a version with bug fixes without having to change any files.