This is an automated email from the ASF dual-hosted git repository.

pkarwasz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/logging-parent.git


The following commit(s) were added to refs/heads/main by this push:
     new 2e488c5  Use `github.head_ref` for the `pull_request_target` event
2e488c5 is described below

commit 2e488c588fb2e48fff21bc4b35cec16a265b5cf1
Author: Piotr P. Karwasz <[email protected]>
AuthorDate: Tue Oct 31 19:02:58 2023 +0100

    Use `github.head_ref` for the `pull_request_target` event
---
 .github/workflows/build-reusable.yaml           | 5 ++++-
 .github/workflows/deploy-release-reusable.yaml  | 2 +-
 .github/workflows/deploy-snapshot-reusable.yaml | 2 +-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/build-reusable.yaml 
b/.github/workflows/build-reusable.yaml
index eb340d1..c0a7d60 100644
--- a/.github/workflows/build-reusable.yaml
+++ b/.github/workflows/build-reusable.yaml
@@ -43,7 +43,10 @@ jobs:
     steps:
 
       - name: Checkout repository
-        uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11   # 
4.0.0
+        uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11   # 
4.1.1
+        with:
+          # When running on `pull_request` use the PR branch, not the target 
branch
+          ref: ${{ github.event_name == 'pull_request_target' && 
github.head_ref || github.ref }}
 
       - name: Set up Java
         uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0   # 
3.7.0
diff --git a/.github/workflows/deploy-release-reusable.yaml 
b/.github/workflows/deploy-release-reusable.yaml
index 9497f0d..013310a 100644
--- a/.github/workflows/deploy-release-reusable.yaml
+++ b/.github/workflows/deploy-release-reusable.yaml
@@ -63,7 +63,7 @@ jobs:
     steps:
 
       - name: Checkout repository
-        uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11   # 
4.0.0
+        uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11   # 
4.1.1
 
       - name: Set up Java & GPG
         uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0   # 
3.7.0
diff --git a/.github/workflows/deploy-snapshot-reusable.yaml 
b/.github/workflows/deploy-snapshot-reusable.yaml
index 4484152..e4f9918 100644
--- a/.github/workflows/deploy-snapshot-reusable.yaml
+++ b/.github/workflows/deploy-snapshot-reusable.yaml
@@ -38,7 +38,7 @@ jobs:
     steps:
 
       - name: Checkout repository
-        uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11   # 
4.0.0
+        uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11   # 
4.1.1
 
       - name: Set up Java
         uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0   # 
3.7.0

Reply via email to