From ffa7b69ef8db23665f8c6062c5767c3fbe96f3cc Mon Sep 17 00:00:00 2001 From: Brendon Smith Date: Thu, 30 May 2024 21:34:34 -0400 Subject: [PATCH] Checkout `github.head_ref` for PRs https://github.com/actions/checkout/issues/27#issuecomment-535897113 https://github.com/actions/checkout/issues/1108 --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index bda69be..3e24d9e 100644 --- a/action.yml +++ b/action.yml @@ -104,7 +104,7 @@ runs: # Set repo and ref from which to run Docker container action # to handle cases in which `github.action_` context is not set # https://github.com/actions/runner/issues/2473 - REF=${{ env.ACTION_REF || github.ref_name }} + REF=${{ env.ACTION_REF || github.head_ref || github.ref_name }} REPO=${{ env.ACTION_REPO || github.repository }} echo "ref=$REF" >>"$GITHUB_OUTPUT" echo "repo=$REPO" >>"$GITHUB_OUTPUT"