build: cleanup release scripts, separate cli entrypoints from logic (#44082)

* build: cleanup release scripts, separate cli entrypoints from logic

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>

* build: use repo/org constants

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>

---------

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:
trop[bot] 2024-10-01 14:08:15 -07:00 committed by GitHub
parent 7b14a305f8
commit 6074f7ed31
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 410 additions and 300 deletions

View file

@ -1,7 +1,7 @@
import { Octokit } from '@octokit/rest';
import got from 'got';
import { createGitHubTokenStrategy } from './github-token';
import { ElectronReleaseRepo } from './types';
import { ELECTRON_ORG, ElectronReleaseRepo } from './types';
export async function getAssetContents (repo: ElectronReleaseRepo, assetId: number) {
const octokit = new Octokit({
@ -10,7 +10,7 @@ export async function getAssetContents (repo: ElectronReleaseRepo, assetId: numb
});
const requestOptions = octokit.repos.getReleaseAsset.endpoint({
owner: 'electron',
owner: ELECTRON_ORG,
repo,
asset_id: assetId,
headers: {