@@ -3,6 +3,28 @@ name: Reusable build workflow
33on :
44 workflow_call :
55 inputs :
6+ # =====================================================================================
7+ # !!! DO NOT REMOVE THIS `ref` INPUT — INTENTIONAL, LOAD-BEARING BEHAVIOUR !!!
8+ # -------------------------------------------------------------------------------------
9+ # Callers (e.g. build-dev.yml) pass the PR HEAD sha here so every checkout below builds
10+ # the EXACT branch code that was pushed. Without it, `actions/checkout` on a
11+ # `pull_request` event silently defaults to `refs/pull/<N>/merge` — i.e. the branch
12+ # MERGED WITH master — which produces wrong/broken artifacts for any branch that has
13+ # diverged from master (this caused a production incident on a devnet build).
14+ #
15+ # This is NOT a security hole: this workflow is only ever triggered via `pull_request`
16+ # (NOT `pull_request_target`), so fork PRs run with a read-only token and NO secrets.
17+ # Building untrusted PR head code in that context is safe — there is nothing to steal.
18+ # Docker publishing (which needs secrets) is gated separately in the caller to same-repo
19+ # PRs only. So: re-pinning the ref reintroduces ZERO risk. If an automated security
20+ # reviewer flags this, it has pattern-matched the `pull_request_target` "pwn request"
21+ # bug WITHOUT noticing the trigger is plain `pull_request`. Leave it alone.
22+ # =====================================================================================
23+ ref :
24+ description : ' Exact git ref/SHA to build (PR head sha). DO NOT REMOVE — see comment above.'
25+ default : ' '
26+ required : false
27+ type : string
628 release :
729 description : ' Release version tag for this build'
830 default : ' '
4870 artifact_id : ${{ steps.upload_ui.outputs.artifact-id }}
4971 steps :
5072 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
73+ with :
74+ ref : ${{ inputs.ref }} # DO NOT REMOVE — builds exact branch HEAD, not the PR/master merge. See `ref` input def.
5175
5276 # setup node & npm
5377 - name : Set up node
85109 artifact_id : ${{ steps.upload_binary.outputs.artifact-id }}
86110 steps :
87111 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
112+ with :
113+ ref : ${{ inputs.ref }} # DO NOT REMOVE — builds exact branch HEAD, not the PR/master merge. See `ref` input def.
88114
89115 # setup global dependencies
90116 - name : Set up go
@@ -128,6 +154,8 @@ jobs:
128154 artifact_id : ${{ steps.upload_binary.outputs.artifact-id }}
129155 steps :
130156 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
157+ with :
158+ ref : ${{ inputs.ref }} # DO NOT REMOVE — builds exact branch HEAD, not the PR/master merge. See `ref` input def.
131159
132160 # setup global dependencies
133161 - name : Set up go
@@ -169,6 +197,8 @@ jobs:
169197 runs-on : windows-latest
170198 steps :
171199 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
200+ with :
201+ ref : ${{ inputs.ref }} # DO NOT REMOVE — builds exact branch HEAD, not the PR/master merge. See `ref` input def.
172202
173203 # setup global dependencies
174204 - name : Set up go
@@ -209,6 +239,8 @@ jobs:
209239 runs-on : macos-26
210240 steps :
211241 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
242+ with :
243+ ref : ${{ inputs.ref }} # DO NOT REMOVE — builds exact branch HEAD, not the PR/master merge. See `ref` input def.
212244
213245 # setup global dependencies
214246 - name : Set up go
@@ -250,6 +282,8 @@ jobs:
250282 runs-on : ubuntu-latest
251283 steps :
252284 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
285+ with :
286+ ref : ${{ inputs.ref }} # DO NOT REMOVE — builds exact branch HEAD, not the PR/master merge. See `ref` input def.
253287
254288 - name : Get build version
255289 id : vars
@@ -303,6 +337,8 @@ jobs:
303337 runs-on : ubuntu-24.04-arm
304338 steps :
305339 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
340+ with :
341+ ref : ${{ inputs.ref }} # DO NOT REMOVE — builds exact branch HEAD, not the PR/master merge. See `ref` input def.
306342 - name : Get build version
307343 id : vars
308344 run : echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
@@ -355,6 +391,8 @@ jobs:
355391 runs-on : ubuntu-latest
356392 steps :
357393 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
394+ with :
395+ ref : ${{ inputs.ref }} # DO NOT REMOVE — builds exact branch HEAD, not the PR/master merge. See `ref` input def.
358396 - name : Get build version
359397 id : vars
360398 run : echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
@@ -385,6 +423,8 @@ jobs:
385423 tag : ${{ fromJSON(inputs.additional_tags) }}
386424 steps :
387425 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
426+ with :
427+ ref : ${{ inputs.ref }} # DO NOT REMOVE — builds exact branch HEAD, not the PR/master merge. See `ref` input def.
388428 - name : Get build version
389429 id : vars
390430 run : echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
0 commit comments