File tree Expand file tree Collapse file tree 2 files changed +13
-27
lines changed Expand file tree Collapse file tree 2 files changed +13
-27
lines changed Original file line number Diff line number Diff line change @@ -3,9 +3,10 @@ import path from 'path';
33import { mkdirp } from 'mkdirp' ;
44import { promisify } from 'util' ;
55import _ from 'lodash' ;
6+ import { Octokit as GithubAPI } from '@octokit/rest' ;
7+ import { createActionAuth } from '@octokit/auth-action' ;
68import { excludedLoaders , excludedPlugins } from './constants.mjs' ;
79import { fileURLToPath } from 'url' ;
8- import api from './githubAPI.mjs' ;
910
1011const __filename = fileURLToPath ( import . meta. url ) ;
1112const __dirname = path . dirname ( __filename ) ;
@@ -33,6 +34,17 @@ const fetch = {
3334} ;
3435
3536async function main ( ) {
37+ let api ;
38+ if ( process . env . CI && process . env . CI === true ) {
39+ const auth = createActionAuth ( ) ;
40+ const authentication = await auth ( ) ;
41+ api = new GithubAPI ( {
42+ auth : authentication ,
43+ } ) ;
44+ } else {
45+ api = new GithubAPI ( ) ;
46+ }
47+
3648 async function paginate ( org ) {
3749 const data = await api . paginate ( 'GET /orgs/:org/repos' , {
3850 org : org ,
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments