Updated license

This commit is contained in:
Corey Butler 2019-09-02 19:04:57 -05:00
parent 60a5078e08
commit 272a3b92fc
2 changed files with 9 additions and 4 deletions

View File

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

View File

@ -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', '')
}
}