This is an automated email from the ASF dual-hosted git repository.

amoghdesai pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 1aa9b7af38b Fix automatic backport workflow race condition (#58705)
1aa9b7af38b is described below

commit 1aa9b7af38b52afa79d5108a04ceb5fd181682ba
Author: Amogh Desai <[email protected]>
AuthorDate: Wed Nov 26 12:57:35 2025 +0530

    Fix automatic backport workflow race condition (#58705)
---
 .github/workflows/automatic-backport.yml | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/automatic-backport.yml 
b/.github/workflows/automatic-backport.yml
index 4f861ddd581..986c31cae4a 100644
--- a/.github/workflows/automatic-backport.yml
+++ b/.github/workflows/automatic-backport.yml
@@ -35,6 +35,14 @@ jobs:
         id: get-sha
         run: echo "COMMIT_SHA=${GITHUB_SHA}" >> $GITHUB_ENV
 
+      # Adding a slight delay to allow GitHub's API to associate the merge 
commit with the PR.
+      # This is needed because GH has a consistency of 6-10+ seconds
+      # to process the commit and PR association after a merge based on some 
of our past runs.
+      # Without this delay, the listPullRequestsAssociatedWithCommit API call 
may return an empty array
+      # even though a PR was just merged, causing backports to be skipped.
+      - name: Add delay for GitHub to process PR merge
+        run: sleep 15
+
       - name: Find PR information
         id: pr-info
         uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea  
# v7.0.1
@@ -57,7 +65,7 @@ jobs:
                 console.log(`Backport branches: ${backportBranches}`);
                 core.setOutput('branches', JSON.stringify(backportBranches));
             } else {
-                console.log('No pull request found for this commit.');
+                console.log('⚠️ No pull request found for this commit.');
                 core.setOutput('branches', '[]');
             }
 

Reply via email to