Skip to content
Permalink
Browse files

build: remove deprecated octokit auth calls (#18205)

  • Loading branch information...
codebytere committed May 8, 2019
1 parent e63f527 commit 6770a8c64a6fa7ee19c37efd0411f5f08dc3181c
@@ -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 octokit = require('@octokit/rest')({
auth: process.env.ELECTRON_GITHUB_TOKEN
})

const path = require('path')
const gitDir = path.resolve(__dirname, '..')

octokit.authenticate({
type: 'token',
token: process.env.ELECTRON_GITHUB_TOKEN
})

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')

0 comments on commit 6770a8c

Please sign in to comment.
You can’t perform that action at this time.