diff --git a/.github/scripts/comment_retry_on_pr.js b/.github/scripts/comment_retry_on_pr.js index 28d0b997bb93f..b6e5249b5ef0f 100644 --- a/.github/scripts/comment_retry_on_pr.js +++ b/.github/scripts/comment_retry_on_pr.js @@ -33,24 +33,21 @@ module.exports = async ({ github, context, core }) => { function isRetryableError(errorMessage) { if (!errorMessage) return false; - // Only check for the specific self-hosted runner communication error - return errorMessage.includes('The self-hosted runner lost communication with the server.'); + return errorMessage.includes('The self-hosted runner lost communication with the server.') || + errorMessage.includes('The operation was canceled.'); } - // Count retryable jobs let retryableJobsCount = 0; let analyzedJobs = []; for (const job of failedJobs) { try { - // Get job details to access check_run_url const { data: jobDetails } = await github.rest.actions.getJobForWorkflowRun({ owner: context.repo.owner, repo: context.repo.repo, job_id: job.id }); - // Get job annotations const { data: annotations } = await github.rest.checks.listAnnotations({ owner: context.repo.owner, repo: context.repo.repo, diff --git a/.github/scripts/retry_failed_jobs.js b/.github/scripts/retry_failed_jobs.js index af8b185a5bea7..2e1aac2385230 100644 --- a/.github/scripts/retry_failed_jobs.js +++ b/.github/scripts/retry_failed_jobs.js @@ -31,7 +31,8 @@ module.exports = async ({ github, context, core }) => { function isRetryableError(errorMessage) { if (!errorMessage) return false; - return errorMessage.includes('The self-hosted runner lost communication with the server.'); + return errorMessage.includes('The self-hosted runner lost communication with the server.') || + errorMessage.includes('The operation was canceled.'); } const jobsToRetry = []; diff --git a/.github/workflows/retry.yml b/.github/workflows/retry.yml index dd4df1fddce22..7dba265a99077 100644 --- a/.github/workflows/retry.yml +++ b/.github/workflows/retry.yml @@ -3,7 +3,7 @@ name: Retry Failed Workflow on: workflow_run: workflows: - - "dev.yml" + - Dev types: - completed