From 17ea7f42fcf71527aef6646fcbc74abbda40db42 Mon Sep 17 00:00:00 2001 From: Keeley Hammond Date: Tue, 14 Feb 2023 21:12:07 -0800 Subject: [PATCH] build: ignore makeLatest on pre-releases (#37274) * build: ignore makeLatest on pre-releases * chore: set makeLatest to false by default Co-authored-by: Samuel Attard --------- Co-authored-by: Samuel Attard --- script/release/release.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/script/release/release.js b/script/release/release.js index 0116113524e..191177a5545 100755 --- a/script/release/release.js +++ b/script/release/release.js @@ -318,12 +318,15 @@ function saveShaSumFile (checksums, fileName) { } async function publishRelease (release) { - const currentLatest = await octokit.repos.getLatestRelease({ - owner: 'electron', - repo: targetRepo - }); + let makeLatest = false; + if (!release.prerelease) { + const currentLatest = await octokit.repos.getLatestRelease({ + owner: 'electron', + repo: targetRepo + }); - const makeLatest = !release.prerelease && semver.gte(release.tag_name, currentLatest.data.tag_name); + makeLatest = semver.gte(release.tag_name, currentLatest.data.tag_name); + } return octokit.repos.updateRelease({ owner: 'electron',