From 70449971cb1e8d5217f2ed41b48f722b16c32ae1 Mon Sep 17 00:00:00 2001 From: Fiereu Date: Mon, 10 Aug 2026 15:58:06 +0200 Subject: [PATCH] ci: check out fork pull requests through refs/pull (#155) --- .github/workflows/ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f2a9d6..0bfb706 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ permissions: contents: write concurrency: - group: ci-${{ github.head_ref || github.ref }} + group: ci-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: @@ -45,7 +45,10 @@ jobs: submodules: recursive # On pull requests check out the branch itself, not the detached merge # commit, so the formatting commit can be pushed back. - ref: ${{ github.head_ref || github.sha }} + ref: >- + ${{ github.event_name != 'pull_request' && github.sha + || github.event.pull_request.head.repo.full_name == github.repository && github.head_ref + || format('refs/pull/{0}/head', github.event.pull_request.number) }} token: ${{ secrets.GITHUB_TOKEN }} - name: Set up JDK 25