exp
This commit is contained in:
parent
b893475bf9
commit
74f650bb33
27
.github/workflows/publish-release.js
vendored
27
.github/workflows/publish-release.js
vendored
|
@ -16,17 +16,24 @@ module.exports = /*async*/ ({github, context, core}) => {
|
||||||
const version = context.payload.inputs.version
|
const version = context.payload.inputs.version
|
||||||
const tag = "v" + version
|
const tag = "v" + version
|
||||||
console.log(`Validate version '${version}'.`)
|
console.log(`Validate version '${version}'.`)
|
||||||
const release = restapi.repos.getReleaseByTag({
|
try {
|
||||||
owner: context.repo.owner,
|
const release = restapi.repos.getReleaseByTag({
|
||||||
repo: context.repo.repo,
|
owner: context.repo.owner,
|
||||||
tag: tag
|
repo: context.repo.repo,
|
||||||
})
|
tag: tag
|
||||||
if (release === null) {
|
})
|
||||||
core.setFailed(`Could not find a GitHub release for tag '${tag}'.`)
|
if (release === null) {
|
||||||
return
|
core.setFailed(`Could not find a GitHub release for tag '${tag}'.`)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (release.draft) {
|
||||||
|
core.setFailed(`GitHub release for tag '${tag}' is already published.`)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (release.draft) {
|
catch (error)
|
||||||
core.setFailed(`GitHub release for tag '${tag}' is already published.`)
|
{
|
||||||
|
core.setFailed(`Could not find a GitHub release for tag '${tag}'.`)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user