From 0d844c1c345a8b851aeb3cef0db65f0f4d29de70 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Wed, 4 Oct 2023 19:12:15 +0000 Subject: [PATCH] =?UTF-8?q?Build/Test=20Tools:=20Don=E2=80=99t=20send=20a?= =?UTF-8?q?=20Slack=20notice=20for=20a=20workflow=E2=80=99s=20first=20fail?= =?UTF-8?q?ure.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After [53947], all workflows will automatically be restarted once in an attempt to rule out reasons for failures, such as timeouts or network hiccups. Second attempt at [56404], which was previously reverted in [56407]. See #58867. git-svn-id: https://develop.svn.wordpress.org/trunk@56780 602fd350-edb4-49c9-b593-d223f7449a82 --- .github/workflows/slack-notifications.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/slack-notifications.yml b/.github/workflows/slack-notifications.yml index dbab11ed01c8e..b3d8ef663f2ae 100644 --- a/.github/workflows/slack-notifications.yml +++ b/.github/workflows/slack-notifications.yml @@ -71,6 +71,10 @@ jobs: run_id: ${{ github.run_id }}, }); + if ( '${{ inputs.calling_status }}' == 'failure' && workflow_run.data.run_attempt == 1 ) { + 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 ) { const previous_run = await github.rest.actions.getWorkflowRunAttempt({ @@ -157,7 +161,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 5 needs: [ prepare ] - if: ${{ inputs.calling_status == 'failure' || failure() }} + if: ${{ needs.prepare.outputs.previous_conclusion != 'first-failure' && inputs.calling_status == 'failure' || failure() }} steps: - name: Post failure notifications to Slack