From 95a34adfba134d0944252a079ade6858a2a241ec Mon Sep 17 00:00:00 2001 From: Stephan Date: Fri, 10 Dec 2021 19:52:22 +0100 Subject: [PATCH] wtf --- .github/workflows/publish-release.yml | 30 ++++++++++++--------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 65efdec..680df4a 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -24,34 +24,29 @@ jobs: script: | const ver = "${{ github.ref }}".substring(19) const tag = "v" + ver - var rel - var rels + var rel = null try { - rels = await github.repos.listReleases({ - owner: context.repo.owner, - repo: context.repo.repo - }) + // this does *not* return draft releases //rel = await github.repos.getReleaseByTag({ // owner: context.repo.owner, // repo: context.repo.repo, // tag: tag //}) + const rels = await github.repos.listReleases({ + owner: context.repo.owner, + repo: context.repo.repo + }) + for (var r in rels.data) { + if (r.tag_name === tag) { + rel = r + break + } + } } catch (error) { core.setFailed(`Could not find a release for tag ${tag}.`) return } - rel = null - console.log('RELS:') - console.log(rels) - for (var r in rels) { - console.log('REL:') - console.log(r) - if (r.tagName === tag) { - rel = r - break - } - } if (rel === null) { core.setFailed(`Could not find a release for tag ${tag}.`) return @@ -101,6 +96,7 @@ jobs: script: | const ver = "${{ github.ref }}".substring(19) const tag = "v" + ver + // this is going to fail const rel = await github.repos.getReleaseByTag({ owner: context.repo.owner, repo: context.repo.repo,