From b2b8a0c3d21a9b1af93b56917c1e24d26a5c4004 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Wed, 20 Jul 2022 17:41:02 +0000 Subject: [PATCH] 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 --- .github/workflows/slack-notifications.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/slack-notifications.yml b/.github/workflows/slack-notifications.yml index ddefa85244..ceb2da71ea 100644 --- a/.github/workflows/slack-notifications.yml +++ b/.github/workflows/slack-notifications.yml @@ -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'; }