Skip to content

Commit

Permalink
Support git-path config option for version bump (#253)
Browse files Browse the repository at this point in the history
I found that, while the git-path config option does correctly limit
changelog generation to commits that fall within the path, the version
bump still considers all paths. 'conventional-recommended-bump'
[supports a `path`
option](https://www.npmjs.com/package/conventional-recommended-bump#path),
so it is not difficult to support this.
  • Loading branch information
TriPSs committed Feb 24, 2024
2 parents 07677b3 + e3346a2 commit 71666cd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -12,7 +12,7 @@ This action will bump version, tag commit and generate a changelog with conventi
- **Optional** `git-push`: Push all the GIT changes. Default `true`
- **Optional** `git-branch`: The branch used to push. Default is the current branch (`${{ github.ref }}`)
- **Optional** `git-url`: Git repository domain. Default is `github.com`
- **Optional** `git-path`: Path filter for the logs. If set, only commits that match the path filter will be considered. By default, we won't use this feature(empty string).
- **Optional** `git-path`: Path filter for the logs and version. If set, only commits that match the path filter will be considered. By default, we won't use this feature(empty string).
- **Optional** `preset`: Preset that is used from conventional commits. Default is `angular` ([learn more about presents here](https://github.com/TriPSs/conventional-changelog-action/issues/223))
- **Optional** `tag-prefix`: Prefix for the git tags. Default `v`.
- **Optional** `input-file`: Read the changelog from this file. This will prepend the newly generated changelogs to the file's content.
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Expand Up @@ -127,7 +127,7 @@ inputs:
required: false

git-path:
description: "Path filter for the logs. If set, only commits that match the path filter will be considered"
description: "Path filter for the logs and version. If set, only commits that match the path filter will be considered"
default: ""
required: false

Expand Down
3 changes: 2 additions & 1 deletion dist/index.js
Expand Up @@ -34885,7 +34885,8 @@ async function run() {
preset: await loadPreset(preset),
tagPrefix,
config,
skipUnstable: !prerelease
skipUnstable: !prerelease,
path: gitPath
})

core.info(`Recommended release type: ${recommendation.releaseType}`)
Expand Down
3 changes: 2 additions & 1 deletion src/index.js
Expand Up @@ -105,7 +105,8 @@ async function run() {
preset: await loadPreset(preset),
tagPrefix,
config,
skipUnstable: !prerelease
skipUnstable: !prerelease,
path: gitPath
})

core.info(`Recommended release type: ${recommendation.releaseType}`)
Expand Down

0 comments on commit 71666cd

Please sign in to comment.