mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-04-28 16:48:30 -05:00
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:
@@ -71,7 +71,12 @@ echo ""
|
||||
echo "▶ Step 1: Running install script (branch: $BRANCH)..."
|
||||
export TINYTORCH_BRANCH="$BRANCH"
|
||||
export TINYTORCH_NON_INTERACTIVE=1
|
||||
curl -sSL "https://raw.githubusercontent.com/harvard-edge/cs249r_book/${BRANCH}/tinytorch/site/extra/install.sh" -o /tmp/install.sh
|
||||
curl -fsSL "https://raw.githubusercontent.com/harvard-edge/cs249r_book/${BRANCH}/tinytorch/site/extra/install.sh" -o /tmp/install.sh || {
|
||||
echo "✗ Failed to download install script for branch: $BRANCH"
|
||||
echo " URL: https://raw.githubusercontent.com/harvard-edge/cs249r_book/${BRANCH}/tinytorch/site/extra/install.sh"
|
||||
echo " Hint: Does the branch '${BRANCH}' exist and contain tinytorch/site/extra/install.sh?"
|
||||
exit 1
|
||||
}
|
||||
bash /tmp/install.sh
|
||||
|
||||
cd tinytorch
|
||||
|
||||
Reference in New Issue
Block a user