Make WordPress Core


Ignore:
Timestamp:
09/22/2023 02:28:01 PM (7 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/javascript-tests.yml

    r56538 r56660  
    9898    if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
    9999    with:
    100       calling_status: ${{ needs.test-js.result == 'success' && 'success' || needs.test-js.result == 'cancelled' && 'cancelled' || 'failure' }}
     100      calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}
    101101    secrets:
    102102      SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
     
    117117      github.run_attempt < 2 &&
    118118      (
    119         needs.test-js.result == 'cancelled' || needs.test-js.result == 'failure'
     119        contains( needs.*.result, 'cancelled' ) ||
     120        contains( needs.*.result, 'failure' )
    120121      )
    121122
Note: See TracChangeset for help on using the changeset viewer.