From 31ee6a9cf6d281ba5c9f6298def79cb3c40822ab Mon Sep 17 00:00:00 2001 From: shBLOCK <50770712+shBLOCK@users.noreply.github.com> Date: Thu, 9 May 2024 08:32:38 +0800 Subject: [PATCH] Debug release.yml --- .github/workflows/release.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 007cf6e..9cae418 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,7 +34,7 @@ jobs: debug: true # noinspection TypeScriptUnresolvedReference script: | - console.log(JSON.stringify(context)) + const specified_tag = context.payload.inputs && context.payload.inputs.tag let tag = undefined let commit = undefined for await (const tags of github.paginate.iterator( @@ -51,7 +51,7 @@ jobs: repo: context.repo.repo, ref: tag_data.commit.sha })).data.commit - if (context.payload.inputs.tag) { + if (specified_tag) { if (tag_data.name == context.payload.inputs.tag) { tag = tag_data commit = commit_data @@ -64,6 +64,12 @@ jobs: } } } + + if (tag == undefined) { + core.setFailed("Failed to determine a tag.") + return + } + core.info(`Using tag: ${tag.name}`) core.info(`Message: ${commit.message}`) core.notice(`Using tag: ${tag.name}`)