mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
[3.12] gh-133410: Fix PR detection in build workflow (GH-133671) (#134057)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
This commit is contained in:
parent
0c92fc364c
commit
310cd8943a
2 changed files with 2 additions and 1 deletions
1
.github/workflows/reusable-context.yml
vendored
1
.github/workflows/reusable-context.yml
vendored
|
@ -97,6 +97,7 @@ jobs:
|
||||||
run: python Tools/build/compute-changes.py
|
run: python Tools/build/compute-changes.py
|
||||||
env:
|
env:
|
||||||
GITHUB_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
|
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_TARGET_REF: ${{ github.base_ref || github.event.repository.default_branch }}
|
||||||
CCF_HEAD_REF: ${{ github.event.pull_request.head.sha || github.sha }}
|
CCF_HEAD_REF: ${{ github.event.pull_request.head.sha || github.sha }}
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ class Outputs:
|
||||||
|
|
||||||
def compute_changes() -> None:
|
def compute_changes() -> None:
|
||||||
target_branch, head_ref = git_refs()
|
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
|
# Getting changed files only makes sense on a pull request
|
||||||
files = get_changed_files(target_branch, head_ref)
|
files = get_changed_files(target_branch, head_ref)
|
||||||
outputs = process_changed_files(files)
|
outputs = process_changed_files(files)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue