build: remove deprecated octokit auth calls (#18205)

This commit is contained in:
Shelley Vohr 2019-05-07 18:48:40 -07:00 коммит произвёл GitHub
Родитель e63f527e76
Коммит 6770a8c64a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 19 добавлений и 23 удалений

Просмотреть файл

@ -1,6 +1,8 @@
if (!process.env.CI) require('dotenv-safe').load()
const octokit = require('@octokit/rest')()
const octokit = require('@octokit/rest')({
auth: process.env.ELECTRON_GITHUB_TOKEN
})
if (process.argv.length < 3) {
console.log('Usage: find-release version')
@ -10,8 +12,6 @@ if (process.argv.length < 3) {
const version = process.argv[2]
async function findRelease () {
octokit.authenticate({ type: 'token', token: process.env.ELECTRON_GITHUB_TOKEN })
const releases = await octokit.repos.listReleases({
owner: 'electron',
repo: version.indexOf('nightly') > 0 ? 'nightlies' : 'electron'

Просмотреть файл

@ -5,7 +5,9 @@ const args = require('minimist')(process.argv.slice(2), {
boolean: ['automaticRelease', 'notesOnly', 'stable']
})
const ciReleaseBuild = require('./ci-release-build')
const octokit = require('@octokit/rest')()
const octokit = require('@octokit/rest')({
auth: process.env.ELECTRON_GITHUB_TOKEN
})
const { execSync } = require('child_process')
const { GitProcess } = require('dugite')
@ -27,8 +29,6 @@ if (!bumpType && !args.notesOnly) {
}
const gitDir = path.resolve(__dirname, '..')
octokit.authenticate({ type: 'token', token: process.env.ELECTRON_GITHUB_TOKEN })
async function getNewVersion (dryRun) {
if (!dryRun) {
console.log(`Bumping for new "${bumpType}" version.`)

Просмотреть файл

@ -12,16 +12,13 @@ const { execSync } = require('child_process')
const { GitProcess } = require('dugite')
const { getCurrentBranch } = require('./lib/utils.js')
const octokit = require('@octokit/rest')()
const path = require('path')
const gitDir = path.resolve(__dirname, '..')
octokit.authenticate({
type: 'token',
token: process.env.ELECTRON_GITHUB_TOKEN
const octokit = require('@octokit/rest')({
auth: process.env.ELECTRON_GITHUB_TOKEN
})
const path = require('path')
const gitDir = path.resolve(__dirname, '..')
function getLastBumpCommit (tag) {
const data = execSync(`git log -n1 --grep "Bump ${tag}" --format='format:{"hash": "%H", "message": "%s"}'`).toString()
return JSON.parse(data)

Просмотреть файл

@ -6,7 +6,9 @@ const os = require('os')
const path = require('path')
const { GitProcess } = require('dugite')
const octokit = require('@octokit/rest')()
const octokit = require('@octokit/rest')({
auth: process.env.ELECTRON_GITHUB_TOKEN
})
const semver = require('semver')
const MAX_FAIL_COUNT = 3
@ -17,8 +19,6 @@ const NO_NOTES = 'No notes'
const FOLLOW_REPOS = [ 'electron/electron', 'electron/libchromiumcontent', 'electron/node' ]
const gitDir = path.resolve(__dirname, '..', '..')
octokit.authenticate({ type: 'token', token: process.env.ELECTRON_GITHUB_TOKEN })
const breakTypes = new Set(['breaking-change'])
const docTypes = new Set(['doc', 'docs'])
const featTypes = new Set(['feat', 'feature'])

Просмотреть файл

@ -24,10 +24,8 @@ const sumchecker = require('sumchecker')
const temp = require('temp').track()
const { URL } = require('url')
const octokit = require('@octokit/rest')()
octokit.authenticate({
type: 'token',
token: process.env.ELECTRON_GITHUB_TOKEN
const octokit = require('@octokit/rest')({
auth: process.env.ELECTRON_GITHUB_TOKEN
})
const targetRepo = pkgVersion.indexOf('nightly') > 0 ? 'nightlies' : 'electron'

Просмотреть файл

@ -2,8 +2,9 @@ if (!process.env.CI) require('dotenv-safe').load()
const fs = require('fs')
const octokit = require('@octokit/rest')()
octokit.authenticate({ type: 'token', token: process.env.ELECTRON_GITHUB_TOKEN })
const octokit = require('@octokit/rest')({
auth: process.env.ELECTRON_GITHUB_TOKEN
})
if (process.argv.length < 6) {
console.log('Usage: upload-to-github filePath fileName releaseId')