Skip to content

Commit 0873e1d

Browse files
committed
ci: Update repository name handling in workflows for pull requests
Signed-off-by: Lasota, Adrian <[email protected]>
1 parent 2059017 commit 0873e1d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.github/workflows/build_upload_whl.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ jobs:
7676
fetch-depth: 0
7777
path: ${{ inputs.SOURCE_PATH }}
7878
ref: ${{ inputs.BRANCH_NAME }}
79+
repository: ${{ inputs.REPOSITORY_NAME }}
7980

8081
- name: Set up Python
8182
uses: actions/setup-python@v5
@@ -177,7 +178,7 @@ jobs:
177178
password: ${{ secrets.PYPI_TOKEN }}
178179

179180
- name: Publish comment how to build .whl
180-
if: inputs.RELEASE_BUILD == false
181+
if: inputs.RELEASE_BUILD == false && (github.event.pull_request != null && github.event.pull_request.head.repo.full_name == github.repository) # skip for forks
181182
uses: actions/github-script@v7
182183
with:
183184
github-token: ${{ secrets.GH_TOKEN }}

.github/workflows/pull_requests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
secrets:
2020
GH_TOKEN: ${{ secrets.GH_TOKEN }}
2121
with:
22-
REPOSITORY_NAME: ${{ github.repository }}
22+
REPOSITORY_NAME: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
2323
BRANCH_NAME: ${{ github.head_ref }}
2424
PYTHON_VERSION: ${{ matrix.python_version }}
2525
PUSH_TAG: ${{ matrix.push_tag }}

0 commit comments

Comments
 (0)