File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4242 const repo = context.repo.repo;
4343 const headSha = context.payload.pull_request.head.sha;
4444
45- core.info(`owner: ${owner}`);
46- core.info(`repo: ${repo}`);
47- core.info(`head_sha: ${headSha}`);
48- core.info(`event action: ${context.payload.action}`);
49- core.info(`label: ${context.payload.label?.name}`);
50-
5145 const runs = await github.rest.actions.listWorkflowRunsForRepo({
5246 owner,
5347 repo,
@@ -57,20 +51,11 @@ jobs:
5751 status: 'completed',
5852 });
5953
60- core.info(`total completed runs found: ${runs.data.total_count}`);
61- for (const r of runs.data.workflow_runs) {
62- core.info(` run id=${r.id} status=${r.status} conclusion=${r.conclusion} created_at=${r.created_at}`);
63- }
64-
6554 const run = runs.data.workflow_runs[0];
6655 if (run) {
67- core.info(`triggering rerun for run id=${run.id}`);
68- await github.rest.actions.reRunWorkflow({
56+ await github.rest.actions.reRunWorkflowFailedJobs({
6957 owner,
7058 repo,
7159 run_id: run.id,
7260 });
73- core.info('rerun triggered successfully');
74- } else {
75- core.warning('no completed pull-request.yml run found for this SHA — skipping rerun');
7661 }
You can’t perform that action at this time.
0 commit comments