Make WordPress Core


Ignore:
Timestamp:
10/24/2023 02:12:06 PM (2 years 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.

Merges [56660] to the 6.4 branch.
See #58867.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/6.4/.github/workflows/test-and-zip-default-themes.yml

    r56792 r57000  
    203203    if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
    204204    with:
    205       calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}
     205      calling_status: ${{ needs.test-build-scripts.result == 'success' && needs.bundle-theme.result == 'success' && 'success' || ( needs.test-build-scripts.result == 'cancelled' || needs.bundle-theme.result == 'cancelled' ) && 'cancelled' || 'failure' }}
    206206    secrets:
    207207      SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
     
    222222      github.run_attempt < 2 &&
    223223      (
    224         contains( needs.*.result, 'cancelled' ) ||
    225         contains( needs.*.result, 'failure' )
     224        needs.test-build-scripts.result == 'cancelled' || needs.test-build-scripts.result == 'failure' ||
     225        needs.bundle-theme.result == 'cancelled' || needs.bundle-theme.result == 'failure'
    226226      )
    227227
Note: See TracChangeset for help on using the changeset viewer.