refactor(release-cleanup): 將清理邏輯由 bash 改寫為 Node.js #6

Closed
jiantw83 wants to merge 60 commits from refactor/nodejs-rewrite-20260626-103443 into develop
Showing only changes of commit 24bcad7141 - Show all commits
+6
View File
3
@@ -58,6 +58,12 @@ export async function cleanupReleases(client, config) {
const toDelete = selectReleasesToDelete(releases, config.keepCount)
for (const release of toDelete) {
// 防禦非預期結構(null/非物件),避免解構時拋出未捕捉例外。
if (release === null || typeof release !== 'object') {
warn('略過格式異常的成品項目')
continue
}
const { id, tag_name: tag, name } = release
// 要求 id 為正整數(Gitea release id 本即正整數);非整數一律略過,不僅依賴 URL 編碼防護。