Skip to content

Commit f199e0f

Browse files
markubraclaude
andauthored
fix(get_values): use head ref/sha on pull_request_target (#303)
On `pull_request_target`, `get_values` fell through to the `else` branch and read `GITHUB_REF_NAME` — 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. `GITHUB_HEAD_REF` and `github.event.pull_request.head.sha` are populated for **both** `pull_request` and `pull_request_target`, so this just handles them the same way. **Impact / audit:** the only consumer that calls `get_values` on `pull_request_target` is apify-core's `teardown_multi_staging.yaml` (org-wide search for both terms returns nothing else; every other consumer uses `pull_request`/push). That teardown *wants* the head ref — it currently computes `*-develop-<hash>` and no-ops, orphaning multi-staging envs until the weekly scheduled sweep. So this change only affects that workflow, in the intended direction. Closes #302. After release, apify-core drops its interim `compute_prefix` workaround and apify-web's teardown can move to `pull_request_target`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 979b36b commit f199e0f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

.github/workflows/get_values.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ jobs:
4444
if [ "${{ inputs.commitSha }}" != "" ]; then
4545
COMMIT_SHA=${{ inputs.commitSha }}
4646
BRANCH_NAME=${GITHUB_REF_NAME}
47-
elif [ "${{ github.event_name }}" = "pull_request" ]; then
47+
# pull_request_target exposes the same head ref/sha as pull_request; without this it falls through to the base branch.
48+
elif [ "${{ github.event_name }}" = "pull_request" ] || [ "${{ github.event_name }}" = "pull_request_target" ]; then
4849
COMMIT_SHA=${{ github.event.pull_request.head.sha }}
4950
BRANCH_NAME=${GITHUB_HEAD_REF}
5051
else

0 commit comments

Comments
 (0)