Merge pull request #29 from Emad-salah/patch-1

Update patch version
This commit is contained in:
Phil 2020-07-23 16:51:15 +02:00 committed by GitHub
commit 9b143ed11d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -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)