Make WordPress Core


Ignore:
Timestamp:
04/05/2022 01:18:53 PM (3 years ago)
Author:
desrosj
Message:

Build/Test Tools: Prevent error when workflows run for new branches and tags.

This fixes a JavaScript error in the Slack notifications workflow. This was causing the first workflow run for each workflow in a new branch or tag to be reported as a failure, even if the important parts of the workflow succeed.

When running a workflow for the first time, a default of failure is now used for the previous outcome. This will trigger a success notification to be sent to report successful branching/tagging.

Props davidbaumwald.
Fixes #54742.

File:
1 edited

Legend:

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

    r52233 r53077  
    9595              page: 2,
    9696            });
    97             return previous_runs.data.workflow_runs[0].conclusion;
     97
     98            if ( previous_runs.data.total_count > 0 ) {
     99              return previous_runs.data.workflow_runs[0].conclusion;
     100            } else {
     101              // Use failure so all first time runs for a branch or tag are reported to Slack.
     102              return 'failure';
     103            }
    98104
    99105      - name: Store previous conclusion as an output
Note: See TracChangeset for help on using the changeset viewer.