From ce8aed4698117fd0f8c362825e62d01586c8799d Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Wed, 11 Oct 2023 12:15:18 +0000 Subject: [PATCH] =?UTF-8?q?Build/Test=20Tools:=20Don=E2=80=99t=20send=20Sl?= =?UTF-8?q?ack=20notification=20for=20workflow=20retries.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [56780] changed Slack failure notifications to not send a failure notification during the first run of a workflow. Because workflows automatically restart once, a failure during the first run can be ignored. This adjusts the workflow to also not send a “fixed” notification when the second run of a workflow succeeds after a failure. Because the original failure is no longer reported, these notifications are unnecessary. See #58867. git-svn-id: https://develop.svn.wordpress.org/trunk@56827 602fd350-edb4-49c9-b593-d223f7449a82 --- .github/workflows/slack-notifications.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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,