From 272a3b92fc55fc6352d9703d9ede91bc8726222d Mon Sep 17 00:00:00 2001 From: Corey Butler Date: Mon, 2 Sep 2019 19:04:57 -0500 Subject: [PATCH] Updated license --- README.md | 1 + lib/main.js | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 078f107..c5efcdd 100644 --- a/README.md +++ b/README.md @@ -104,4 +104,5 @@ If you are building an action that runs after this one, be aware this action pro 1. `tagname` will be empty if no tag was created, or it will be the value of the new tag. 1. `tagsha`: The SHA of the new tag. 1. `taguri`: The URI/URL of the new tag reference. +1. `tagmessage`: The messge applied to the tag reference (this is what shows up on the tag screen on Github). 1. `version` will be the version attribute found in the `package.json` file. \ No newline at end of file diff --git a/lib/main.js b/lib/main.js index b90ea0a..8047df5 100644 --- a/lib/main.js +++ b/lib/main.js @@ -56,7 +56,7 @@ async function run() { let tagName = pkg.version const tagPrefix = core.getInput('tag_prefix', { required: false }) const tagSuffix = core.getInput('tag_suffix', { required: false }) - const tagMsg = core.getInput('tag_message', { required: false }).trim() + let tagMsg = core.getInput('tag_message', { required: false }).trim() tagName = `${tagPrefix}${tagName}${tagSuffix}` @@ -81,13 +81,15 @@ async function run() { let newTag try { + tagMsg = tagMsg.trim().length > 0 + ? tagMsg + : `Version ${pkg.version}` + newTag = await git.git.createTag({ owner, repo, tag: tagName, - message: tagMsg.trim().length > 0 - ? tagMsg - : `Version ${pkg.version}`, + message: tagMsg, object: process.env.GITHUB_SHA, type: 'commit' }) @@ -126,12 +128,14 @@ async function run() { core.setOutput('tagname', tagName) core.setOutput('tagsha', newTag.data.sha) core.setOutput('taguri', newReference.data.url) + core.setOutput('tagmessage', tagMsg.trim()) } } catch (error) { core.warning(error.message) core.setOutput('tagname', '') core.setOutput('tagsha', '') core.setOutput('taguri', '') + core.setOutput('tagmessage', '') } }