Compare commits
4 Commits
c222a007c1
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 5f7ed89634 | |||
| dcc23e7e43 | |||
| e291dbf9ad | |||
| 5a8176d1bf |
2
.cnb.yml
2
.cnb.yml
@@ -12,7 +12,7 @@
|
||||
script: |
|
||||
bun i
|
||||
bun run src/cli.ts repo sync
|
||||
timeout: 20s
|
||||
timeout: 120s
|
||||
|
||||
main:
|
||||
"crontab: 0 11,23 * * *": !reference [.crontab-job]
|
||||
|
||||
@@ -4,18 +4,19 @@
|
||||
"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)",
|
||||
"license": "MIT",
|
||||
"packageManager": "pnpm@10.32.1",
|
||||
"packageManager": "pnpm@10.33.0",
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"@kevisual/cnb": "^0.0.56",
|
||||
"@kevisual/cnb": "^0.0.62",
|
||||
"@kevisual/context": "^0.0.8",
|
||||
"@kevisual/gitea": "^0.0.6",
|
||||
"@kevisual/router": "^0.1.6",
|
||||
"@kevisual/router": "^0.2.4",
|
||||
"dayjs": "^1.11.20"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user