mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-29 01:34:27 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@56660 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
5
.github/workflows/javascript-tests.yml
vendored
5
.github/workflows/javascript-tests.yml
vendored
@@ -97,7 +97,7 @@ jobs:
|
||||
needs: [ test-js ]
|
||||
if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }}
|
||||
with:
|
||||
calling_status: ${{ needs.test-js.result == 'success' && 'success' || needs.test-js.result == 'cancelled' && 'cancelled' || 'failure' }}
|
||||
calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }}
|
||||
secrets:
|
||||
SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }}
|
||||
SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }}
|
||||
@@ -116,7 +116,8 @@ jobs:
|
||||
github.event_name != 'pull_request' &&
|
||||
github.run_attempt < 2 &&
|
||||
(
|
||||
needs.test-js.result == 'cancelled' || needs.test-js.result == 'failure'
|
||||
contains( needs.*.result, 'cancelled' ) ||
|
||||
contains( needs.*.result, 'failure' )
|
||||
)
|
||||
|
||||
steps:
|
||||
|
||||
Reference in New Issue
Block a user