mirror of
https://github.com/ButlerLogic/action-autotag.git
synced 2025-09-01 02:34:03 +07:00
Added support (and outputs) for semver builds and prereleases.
This commit is contained in:
@ -42,6 +42,14 @@ export default class Tag {
|
||||
return this._ref || ''
|
||||
}
|
||||
|
||||
get prerelease () {
|
||||
return /([0-9\.]{5}(-[\w\.0-9]+)?)/i.test(this.version)
|
||||
}
|
||||
|
||||
get build () {
|
||||
return /([0-9\.]{5}(\+[\w\.0-9]+)?)/i.test(this.version)
|
||||
}
|
||||
|
||||
async getMessage () {
|
||||
if (this._message !== null) {
|
||||
return this._message
|
||||
|
@ -54,6 +54,8 @@ async function run () {
|
||||
|
||||
core.warning(`Attempting to create ${tag.name} tag.`)
|
||||
core.setOutput('tagrequested', tag.name)
|
||||
core.setOutput('prerelease', tag.prerelease ? 'yes' : 'no')
|
||||
core.setOutput('build', tag.build ? 'yes' : 'no')
|
||||
|
||||
// Check for existance of tag and abort (short circuit) if it already exists.
|
||||
if (await tag.exists()) {
|
||||
|
Reference in New Issue
Block a user