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

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

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

* build: use repo/org constants
This commit is contained in:
Samuel Attard 2024-10-01 14:08:20 -07:00 committed by GitHub
parent 075a297347
commit 01e64d3932
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 408 additions and 299 deletions

View file

@ -10,8 +10,10 @@ import { get, render } from './notes';
import { Octokit } from '@octokit/rest';
import { createGitHubTokenStrategy } from '../github-token';
import { parseArgs } from 'node:util';
import { ELECTRON_ORG, ELECTRON_REPO } from '../types';
const octokit = new Octokit({
authStrategy: createGitHubTokenStrategy('electron')
authStrategy: createGitHubTokenStrategy(ELECTRON_REPO)
});
const semverify = (version: string) => version.replace(/^origin\//, '').replace(/[xy]/g, '0').replace(/-/g, '.');
@ -45,8 +47,8 @@ const getTagsOf = async (point: string) => {
const getTagsOnBranch = async (point: string) => {
const { data: { default_branch: defaultBranch } } = await octokit.repos.get({
owner: 'electron',
repo: 'electron'
owner: ELECTRON_ORG,
repo: ELECTRON_REPO
});
const mainTags = await getTagsOf(defaultBranch);
if (point === defaultBranch) {