26 包 monorepo(TS 全源码): - snowcat-core: NT 内核 API 封装 + listener(含 9.9.37 六回调适配)+ Packet 发包 - snowcat-onebot: OneBot v11 全动作 + MCP Streamable HTTP 适配器 + 稳定线 - snowcat-webui-frontend/backend: 雪猫控制台(React+HeroUI) - snowcat-shell: 单文件 bundle 出口(vite inlineDynamicImports) - snowcat-native: napi2native / MoeHoo / ffmpeg / pty 运行时 - 56 项 SnowLuma 独门动作移植(qzone 全家桶/群相册/装扮/闪照/收藏) - 工具件: 解包器/启动器/便携制作器/doctor GitHub 关联已全量指向 DandanLLab/SnowCatQQ
37 lines
1.0 KiB
TypeScript
37 lines
1.0 KiB
TypeScript
/**
|
|
* PR Build - 更新构建中状态评论
|
|
*
|
|
* 环境变量:
|
|
* - GITHUB_TOKEN: GitHub API Token
|
|
* - PR_NUMBER: PR 编号
|
|
* - PR_SHA: PR 提交 SHA
|
|
*/
|
|
|
|
import { GitHubAPI, getEnv, getRepository } from './lib/github.ts';
|
|
import { generateBuildingComment, COMMENT_MARKER } from './lib/comment.ts';
|
|
|
|
const BUILD_TARGETS = ['NapCat.Framework', 'NapCat.Shell'];
|
|
|
|
async function main (): Promise<void> {
|
|
console.log('🔨 Updating building status comment\n');
|
|
|
|
const token = getEnv('GITHUB_TOKEN', true);
|
|
const prNumber = parseInt(getEnv('PR_NUMBER', true), 10);
|
|
const prSha = getEnv('PR_SHA', true);
|
|
const { owner, repo } = getRepository();
|
|
|
|
console.log(`PR: #${prNumber}`);
|
|
console.log(`SHA: ${prSha}`);
|
|
console.log(`Repo: ${owner}/${repo}\n`);
|
|
|
|
const github = new GitHubAPI(token);
|
|
const comment = generateBuildingComment(prSha, BUILD_TARGETS);
|
|
|
|
await github.createOrUpdateComment(owner, repo, prNumber, comment, COMMENT_MARKER);
|
|
}
|
|
|
|
main().catch((error) => {
|
|
console.error('❌ Error:', error);
|
|
process.exit(1);
|
|
});
|