🐛 fix(ci): 修复草稿发布分页结果解析 [skip ci]

- 直接读取 Release workflow 与 release 列表响应
- 避免 paginate 映射回调产生空元素导致校验异常
- 保持目标提交和完整资产校验不变
This commit is contained in:
Syngnat
2026-07-19 01:06:47 +08:00
parent b6cfeccfe4
commit 3e9335d6ad

View File

@@ -56,18 +56,15 @@ jobs:
commitSha = annotatedTag.data.object.sha;
}
const runs = await github.paginate(
github.rest.actions.listWorkflowRuns,
{
owner,
repo,
workflow_id: 'release.yml',
event: 'push',
branch: tag,
per_page: 100,
},
(response) => response.data.workflow_runs,
);
const workflowRuns = await github.rest.actions.listWorkflowRuns({
owner,
repo,
workflow_id: 'release.yml',
event: 'push',
branch: tag,
per_page: 100,
});
const runs = workflowRuns.data.workflow_runs;
const successfulRun = runs.find((run) => (
run.head_sha === commitSha
&& run.status === 'completed'
@@ -78,11 +75,12 @@ jobs:
return;
}
const releases = await github.paginate(
github.rest.repos.listReleases,
{ owner, repo, per_page: 100 },
(response) => response.data,
);
const releaseList = await github.rest.repos.listReleases({
owner,
repo,
per_page: 100,
});
const releases = releaseList.data;
const release = releases.find((item) => item.tag_name === tag);
if (!release) {
core.setFailed(`Draft release not found for ${tag}`);