build: ensure consistent usage of getRepo (#44080)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
This commit is contained in:
parent
8d5eeb2b4b
commit
3e68ff326a
1 changed files with 6 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
import { Octokit } from '@octokit/rest';
|
import { Octokit } from '@octokit/rest';
|
||||||
import * as fs from 'node:fs';
|
import * as fs from 'node:fs';
|
||||||
import { createGitHubTokenStrategy } from '../github-token';
|
import { createGitHubTokenStrategy } from '../github-token';
|
||||||
|
import { ELECTRON_REPO, ElectronReleaseRepo, NIGHTLY_REPO } from '../types';
|
||||||
|
|
||||||
if (process.argv.length < 6) {
|
if (process.argv.length < 6) {
|
||||||
console.log('Usage: upload-to-github filePath fileName releaseId');
|
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}`;
|
const uploadUrl = `https://uploads.github.com/repos/electron/${targetRepo}/releases/${releaseId}/assets{?name,label}`;
|
||||||
let retry = 0;
|
let retry = 0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue