From 863aefcc9d181f5c31a38d32054cf276b09ca48b Mon Sep 17 00:00:00 2001 From: Stephan Date: Fri, 18 Mar 2022 17:42:21 +0100 Subject: [PATCH] exp --- .github/workflows/publish-release.js | 7 ++++++- .github/workflows/publish-release.yml | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-release.js b/.github/workflows/publish-release.js index 53d6b1f..b680918 100644 --- a/.github/workflows/publish-release.js +++ b/.github/workflows/publish-release.js @@ -1,6 +1,7 @@ module.exports = /*async*/ ({github, context, core}) => { const restapi = github.rest + var dryrun = context.payload.inputs.dryrun function firstOrDefault(items, predicate) { for (const item of items) { @@ -33,6 +34,7 @@ module.exports = /*async*/ ({github, context, core}) => { core.setFailed(`Could not find branch 'release/${version}'.`) return } + console.log(`Found branch 'release/${version}'.`) // github milestone must exist and be open const milestone = await getMilestone() @@ -46,6 +48,7 @@ module.exports = /*async*/ ({github, context, core}) => { core.setFailed(`Milestone '${version}' is already closed.`) return } + console.log(`Found open milestone '${version}'.`) // github release must exist and not be published yet try { @@ -68,6 +71,7 @@ module.exports = /*async*/ ({github, context, core}) => { core.setFailed(`Could not find a GitHub release for tag '${tag}'.`) return } + console.log(`Found yet-unpublished GitHub Release for tag '${tag}'.`) // tag must not exist try { @@ -82,8 +86,9 @@ module.exports = /*async*/ ({github, context, core}) => { catch (error) { // this is expected - the tag should not exist } + console.log(`Verified that tag '${tag}' does not exist yet.`) - console.log(`Found branch 'release/${version}', a yet-unpublished GitHub Release for tag '${tag}' which does not exist yet.`) + console.log('Release is valid.') } async function publishRelease() { diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index f05a6fb..bf8ac5f 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -5,6 +5,11 @@ on: version: description: 'Version' required: true + dryrun: + description: 'DryRun' + required: true + type: boolean + default: true jobs: job: