更新上报仓库信息表格,添加更新时间列
This commit is contained in:
@@ -8,7 +8,8 @@ const repoSchema = z.object({
|
|||||||
web_url: z.string().describe('仓库链接'),
|
web_url: z.string().describe('仓库链接'),
|
||||||
description: z.string().describe('仓库描述'),
|
description: z.string().describe('仓库描述'),
|
||||||
topics: z.array(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('仓库信息');
|
}).describe('仓库信息');
|
||||||
export type Repo = z.infer<typeof repoSchema>;
|
export type Repo = z.infer<typeof repoSchema>;
|
||||||
|
|
||||||
@@ -30,6 +31,7 @@ app.route({
|
|||||||
web_url: item.web_url,
|
web_url: item.web_url,
|
||||||
description: item.description,
|
description: item.description,
|
||||||
topics: item.topics ? item.topics.split(',').filter(Boolean) : [],
|
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'));
|
const repositories = _todayList.filter(item => item.topics.includes('gitea'));
|
||||||
if (_todayList.length > 5) {
|
if (_todayList.length > 5) {
|
||||||
@@ -54,11 +56,11 @@ app.route({
|
|||||||
// 处理上报的仓库信息
|
// 处理上报的仓库信息
|
||||||
await closeOldReports();
|
await closeOldReports();
|
||||||
if (Array.isArray(repoList)) {
|
if (Array.isArray(repoList)) {
|
||||||
let infoTable = '| 仓库路径 | 仓库链接 | 仓库描述 | 仓库标签 |\n';
|
let infoTable = '| 仓库路径 | 仓库链接 | 仓库描述 | 仓库标签 | 更新时间 |\n';
|
||||||
infoTable += '| --- | --- | --- | --- |\n';
|
infoTable += '| --- | --- | --- | --- | --- |\n';
|
||||||
repoList.forEach(repo => {
|
repoList.forEach(repo => {
|
||||||
const topics = repo.topics.join(', ');
|
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);
|
console.log('上报的仓库信息表格:\n', infoTable);
|
||||||
cnb.issue.createIssue('kevisual/kevisual', {
|
cnb.issue.createIssue('kevisual/kevisual', {
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ app.route({
|
|||||||
const giteaRepo = await gitea.repo.getRepo(owner, repo);
|
const giteaRepo = await gitea.repo.getRepo(owner, repo);
|
||||||
const giteaUsername = 'oauth2';
|
const giteaUsername = 'oauth2';
|
||||||
const giteaPassword = useKey('GITEA_TOKEN');
|
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) {
|
if (giteaRepo.code === 200) {
|
||||||
// 已经存在了
|
// 已经存在了
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user