Skip to content

Commit 3c899cc

Browse files
authored
fix: fix actions of main (#1825)
1 parent 5e38cf7 commit 3c899cc

File tree

2 files changed

+13
-27
lines changed

2 files changed

+13
-27
lines changed

src/utilities/fetch-package-repos.mjs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ import path from 'path';
33
import { mkdirp } from 'mkdirp';
44
import { promisify } from 'util';
55
import _ from 'lodash';
6+
import { Octokit as GithubAPI } from '@octokit/rest';
7+
import { createActionAuth } from '@octokit/auth-action';
68
import { excludedLoaders, excludedPlugins } from './constants.mjs';
79
import { fileURLToPath } from 'url';
8-
import api from './githubAPI.mjs';
910

1011
const __filename = fileURLToPath(import.meta.url);
1112
const __dirname = path.dirname(__filename);
@@ -33,6 +34,17 @@ const fetch = {
3334
};
3435

3536
async 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,

src/utilities/githubAPI.mjs

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)