Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[GHA] Fix manifest trigger repo branch for manual builds (#30492)

Alina Kladievaad5789b70964
diff --git a/.github/actions/create_manifest/action.yml b/.github/actions/create_manifest/action.yml
index 73a353da0b4..c84d645bcee 100644
--- a/.github/actions/create_manifest/action.yml
+++ b/.github/actions/create_manifest/action.yml
@@ -22,6 +22,9 @@ inputs:
trigger_repo_sha:
description: "Commit hash of a trigger repo. If not set - taken from github context"
required: false
+ trigger_repo_branch:
+ description: "Branch of a trigger repo. If not set - taken from github context"
+ required: false
runs:
@@ -45,3 +48,4 @@ runs:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
TRIGGER_REPO_SHA: ${{ inputs.trigger_repo_sha || github.event.pull_request.head.sha || github.sha }}
ACTION_PATH: ${{ runner.os == 'Windows' && '$env:GITHUB_ACTION_PATH' || '$GITHUB_ACTION_PATH' }}
+ TRIGGER_REPO_BRANCH: ${{ inputs.trigger_repo_branch }}
diff --git a/.github/actions/create_manifest/create_manifest.py b/.github/actions/create_manifest/create_manifest.py
index 4ac62918e99..a416fdbaac9 100644
--- a/.github/actions/create_manifest/create_manifest.py
+++ b/.github/actions/create_manifest/create_manifest.py
@@ -52,7 +52,7 @@ def get_repo_data(repo_dir: str | Path) -> dict:
trigger_repo_url = f"{os.getenv('GITHUB_SERVER_URL')}/{os.getenv('GITHUB_REPOSITORY')}"
is_trigger_repo = repo_url == trigger_repo_url
- branch = os.getenv('GITHUB_REF') if is_trigger_repo else repo.references[0].name
+ branch = os.getenv('TRIGGER_REPO_BRANCH') or os.getenv('GITHUB_REF') if is_trigger_repo else repo.references[0].name
target_branch = os.getenv('GITHUB_BASE_REF') if is_trigger_repo else None
revision = os.getenv('TRIGGER_REPO_SHA') if is_trigger_repo else repo.head.commit.hexsha
target_revision = os.getenv('BASE_SHA') if is_trigger_repo else None
diff --git a/.github/workflows/job_build_linux.yml b/.github/workflows/job_build_linux.yml
index ee51d9e38c5..c31d536459f 100644
--- a/.github/workflows/job_build_linux.yml
+++ b/.github/workflows/job_build_linux.yml
@@ -148,6 +148,7 @@ jobs:
target_arch: ${{ inputs.arch }}
build_type: 'release'
save_to: ${{ env.MANIFEST_PATH }}
+ trigger_repo_branch: ${{ inputs.target-branch }}
#
# Print system info
diff --git a/.github/workflows/job_build_windows.yml b/.github/workflows/job_build_windows.yml
index 7e55c90603a..93bd83b1519 100644
--- a/.github/workflows/job_build_windows.yml
+++ b/.github/workflows/job_build_windows.yml
@@ -101,6 +101,7 @@ jobs:
target_arch: 'x86_64'
build_type: ${{ inputs.build-type }}
save_to: ${{ env.MANIFEST_PATH }}
+ trigger_repo_branch: ${{ inputs.target-branch }}
#
# Print system info
diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml
index b9df88e931a..805b9273897 100644
--- a/.github/workflows/mac.yml
+++ b/.github/workflows/mac.yml
@@ -176,6 +176,7 @@ jobs:
target_arch: ${{ runner.arch }}
build_type: 'release'
save_to: ${{ github.workspace }}/${{ env.MANIFEST_FILE }}
+ trigger_repo_branch: ${{ inputs.target-branch }}
- name: CMake configure
run: |
diff --git a/.github/workflows/manylinux_2014.yml b/.github/workflows/manylinux_2014.yml
index d0691214c28..ed8f23dc037 100644
--- a/.github/workflows/manylinux_2014.yml
+++ b/.github/workflows/manylinux_2014.yml
@@ -144,6 +144,7 @@ jobs:
target_arch: ${{ env.ARCH }}
build_type: ${{ env.CMAKE_BUILD_TYPE }}
save_to: ${{ env.MANIFEST_PATH }}
+ trigger_repo_branch: ${{ inputs.target-branch }}
- name: Create docker build cache
run: |