[ci skip] fix: Invalid workflow templates in github-script source

This commit is contained in:
greem
2026-05-05 03:15:33 +00:00
parent 0d66cfa281
commit 4e86159bce

View File

@@ -218,24 +218,11 @@ jobs:
});
const {owner, repo} = context.repo;
const run_id = ${{forgejo.event.workflow_run.id}};
const pull_head_sha = '${{forgejo.event.workflow_run.head_sha}}';
const run_id = ${{ forgejo.run_id }};
const pull_head_sha = '${{ forgejo.event.workflow_run.head_sha }}';
const issue_number = await (async () => {
const pulls = await forgejo.rest.pulls.list({owner, repo});
for await (const {data} of forgejo.paginate.iterator(pulls)) {
for (const pull of data) {
if (pull.head.sha === pull_head_sha) {
return pull.number;
}
}
}
})();
if (issue_number) {
core.info(`Using pull request ${issue_number}`);
} else {
return core.error(`No matching pull request found`);
}
const issue_number = ${{ forgejo.event.pull_request.number }};
core.info(`Using pull request ${issue_number}`);
const {data: {artifacts}} = await forgejo.rest.actions.listWorkflowRunArtifacts({owner, repo, run_id});
if (!artifacts.length) {