依功能分組為 logger/validate/config/gitea-client/releases/tags 模組, entrypoint.sh 改為呼叫 node /app/index.js,Dockerfile 改用 node:20-alpine 基底。 對外行為(清理舊 release 與未指定 release 的 tag)維持不變。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
23 lines
602 B
JavaScript
23 lines
602 B
JavaScript
// 進入點:載入設定、建立 Gitea 客戶端,依序清理舊成品與孤立 tag。
|
|
|
|
import { loadConfig } from './config.js'
|
|
import { GiteaClient } from './gitea-client.js'
|
|
import { cleanupReleases } from './releases.js'
|
|
import { cleanupOrphanTags } from './tags.js'
|
|
import { separator, fail } from './logger.js'
|
|
|
|
async function main() {
|
|
const config = loadConfig()
|
|
const client = new GiteaClient({ token: config.token })
|
|
|
|
await cleanupReleases(client, config)
|
|
await cleanupOrphanTags(client, config)
|
|
|
|
separator()
|
|
}
|
|
|
|
main().catch((error) => {
|
|
fail(error.message)
|
|
process.exit(1)
|
|
})
|