build: add support for fetching github token from sudowoodo (#43888)

build: add support for fetching github token from sudowoodo (#43808)

* build: add support for fetching github token from sudowoodo

* chore: update release notes cache for tests

* build: support nightlies repo correctly

* build: post token
This commit is contained in:
Samuel Attard 2024-09-23 13:56:29 -07:00 committed by GitHub
parent 2cc8a33f11
commit 4e5de0ca44
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 134 additions and 36 deletions

View file

@ -6,16 +6,17 @@ const args = require('minimist')(process.argv.slice(2), {
default: { releaseID: '' }
});
const { Octokit } = require('@octokit/rest');
const octokit = new Octokit({
auth: process.env.ELECTRON_GITHUB_TOKEN
});
const { createGitHubTokenStrategy } = require('./github-token');
require('colors');
const pass = '✓'.green;
const fail = '✗'.red;
async function deleteDraft (releaseId, targetRepo) {
const octokit = new Octokit({
authStrategy: createGitHubTokenStrategy(targetRepo)
});
try {
const result = await octokit.repos.getRelease({
owner: 'electron',
@ -41,6 +42,10 @@ async function deleteDraft (releaseId, targetRepo) {
}
async function deleteTag (tag, targetRepo) {
const octokit = new Octokit({
authStrategy: createGitHubTokenStrategy(targetRepo)
});
try {
await octokit.git.deleteRef({
owner: 'electron',