mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Build/Test Tools: Correctly confirm the previous workflow run was triggered by a push event.
This fixes the code added in [53466] to look at the correct workflow object when determining the outcome of the previous workflow run. See #55652. git-svn-id: https://develop.svn.wordpress.org/trunk@53468 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
50fab6f6b4
commit
60e80c1fd9
17
.github/workflows/slack-notifications.yml
vendored
17
.github/workflows/slack-notifications.yml
vendored
@ -114,13 +114,18 @@ jobs:
|
||||
|
||||
// Find the workflow run for the commit that immediately preceded this one.
|
||||
for ( let i = 0; i < previous_runs.data.workflow_runs.length; i++ ) {
|
||||
// Protects against false notifications when contributors use similar head_ref names.
|
||||
if ( previous_runs.data.workflow_runs[ i ].event !== "push" ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( previous_runs.data.workflow_runs[ i ].run_number == workflow_run.data.run_number ) {
|
||||
return previous_runs.data.workflow_runs[ i + 1 ].conclusion;
|
||||
let next_index = i;
|
||||
do {
|
||||
next_index++;
|
||||
|
||||
// Protects against a false notification when contributors use the trunk branch as the pull request head_ref.
|
||||
if ( previous_runs.data.workflow_runs[ next_index ].event !== "push" ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
return previous_runs.data.workflow_runs[ next_index ].conclusion;
|
||||
} while ( next_index < previous_runs.data.workflow_runs.length );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user