Make WordPress Core

Changeset 56404


Ignore:
Timestamp:
08/17/2023 04:59:49 PM (20 months ago)
Author:
desrosj
Message:

Build/Test Tools: Don’t send a Slack notice when a workflow fails once.

[53947] introduced a callable workflow that allowed a workflow run to be retried automatic. By default all workflows are retried once.

Since a run is not considered “failed” until after the automatic retry, the first Slack message is unnecessary and can cause a lot of noise when there are network hiccups.

This alters the logic to skip a failure notice in Slack until the second failure.

See #58867.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/.github/workflows/slack-notifications.yml

    r56388 r56404  
    7272            });
    7373
     74            // All workflows will restart once when a failure is encountered. Don't notify Slack on the first failure.
     75            if ( '${{ inputs.calling_status }}' == 'failure' && workflow_run.data.run_attempt == 1 ) {
     76              return 'first-failure';
     77            }
     78
    7479            // When a workflow has been restarted to fix a failure, check the previous run attempt.
    7580            if ( workflow_run.data.run_attempt > 1 ) {
     
    158163    timeout-minutes: 5
    159164    needs: [ prepare ]
    160     if: ${{ inputs.calling_status == 'failure' || failure() }}
     165    if: ${{ ( inputs.calling_status == 'failure' || failure() ) && steps.previous-attempt-result.outputs.result != 'first-failure' }}
    161166
    162167    steps:
Note: See TracChangeset for help on using the changeset viewer.