fix(ci): use head_ref for PR branch in fresh install test

On PR events, github.ref_name resolves to the merge ref (e.g.
"1159/merge") which doesn't exist on raw.githubusercontent.com,
causing a 404. Use github.head_ref (the actual source branch)
for PRs, falling back to ref_name for push events.

Also adds -f flag to curl so HTTP errors fail immediately with
a clear message instead of silently saving the 404 HTML page.
This commit is contained in:
Vijay Janapa Reddi
2026-02-04 10:06:25 -05:00
parent 24ab7599c6
commit 3a2b1bf482
2 changed files with 11 additions and 2 deletions

View File

@@ -436,7 +436,11 @@ jobs:
- name: Run Fresh Install Test (Docker)
run: |
chmod +x tinytorch/scripts/test-fresh-install.sh
./tinytorch/scripts/test-fresh-install.sh --branch ${{ github.ref_name }}
# For PRs, github.ref_name is the merge ref (e.g. "1159/merge") which doesn't
# exist as a real branch on raw.githubusercontent.com. Use head_ref (the actual
# source branch) for PRs, falling back to ref_name for push events.
BRANCH="${{ github.head_ref || github.ref_name }}"
./tinytorch/scripts/test-fresh-install.sh --branch "$BRANCH"
# ===========================================================================
# STAGE 7: USER JOURNEY - Destructive full journey (after all stages)