Build/Test Tools: Correctly detect the first workflow run for a branch or tag.

When trying to determine the outcome of the previous run for a GitHub Action workflow, the current run is included in the list fetched from the GitHub API.

This adjusts the logic checking for the previous run to account for that and fixes notifications for the first workflow runs of a new branch or tag.

See #55652.

git-svn-id: https://develop.svn.wordpress.org/trunk@53735 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers
2022-07-20 17:41:02 +00:00
parent a93aae282c
commit b2b8a0c3d2
+1 -1
View File
@@ -84,7 +84,7 @@ jobs:
});
// This is the first workflow run for this branch or tag.
if ( previous_runs.data.workflow_runs.length == 0 ) {
if ( previous_runs.data.workflow_runs.length < 2 ) {
return 'none';
}