Skip to content

Commit 0831da8

Browse files
authored
ci: fix retry on dev workflow_run (#18207)
1 parent 0b2b894 commit 0831da8

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

.github/scripts/comment_retry_on_pr.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,21 @@ module.exports = async ({ github, context, core }) => {
3333
function isRetryableError(errorMessage) {
3434
if (!errorMessage) return false;
3535

36-
// Only check for the specific self-hosted runner communication error
37-
return errorMessage.includes('The self-hosted runner lost communication with the server.');
36+
return errorMessage.includes('The self-hosted runner lost communication with the server.') ||
37+
errorMessage.includes('The operation was canceled.');
3838
}
3939

40-
// Count retryable jobs
4140
let retryableJobsCount = 0;
4241
let analyzedJobs = [];
4342

4443
for (const job of failedJobs) {
4544
try {
46-
// Get job details to access check_run_url
4745
const { data: jobDetails } = await github.rest.actions.getJobForWorkflowRun({
4846
owner: context.repo.owner,
4947
repo: context.repo.repo,
5048
job_id: job.id
5149
});
5250

53-
// Get job annotations
5451
const { data: annotations } = await github.rest.checks.listAnnotations({
5552
owner: context.repo.owner,
5653
repo: context.repo.repo,

.github/scripts/retry_failed_jobs.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ module.exports = async ({ github, context, core }) => {
3131

3232
function isRetryableError(errorMessage) {
3333
if (!errorMessage) return false;
34-
return errorMessage.includes('The self-hosted runner lost communication with the server.');
34+
return errorMessage.includes('The self-hosted runner lost communication with the server.') ||
35+
errorMessage.includes('The operation was canceled.');
3536
}
3637

3738
const jobsToRetry = [];

.github/workflows/retry.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Retry Failed Workflow
33
on:
44
workflow_run:
55
workflows:
6-
- "dev.yml"
6+
- Dev
77
types:
88
- completed
99

0 commit comments

Comments
 (0)