From 43a3e84d18f49bdc0b7f29be9878e376597bdf0e Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Wed, 19 Mar 2025 12:30:39 +0000 Subject: [PATCH] =?UTF-8?q?Build/Test=20Tools:=20Use=20=E2=80=98pull=5Freq?= =?UTF-8?q?uest.head.ref`=20when=20checking=20built=20files.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Because `pull_request_target` happens in the context of the base branch, attempting to checkout `github.head_ref` results in a failure when the workflow comes from a fork. This adjusts the options passed to `actions/checkout` to use the repository that actually contains the test branch. See #62221. git-svn-id: https://develop.svn.wordpress.org/trunk@60052 602fd350-edb4-49c9-b593-d223f7449a82 --- .github/workflows/reusable-check-built-files.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reusable-check-built-files.yml b/.github/workflows/reusable-check-built-files.yml index 7488a58c8e..9aa0b13daf 100644 --- a/.github/workflows/reusable-check-built-files.yml +++ b/.github/workflows/reusable-check-built-files.yml @@ -83,7 +83,8 @@ jobs: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: - ref: ${{ github.head_ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.event.pull_request.head.ref }} show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} token: ${{ env.ACCESS_TOKEN }}