手动写 私有仓库, 接口只能获取到公有仓库

master
Lei OT 2 years ago
parent fb5c899eb0
commit 5817a46d4d

@ -3,6 +3,7 @@ const { throttling } = require("@octokit/plugin-throttling");
const { retry } = require("@octokit/plugin-retry");
const { Octokit } = require("@octokit/rest");
const debug = require("debug")("action-dashboard:github");
const { privateRepo } = require("./hn-repo");
class GitHub {
constructor(
@ -64,8 +65,7 @@ class GitHub {
async listRepos() {
try {
const repos = await this._octokit.paginate(this._listRepos, this._owner);
const allRepos = ['data.chinahighlights.com', 'information-system', 'chinahighlights.com', 'asiahighlights.com','globalhighlights.com','trainspread.com'];
return allRepos.map(ele => ({ name: ele, owner: {login: 'hainatravel'}}));
return [].concat(repos, privateRepo);
return repos;
} catch (e) {
console.error("Error getting repos", e);

@ -0,0 +1,6 @@
const repoNames = ['data.chinahighlights.com', 'information-system', 'chinahighlights.com', 'asiahighlights.com', 'globalhighlights.com', 'trainspread.com', 'GHHub', 'dashboard'];
const repoRet = repoNames.map((ele) => ({ name: ele, owner: { login: 'hainatravel' } }));
module.exports = {
privateRepo: repoRet,
};
Loading…
Cancel
Save