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

potiuk pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v3-1-test by this push:
     new 8f5c7b84fe3 [v3-1-test] Fix automatic backport workflow race condition 
(#58705) (#58706)
8f5c7b84fe3 is described below

commit 8f5c7b84fe3f22379ad4ed0c4eecd009df331b7f
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Nov 27 16:51:28 2025 +0100

    [v3-1-test] Fix automatic backport workflow race condition (#58705) (#58706)
    
    (cherry picked from commit 1aa9b7af38b52afa79d5108a04ceb5fd181682ba)
    
    Co-authored-by: Amogh Desai <[email protected]>
---
 .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