Skip to content

Commit bdb095b

Browse files
committed
feat: minor and patch version configurable with defaults
1 parent 4bb0603 commit bdb095b

File tree

4 files changed

+29
-3
lines changed

4 files changed

+29
-3
lines changed

action.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@ inputs:
1818
required: true
1919
default: |
2020
^\[maven-release-plugin\].*|^\[Gradle Release Plugin\].*|^Merge.*|.*\[GRADLE SCRIPT\].*
21+
minorVersionPattern:
22+
description: |
23+
Commits matching this pattern will trigger minor version step.
24+
required: true
25+
default: |
26+
^[Ff]eat.*
27+
patchVersionPattern:
28+
description: |
29+
Commits matching this pattern will trigger patch version step.
30+
required: true
31+
default: |
32+
^fix.*
2133
templateDraft:
2234
description: |
2335
Used when draft is true.

dist/index.js

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ export async function run(): Promise<void> {
4343
const ignoreTagPattern = core.getInput('ignoreTagPattern').trim()
4444
console.log(`Ignoring commits with pattern: '${ignoreTagPattern}'`)
4545

46+
const patchVersionPattern = core.getInput('patchVersionPattern').trim()
47+
console.log(`Stepping patch with pattern: '${patchVersionPattern}'`)
48+
49+
const minorVersionPattern = core.getInput('minorVersionPattern').trim()
50+
console.log(`Stepping minor with pattern: '${minorVersionPattern}'`)
51+
4652
/**
4753
* Gather details on release
4854
*/
@@ -55,8 +61,10 @@ export async function run(): Promise<void> {
5561
console.log(`highestVersionTag: '${highestVersionTag}'`)
5662

5763
let currentVersion = gitChangelogCommandLine([
64+
'--minor-version-pattern',
65+
minorVersionPattern,
5866
'--patch-version-pattern',
59-
'^fix.*',
67+
patchVersionPattern,
6068
'--print-current-version'
6169
])
6270
console.log(`Rendered currentVersion: '${currentVersion}'`)

0 commit comments

Comments
 (0)