From 34610fc43f43e6e2b294c7b59e900d185b958c11 Mon Sep 17 00:00:00 2001 From: Brett Mastbergen Date: Tue, 12 Aug 2025 16:42:02 -0400 Subject: [PATCH] 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. --- .github/workflows/upstream-commit-check.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/upstream-commit-check.yml b/.github/workflows/upstream-commit-check.yml index ae25072b95223..e95c4e904f8e4 100644 --- a/.github/workflows/upstream-commit-check.yml +++ b/.github/workflows/upstream-commit-check.yml @@ -16,12 +16,14 @@ jobs: - name: Checkout PR branch uses: actions/checkout@v4 with: + repository: ${{ github.event.pull_request.head.repo.full_name }} fetch-depth: 0 ref: ${{ github.head_ref }} - name: Checkout base branch run: | - git fetch origin ${{ github.base_ref }}:${{ github.base_ref }} + git remote add base_repo https://github.com/${{ github.repository }}.git + git fetch base_repo ${{ github.base_ref }}:${{ github.base_ref }} - name: Download check_kernel_commits.py run: |