Skip to content

Commit 86bb5c8

Browse files
committed
Create annotations to better explain restarter decision
1 parent 2b1dfd2 commit 86bb5c8

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

.github/workflows/restart-preempted-libcxx-jobs.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ jobs:
3535
const failure_regex = /Process completed with exit code 1./
3636
const preemption_regex = /The runner has received a shutdown signal/
3737
38+
const wf_run = context.payload.workflow_run
39+
core.notice(`Running on "${wf_run.display_title}" by @${wf_run.actor.login} (event: ${wf_run.event})\nWorkflow run URL: ${wf_run.html_url}`)
40+
3841
console.log('Listing check runs for suite')
3942
const check_suites = await github.rest.checks.listForSuite({
4043
owner: context.repo.owner,
@@ -83,19 +86,19 @@ jobs:
8386
if (failure_match != null) {
8487
// We only want to restart the workflow if all of the failures were due to preemption.
8588
// We don't want to restart the workflow if there were other failures.
86-
console.log('Choosing not to rerun workflow because we found a non-preemption failure');
87-
console.log('Failure message: ' + annotation.message);
89+
core.notice('Choosing not to rerun workflow because we found a non-preemption failure' +
90+
'Failure message: "' + annotation.message + '"');
8891
return;
8992
}
9093
}
9194
}
9295
9396
if (!has_preempted_job) {
94-
console.log('No preempted jobs found. Not restarting workflow.');
97+
core.notice('No preempted jobs found. Not restarting workflow.');
9598
return;
9699
}
97100
98-
console.log("Restarted workflow: " + context.payload.workflow_run.id);
101+
core.notice("Restarted workflow: " + context.payload.workflow_run.id);
99102
await github.rest.actions.reRunWorkflowFailedJobs({
100103
owner: context.repo.owner,
101104
repo: context.repo.repo,

0 commit comments

Comments
 (0)