https://github.com/python/cpython/commit/bc1a6ecfab02075acea79f8460a2dce70c61b2fd
commit: bc1a6ecfab02075acea79f8460a2dce70c61b2fd
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: hugovk <[email protected]>
date: 2025-05-15T16:41:47+03:00
summary:

[3.13] gh-133410: Fix PR detection in build workflow (GH-133671) (#134054)

Co-authored-by: Hugo van Kemenade <[email protected]>

files:
M .github/workflows/reusable-context.yml
M Tools/build/compute-changes.py

diff --git a/.github/workflows/reusable-context.yml 
b/.github/workflows/reusable-context.yml
index 73dc254edc5fbc..d2668ddcac1a3d 100644
--- a/.github/workflows/reusable-context.yml
+++ b/.github/workflows/reusable-context.yml
@@ -97,6 +97,7 @@ jobs:
       run: python Tools/build/compute-changes.py
       env:
         GITHUB_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
+        GITHUB_EVENT_NAME: ${{ github.event_name }}
         CCF_TARGET_REF: ${{ github.base_ref || 
github.event.repository.default_branch }}
         CCF_HEAD_REF: ${{ github.event.pull_request.head.sha || github.sha }}
 
diff --git a/Tools/build/compute-changes.py b/Tools/build/compute-changes.py
index cfdd55fd1925fd..b5993d29b92972 100644
--- a/Tools/build/compute-changes.py
+++ b/Tools/build/compute-changes.py
@@ -57,7 +57,7 @@ class Outputs:
 
 def compute_changes() -> None:
     target_branch, head_ref = git_refs()
-    if target_branch and head_ref:
+    if os.environ.get("GITHUB_EVENT_NAME", "") == "pull_request":
         # Getting changed files only makes sense on a pull request
         files = get_changed_files(target_branch, head_ref)
         outputs = process_changed_files(files)

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to