Compare commits

...

2 Commits

3 changed files with 5 additions and 3 deletions

View File

@@ -4,7 +4,8 @@
"description": "",
"main": "index.js",
"scripts": {
"cli": "bun run src/cli.ts "
"cli": "bun run src/cli.ts ",
"sync": "bun run src/cli.ts repo sync"
},
"keywords": [],
"author": "abearxiong <xiongxiao@xiongxiao.me> (https://www.xiongxiao.me)",

View File

@@ -36,8 +36,8 @@ app.route({
updatedAt: dayjs(item.updated_at).format('YYYY-MM-DD HH:mm:ss'),
}))
const repositories = _todayList.filter(item => item.topics.includes('gitea'));
if (_todayList.length > 5) {
app.run({ path: 'cnb', key: 'report', payload: { repoList: _todayList } });
if (_todayList.length >= 1) {
await app.run({ path: 'cnb', key: 'report', payload: { repoList: _todayList } });
}
ctx.body = {
list: repositories

View File

@@ -73,6 +73,7 @@ const sync = async (repo: Repo) => {
execSync(`git pull origin main`, { cwd });
// 推送到gitea
execSync(`git push gitea main`, { cwd });
console.log(`同步推送 ${repo.path} 成功`);
} catch (err) {
console.error(`同步推送 ${repo.path} 失败`, repo);
}