Make WordPress Core


Ignore:
Timestamp:
09/22/2023 02:28:01 PM (12 months ago)
Author:
desrosj
Message:

Build/Test Tools: Simplify some logic in GitHub Action workflows.

This simplifies the logic within the slack-notifications and failed-workflow steps in GitHub Action workflows to use the contains() function and object filtering.

This makes it simpler to perform the needed checks by removing the need to list out every single dependent job defined in needs.

See #58867.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/.github/workflows/php-compatibility.yml

    r56537 r56660  
    123123    if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
    124124    with:
    125       calling_status: ${{ needs.php-compatibility.result == 'success' && 'success' || needs.php-compatibility.result == 'cancelled' && 'cancelled' || 'failure' }}
     125      calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}
    126126    secrets:
    127127      SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
     
    142142      github.run_attempt < 2 &&
    143143      (
    144         needs.php-compatibility.result == 'cancelled' || needs.php-compatibility.result == 'failure'
     144        contains( needs.*.result, 'cancelled' ) ||
     145        contains( needs.*.result, 'failure' )
    145146      )
    146147
Note: See TracChangeset for help on using the changeset viewer.