Skip to content

Commit

Permalink
fix: fix actions of main (#1825)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yucohny authored Nov 17, 2023
1 parent 5e38cf7 commit 3c899cc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 27 deletions.
14 changes: 13 additions & 1 deletion src/utilities/fetch-package-repos.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import path from 'path';
import { mkdirp } from 'mkdirp';
import { promisify } from 'util';
import _ from 'lodash';
import { Octokit as GithubAPI } from '@octokit/rest';
import { createActionAuth } from '@octokit/auth-action';
import { excludedLoaders, excludedPlugins } from './constants.mjs';
import { fileURLToPath } from 'url';
import api from './githubAPI.mjs';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Expand Down Expand Up @@ -33,6 +34,17 @@ const fetch = {
};

async function main() {
let api;
if (process.env.CI && process.env.CI === true) {
const auth = createActionAuth();
const authentication = await auth();
api = new GithubAPI({
auth: authentication,
});
} else {
api = new GithubAPI();
}

async function paginate(org) {
const data = await api.paginate('GET /orgs/:org/repos', {
org: org,
Expand Down
26 changes: 0 additions & 26 deletions src/utilities/githubAPI.mjs

This file was deleted.

0 comments on commit 3c899cc

Please sign in to comment.