Skip to content

Commit d14abc6

Browse files
committed
github actions: Fix upstream commit check for forks
The upstream commit check workflow was failing for pull requests originating from forked repositories. The previous implementation incorrectly assumed the pull request branch existed on the base repository. This commit corrects the workflow to ensure the pull request branch is checked out from the correct source repository, while the base branch is fetched from the target repository.
1 parent 72caef5 commit d14abc6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/upstream-commit-check.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ jobs:
1616
- name: Checkout PR branch
1717
uses: actions/checkout@v4
1818
with:
19+
repository: ${{ github.event.pull_request.head.repo.full_name }}
1920
fetch-depth: 0
2021
ref: ${{ github.head_ref }}
2122

2223
- name: Checkout base branch
2324
run: |
24-
git fetch origin ${{ github.base_ref }}:${{ github.base_ref }}
25+
git remote add base_repo https://github.com/${{ github.repository }}.git
26+
git fetch base_repo ${{ github.base_ref }}:${{ github.base_ref }}
2527
2628
- name: Download check_kernel_commits.py
2729
run: |

0 commit comments

Comments
 (0)