1
0
This commit is contained in:
Stephan 2022-03-18 16:35:35 +01:00
parent b893475bf9
commit 74f650bb33

View File

@ -16,6 +16,7 @@ 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}'.`)
try {
const release = restapi.repos.getReleaseByTag({ const release = restapi.repos.getReleaseByTag({
owner: context.repo.owner, owner: context.repo.owner,
repo: context.repo.repo, repo: context.repo.repo,
@ -29,6 +30,12 @@ module.exports = /*async*/ ({github, context, core}) => {
core.setFailed(`GitHub release for tag '${tag}' is already published.`) core.setFailed(`GitHub release for tag '${tag}' is already published.`)
return return
} }
}
catch (error)
{
core.setFailed(`Could not find a GitHub release for tag '${tag}'.`)
return
}
try { try {
const ref = await restapi.git.getRef({ const ref = await restapi.git.getRef({
owner: context.repo.owner, owner: context.repo.owner,