From 60e9c627c78c4fde079a48ca02e850d493e52c33 Mon Sep 17 00:00:00 2001 From: Marko Kubrachenko Date: Fri, 5 Jun 2026 14:39:19 +0200 Subject: [PATCH 1/2] fix(get_values): use head ref/sha on pull_request_target pull_request_target events fell through to the `else` branch and used GITHUB_REF_NAME, which is the BASE branch (e.g. develop) - so clean_branch_name, clean_branch_name_with_suffix and short_commit_sha reflected the target branch instead of the PR's head. This broke per-PR naming for workflows triggered on pull_request_target (multi-staging teardowns computed develop- and no-op'd). GITHUB_HEAD_REF and github.event.pull_request.head.sha are populated for both pull_request and pull_request_target, so handle them the same way. Closes #302. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/get_values.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/get_values.yaml b/.github/workflows/get_values.yaml index 500bc21..b835c2f 100644 --- a/.github/workflows/get_values.yaml +++ b/.github/workflows/get_values.yaml @@ -44,7 +44,9 @@ jobs: if [ "${{ inputs.commitSha }}" != "" ]; then COMMIT_SHA=${{ inputs.commitSha }} BRANCH_NAME=${GITHUB_REF_NAME} - elif [ "${{ github.event_name }}" = "pull_request" ]; then + # pull_request_target carries the same head context as pull_request (GITHUB_HEAD_REF / head.sha); + # without this it falls through to the base branch below, breaking per-PR naming (e.g. env teardowns). + elif [ "${{ github.event_name }}" = "pull_request" ] || [ "${{ github.event_name }}" = "pull_request_target" ]; then COMMIT_SHA=${{ github.event.pull_request.head.sha }} BRANCH_NAME=${GITHUB_HEAD_REF} else From eb8326212fd77a6156ebb54f940014fa20c77274 Mon Sep 17 00:00:00 2001 From: Marko Kubrachenko Date: Mon, 8 Jun 2026 13:04:00 +0200 Subject: [PATCH 2/2] docs(get_values): shorten pull_request_target comment to one line Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/get_values.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/get_values.yaml b/.github/workflows/get_values.yaml index b835c2f..36a6552 100644 --- a/.github/workflows/get_values.yaml +++ b/.github/workflows/get_values.yaml @@ -44,8 +44,7 @@ jobs: if [ "${{ inputs.commitSha }}" != "" ]; then COMMIT_SHA=${{ inputs.commitSha }} BRANCH_NAME=${GITHUB_REF_NAME} - # pull_request_target carries the same head context as pull_request (GITHUB_HEAD_REF / head.sha); - # without this it falls through to the base branch below, breaking per-PR naming (e.g. env teardowns). + # pull_request_target exposes the same head ref/sha as pull_request; without this it falls through to the base branch. elif [ "${{ github.event_name }}" = "pull_request" ] || [ "${{ github.event_name }}" = "pull_request_target" ]; then COMMIT_SHA=${{ github.event.pull_request.head.sha }} BRANCH_NAME=${GITHUB_HEAD_REF}