From 5817a46d4d6df4a9122163aaeaef1dce4a9a4f96 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Thu, 31 Aug 2023 10:24:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E5=8A=A8=E5=86=99=20=E7=A7=81?= =?UTF-8?q?=E6=9C=89=E4=BB=93=E5=BA=93,=20=E6=8E=A5=E5=8F=A3=E5=8F=AA?= =?UTF-8?q?=E8=83=BD=E8=8E=B7=E5=8F=96=E5=88=B0=E5=85=AC=E6=9C=89=E4=BB=93?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- github.js | 4 ++-- hn-repo.js | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 hn-repo.js 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, +};