From b46d5bd95bf366146d27b7a1137b72b55d4c2b84 Mon Sep 17 00:00:00 2001 From: Lars Kappert Date: Sun, 18 Feb 2024 22:47:46 +0100 Subject: [PATCH] Potential fix (resolves #1082) --- lib/plugin/github/GitHub.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/plugin/github/GitHub.js b/lib/plugin/github/GitHub.js index 71b8db90..10b79a34 100644 --- a/lib/plugin/github/GitHub.js +++ b/lib/plugin/github/GitHub.js @@ -127,6 +127,7 @@ class GitHub extends Release { } async release() { + const { assets } = this.options; const { isWeb, isUpdate } = this.getContext(); const { isCI } = this.config; @@ -138,7 +139,7 @@ class GitHub extends Release { return this.step({ task, label: 'Generating link to GitHub Release web interface', prompt: 'release' }); } else if (isCI) { await this.step({ task: () => this[publishMethod](), label: `GitHub ${type} release` }); - await this.step({ task: () => this.uploadAssets(), label: 'GitHub upload assets' }); + await this.step({ enabled: assets, task: () => this.uploadAssets(), label: 'GitHub upload assets' }); return this.step({ task: () => (isUpdate ? Promise.resolve() : this.commentOnResolvedItems()), label: 'GitHub comment on resolved items' @@ -147,7 +148,7 @@ class GitHub extends Release { const release = async () => { await this[publishMethod](); await this.uploadAssets(); - return isUpdate ? Promise.resolve() : this.commentOnResolvedItems(); + return isUpdate ? Promise.resolve(true) : this.commentOnResolvedItems(); }; return this.step({ task: release, label: `GitHub ${type} release`, prompt: 'release' }); } @@ -379,7 +380,7 @@ class GitHub extends Release { const { submit, issue, pr } = comments ?? {}; const context = this.getContext(); - if (!submit || !changelog) return; + if (!submit || !changelog) return true; const shas = getCommitsFromChangelog(changelog); const searchResults = await Promise.all(searchQueries(this.client, owner, repo, shas)); @@ -395,7 +396,7 @@ class GitHub extends Release { if (isDryRun) { this.log.exec(`octokit issues.createComment (${url})`, { isDryRun }); - return; + return Promise.resolve(); } try {