From 8409ba4c38d94dae785cab923a0967658ea8f4ff Mon Sep 17 00:00:00 2001 From: Ulli Hafner Date: Wed, 27 Nov 2024 11:08:45 +0100 Subject: [PATCH] Fix commit ID for CI. --- .github/workflows/ci.yml | 5 +++++ .github/workflows/codeql.yml | 8 ++++++-- .github/workflows/coverage.yml | 5 +++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index caa2281f71..1f1c35c572 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,11 @@ jobs: steps: - uses: actions/checkout@v4 + if: github.event_name == 'push' + - uses: actions/checkout@v4 + with: + ref: "${{ github.event.pull_request.merge_commit_sha }}" + if: github.event_name == 'pull_request_target' - name: Set up JDK ${{ matrix.jdk }} uses: actions/setup-java@v4 with: diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index c1e547419c..9a2e1a458e 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -23,8 +23,12 @@ jobs: language: [ java ] steps: - - name: Checkout - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + if: github.event_name == 'push' + - uses: actions/checkout@v4 + with: + ref: "${{ github.event.pull_request.merge_commit_sha }}" + if: github.event_name == 'pull_request_target' - name: Setup Java uses: actions/setup-java@v4 diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 0514a27ce6..fde12d1777 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -14,6 +14,11 @@ jobs: steps: - uses: actions/checkout@v4 + if: github.event_name == 'push' + - uses: actions/checkout@v4 + with: + ref: "${{ github.event.pull_request.merge_commit_sha }}" + if: github.event_name == 'pull_request_target' - name: Set up JDK 21 uses: actions/setup-java@v4 with: