From 3e68ff326a4a45b391d55013e3e07b021f9b2a48 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 13:50:42 -0700 Subject: [PATCH] build: ensure consistent usage of getRepo (#44080) Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Samuel Attard --- script/release/uploaders/upload-to-github.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/script/release/uploaders/upload-to-github.ts b/script/release/uploaders/upload-to-github.ts index 174a367d97d1..e5829eb39f2c 100644 --- a/script/release/uploaders/upload-to-github.ts +++ b/script/release/uploaders/upload-to-github.ts @@ -1,6 +1,7 @@ import { Octokit } from '@octokit/rest'; import * as fs from 'node:fs'; import { createGitHubTokenStrategy } from '../github-token'; +import { ELECTRON_REPO, ElectronReleaseRepo, NIGHTLY_REPO } from '../types'; if (process.argv.length < 6) { console.log('Usage: upload-to-github filePath fileName releaseId'); @@ -37,7 +38,11 @@ const getHeaders = (filePath: string, fileName: string) => { }; }; -const targetRepo = releaseVersion.indexOf('nightly') > 0 ? 'nightlies' : 'electron'; +function getRepo (): ElectronReleaseRepo { + return releaseVersion.indexOf('nightly') > 0 ? NIGHTLY_REPO : ELECTRON_REPO; +} + +const targetRepo = getRepo(); const uploadUrl = `https://uploads.github.com/repos/electron/${targetRepo}/releases/${releaseId}/assets{?name,label}`; let retry = 0;