diff --git a/.github/workflows/slack-notifications.yml b/.github/workflows/slack-notifications.yml index b3d8ef663f..f9b0f04723 100644 --- a/.github/workflows/slack-notifications.yml +++ b/.github/workflows/slack-notifications.yml @@ -75,8 +75,10 @@ jobs: return 'first-failure'; } - // When a workflow has been restarted to fix a failure, check the previous run attempt. - if ( workflow_run.data.run_attempt > 1 ) { + // When a workflow has been restarted, check the previous run attempt. Because workflows are automatically + // restarted once and a failure on the first run is not reported, failures on the second run should not be + // considered. + if ( workflow_run.data.run_attempt > 2 ) { const previous_run = await github.rest.actions.getWorkflowRunAttempt({ owner: context.repo.owner, repo: context.repo.repo,