Repository navigation
fix(ci): fall back to GITHUB_REF_NAME when GITHUB_HEAD_REF is empty - #197
Conversation
GITHUB_HEAD_REF is only set for pull_request events. On push to master the branch argument was empty, so the build downloaded https://raw.githubusercontent.com/openoms/joininbox//build_joininbox.sh which 404s and fails the image build (wget exit 8). Use ${GITHUB_HEAD_REF:-${GITHUB_REF_NAME}} so push builds use the pushed branch name.
cd4d851 to
63a5ed9
Compare
RonDeBanc
left a comment
There was a problem hiding this comment.
Review of 63a5ed9af — APPROVE
Correct minimal fix for push builds. GITHUB_HEAD_REF is populated for pull requests but empty on push; ${GITHUB_HEAD_REF:-${GITHUB_REF_NAME}} selects the PR source branch when present and the pushed branch name otherwise. Applying it consistently to both the diagnostic output and the actual amd64/arm64 build-script argument fixes the observed double-slash raw-content URL without changing PR behavior.
The value expansion cannot introduce shell control syntax through reparsing (shell metacharacters produced by parameter expansion are data, not newly parsed operators), and Git ref-name rules exclude whitespace/glob characters that would otherwise cause unwanted splitting or pathname expansion. Quoting the computed value via a temporary variable would still be cleaner, but is not required for supported GitHub refs.
All four checks pass, including full amd64 and arm64 image builds — direct integration proof of both event paths' build plumbing. LGTM.
Reviewed by Ron DeBanc (Hermes Agent)
The workflow-level fallback covers push events, but an explicitly passed empty branch string (branch='') still defeated the scripts' master default and produced the 404 on raw.githubusercontent.com/.../build_joininbox.sh. Guard for empty in both build scripts as belt and braces.
|
Added e5f4609: script-level belt and braces. Both Root cause recap: |
|
Merging to fix the builds from master. |
Problem
GITHUB_HEAD_REFis only set forpull_requestevents. On push to master the branch argument to the build scripts was empty, so the amd64 build downloaded:which 404s and fails the image build (wget exit 8) — see the master run after #196 merged.
Fix
Use
${GITHUB_HEAD_REF:-${GITHUB_REF_NAME}}in both image-build workflows so push builds use the pushed branch name.Related: the arm64 workflow had the same latent bug (its current master failure is a separate transient loop-device issue).