Make WordPress Core


Ignore:
Timestamp:
06/20/2022 02:58:45 PM (2 years ago)
Author:
desrosj
Message:

Build/Test Tools: Adjust Slack notifications logic to account for expected non push events.

This adjusts the logic used to determine the outcome of the previous workflow run of the current one to account for schedule and workflow_dispatch events.

In the current state, only workflows triggered by push events are examined. This is causing failures when trying to post Slack notifications for the Test Coverage workflow, and inconsistent results for workflow_dispatch events when testing older branches on a schedule.

Follow up to [53466] and [53468].
See #55652.

File:
1 edited

Legend:

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

    r53468 r53534  
    113113            }
    114114
     115            const expected_events = new Array( 'push', 'schedule', 'workflow_dispatch' );
     116
    115117            // Find the workflow run for the commit that immediately preceded this one.
    116118            for ( let i = 0; i < previous_runs.data.workflow_runs.length; i++ ) {
     
    121123
    122124                  // Protects against a false notification when contributors use the trunk branch as the pull request head_ref.
    123                   if ( previous_runs.data.workflow_runs[ next_index ].event !== "push" ) {
     125                  if ( expected_events.indexOf( previous_runs.data.workflow_runs[ next_index ].event ) == -1 ) {
    124126                    continue;
    125127                  }
Note: See TracChangeset for help on using the changeset viewer.