diff --git a/github.js b/github.js index f21a348..1a63d09 100644 --- a/github.js +++ b/github.js @@ -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); diff --git a/hn-repo.js b/hn-repo.js new file mode 100644 index 0000000..f3dc9ec --- /dev/null +++ b/hn-repo.js @@ -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, +};