build: add support for fetching github token from sudowoodo (#43886)
* build: add support for fetching github token from sudowoodo Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com> * chore: update release notes cache for tests Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com> * build: support nightlies repo correctly Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com> * build: post token 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:
parent
dddcc09185
commit
ff65b58e2c
27 changed files with 123 additions and 35 deletions
|
@ -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',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue