From cff0e349f5eecea3e23d97dc2a22615e5a11f7fd Mon Sep 17 00:00:00 2001 From: Radovan Fuchs Date: Thu, 31 Jul 2025 17:51:25 +0200 Subject: [PATCH] use proper commit for PRs and pushes --- .github/workflows/e2e_tests.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e_tests.yaml b/.github/workflows/e2e_tests.yaml index eca08e113..6b450ce7e 100644 --- a/.github/workflows/e2e_tests.yaml +++ b/.github/workflows/e2e_tests.yaml @@ -12,7 +12,17 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: ${{ github.event.pull_request.head.sha }} + # On PR_TARGET → the fork (or same repo) that opened the PR. + # On push → falls back to the current repository. + repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }} + + # On PR_TARGET → the PR head *commit* (reproducible). + # On push → the pushed commit that triggered the workflow. + ref: ${{ github.event.pull_request.head.sha || github.sha }} + + fetch-depth: 0 + # Don’t keep credentials when running untrusted PR code under PR_TARGET. + persist-credentials: ${{ github.event_name != 'pull_request_target' }} - uses: 1arp/create-a-file-action@0.4.5 env: