更新上报仓库信息表格,添加更新时间列

This commit is contained in:
xiongxiao
2026-03-18 01:43:34 +08:00
committed by cnb
parent 62b70712aa
commit 998783ea4e
2 changed files with 8 additions and 5 deletions

View File

@@ -8,7 +8,8 @@ const repoSchema = z.object({
web_url: z.string().describe('仓库链接'),
description: z.string().describe('仓库描述'),
topics: z.array(z.string()).describe('仓库标签'),
giteaUrl: z.string().optional().describe('gitea仓库链接')
giteaUrl: z.string().optional().describe('gitea仓库链接'),
updatedAt: z.string().describe('仓库更新时间'),
}).describe('仓库信息');
export type Repo = z.infer<typeof repoSchema>;
@@ -30,6 +31,7 @@ app.route({
web_url: item.web_url,
description: item.description,
topics: item.topics ? item.topics.split(',').filter(Boolean) : [],
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) {
@@ -54,11 +56,11 @@ app.route({
// 处理上报的仓库信息
await closeOldReports();
if (Array.isArray(repoList)) {
let infoTable = '| 仓库路径 | 仓库链接 | 仓库描述 | 仓库标签 |\n';
infoTable += '| --- | --- | --- | --- |\n';
let infoTable = '| 仓库路径 | 仓库链接 | 仓库描述 | 仓库标签 | 更新时间 |\n';
infoTable += '| --- | --- | --- | --- | --- |\n';
repoList.forEach(repo => {
const topics = repo.topics.join(', ');
infoTable += `| ${repo.path} | [链接](${repo.web_url}) | ${repo.description} | ${topics} |\n`;
infoTable += `| ${repo.path} | [链接](${repo.web_url}) | ${repo.description} | ${topics} | ${repo.updatedAt} |\n`;
});
console.log('上报的仓库信息表格:\n', infoTable);
cnb.issue.createIssue('kevisual/kevisual', {

View File

@@ -20,7 +20,8 @@ app.route({
const giteaRepo = await gitea.repo.getRepo(owner, repo);
const giteaUsername = 'oauth2';
const giteaPassword = useKey('GITEA_TOKEN');
item.giteaUrl = `https://${giteaUsername}:${giteaPassword}@git.xiongxiao.me/${owner}/${repo}.git`;
const giteaHost = useKey('GITEA_HOST') || 'git.xiongxiao.me';
item.giteaUrl = `https://${giteaUsername}:${giteaPassword}@${giteaHost}/${owner}/${repo}.git`;
if (giteaRepo.code === 200) {
// 已经存在了
} else {