Make WordPress Core


Ignore:
Timestamp:
11/03/2021 02:54:20 PM (4 years ago)
Author:
desrosj
Message:

Build/Test Tools: Pass workflow outcome to Slack Notifications.

When using a workflow as a callable workflow, the job status check functions do not take the called workflow into account. This has caused some failures to be incorrectly reported as successful.

This adds an input to the Slack notifications workflow for when the workflow_call event is used.

See #53363.

File:
1 edited

Legend:

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

    r51954 r52002  
    2424
    2525  workflow_call:
     26    inputs:
     27      calling_status:
     28        description: 'The status of the calling workflow'
     29        type: string
     30        required: true
    2631    secrets:
    2732      SLACK_GHA_SUCCESS_WEBHOOK:
     
    126131    runs-on: ubuntu-latest
    127132    needs: [ prepare ]
    128     if: ${{ github.event_name == 'push' && failure() || github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'failure' }}
     133    if: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'failure' || inputs.calling_status == 'failure' || failure() }}
    129134
    130135    steps:
     
    141146    runs-on: ubuntu-latest
    142147    needs: [ prepare ]
    143     if: ${{ needs.prepare.outputs.previous_conclusion == 'failure' && ( github.event_name == 'push' && success() || github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success' ) }}
     148    if: ${{ needs.prepare.outputs.previous_conclusion == 'failure' && ( github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success' || inputs.calling_status == 'success' ) && success() }}
    144149
    145150    steps:
     
    156161    runs-on: ubuntu-latest
    157162    needs: [ prepare ]
    158     if: ${{ github.event_name == 'push' && success() || github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success' }}
     163    if: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success' || inputs.calling_status == 'success' && success() }}
    159164
    160165    steps:
     
    171176    runs-on: ubuntu-latest
    172177    needs: [ prepare ]
    173     if: ${{ github.event_name == 'push' && cancelled() || github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'cancelled' }}
     178    if: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'cancelled' || inputs.calling_status == 'cancelled' || cancelled() }}
    174179
    175180    steps:
Note: See TracChangeset for help on using the changeset viewer.