Update patch version
Added fallback condition to increment patch version in cases where no commits are present in the event (e.g. Pull Requests and custom events)
This commit is contained in:
parent
3a3a1741e8
commit
94b152067a
6
index.js
6
index.js
|
@ -12,7 +12,11 @@ Toolkit.run(async tools => {
|
||||||
const pkg = tools.getPackageJSON()
|
const pkg = tools.getPackageJSON()
|
||||||
const event = tools.context.payload
|
const event = tools.context.payload
|
||||||
|
|
||||||
const messages = event.commits.map(commit => commit.message + '\n' + commit.body)
|
if (!event.commits) {
|
||||||
|
console.log("Couldn't find any commits in this event, incrementing patch version...")
|
||||||
|
}
|
||||||
|
|
||||||
|
const messages = event.commits ? event.commits.map(commit => commit.message + '\n' + commit.body) : []
|
||||||
|
|
||||||
const commitMessage = 'version bump to'
|
const commitMessage = 'version bump to'
|
||||||
const isVersionBump = messages.map(message => message.toLowerCase().includes(commitMessage)).includes(true)
|
const isVersionBump = messages.map(message => message.toLowerCase().includes(commitMessage)).includes(true)
|
||||||
|
|
Loading…
Reference in New Issue