From b7290ec8221b773618b55caf32e16814582d9403 Mon Sep 17 00:00:00 2001 From: Maximillian Meier Date: Wed, 9 Jun 2021 14:04:41 +0200 Subject: [PATCH] fix message --- app/lib/tag.js | 9 ++++++++- app/main.js | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/lib/tag.js b/app/lib/tag.js index 9fef376..f4d399d 100644 --- a/app/lib/tag.js +++ b/app/lib/tag.js @@ -30,6 +30,10 @@ export default class Tag { } } + get message() { + return this._message || '' + } + get sha () { return this._sha || '' } @@ -63,6 +67,7 @@ export default class Tag { } const changelog = await github.repos.compareCommits({ owner, repo, base: tags.shift().name, head: 'master' }) + const tpl = (core.getInput('commit_message_template', { required: false }) || '').trim() return changelog.data.commits @@ -125,11 +130,12 @@ export default class Tag { if (!tagexists) { // Create tag + const message = await this.getMessage() const newTag = await github.git.createTag({ owner, repo, tag: this.name, - message: await this.getMessage(), + message, object: process.env.GITHUB_SHA, type: 'commit' }) @@ -160,6 +166,7 @@ export default class Tag { this._uri = newReference.data.url this._ref = newReference.data.ref + this._message = message; core.warning(`Reference ${newReference.data.ref} available at ${newReference.data.url}` + os.EOL) } else { diff --git a/app/main.js b/app/main.js index d0c1d0c..0d6bce1 100644 --- a/app/main.js +++ b/app/main.js @@ -72,8 +72,8 @@ async function run () { return } - // // The tag setter will autocorrect the message if necessary. - // tag.message = core.getInput('tag_message', { required: false }).trim() + // The tag setter will autocorrect the message if necessary. + tag.message = core.getInput('tag_message', { required: false }).trim() await tag.push() core.setOutput('tagname', tag.name)