|
70 | 70 |
|
71 | 71 | - name: Clone Hermes |
72 | 72 | shell: bash |
73 | | - run: git clone --depth 1 --branch "${{ github.event.inputs.hermes_ref || 'master' }}" "$HERMES_REPO" hermes |
| 73 | + # Fetch by ref so an exact commit SHA works (git clone --branch only |
| 74 | + # accepts branch/tag names). GitHub allows fetching arbitrary SHAs. |
| 75 | + run: | |
| 76 | + set -euxo pipefail |
| 77 | + ref="${{ github.event.inputs.hermes_ref || 'master' }}" |
| 78 | + git init hermes |
| 79 | + git -C hermes remote add origin "$HERMES_REPO" |
| 80 | + git -C hermes fetch --depth 1 origin "$ref" |
| 81 | + git -C hermes -c advice.detachedHead=false checkout FETCH_HEAD |
74 | 82 |
|
75 | 83 | - name: Build hermesc (Unix) |
76 | 84 | if: runner.os != 'Windows' |
@@ -132,7 +140,13 @@ jobs: |
132 | 140 |
|
133 | 141 | - name: Clone QuickJS |
134 | 142 | shell: bash |
135 | | - run: git clone --depth 1 --branch "${{ github.event.inputs.quickjs_ref || 'master' }}" "$QUICKJS_REPO" quickjs |
| 143 | + run: | |
| 144 | + set -euxo pipefail |
| 145 | + ref="${{ github.event.inputs.quickjs_ref || 'master' }}" |
| 146 | + git init quickjs |
| 147 | + git -C quickjs remote add origin "$QUICKJS_REPO" |
| 148 | + git -C quickjs fetch --depth 1 origin "$ref" |
| 149 | + git -C quickjs -c advice.detachedHead=false checkout FETCH_HEAD |
136 | 150 |
|
137 | 151 | - name: Build shim |
138 | 152 | shell: bash |
@@ -187,7 +201,13 @@ jobs: |
187 | 201 |
|
188 | 202 | - name: Clone QuickJS-NG |
189 | 203 | shell: bash |
190 | | - run: git clone --depth 1 --branch "${{ github.event.inputs.quickjs_ng_ref || 'master' }}" "$QUICKJS_NG_REPO" quickjs-ng |
| 204 | + run: | |
| 205 | + set -euxo pipefail |
| 206 | + ref="${{ github.event.inputs.quickjs_ng_ref || 'master' }}" |
| 207 | + git init quickjs-ng |
| 208 | + git -C quickjs-ng remote add origin "$QUICKJS_NG_REPO" |
| 209 | + git -C quickjs-ng fetch --depth 1 origin "$ref" |
| 210 | + git -C quickjs-ng -c advice.detachedHead=false checkout FETCH_HEAD |
191 | 211 |
|
192 | 212 | - name: Build lib + shim |
193 | 213 | shell: bash |
@@ -246,7 +266,12 @@ jobs: |
246 | 266 | - name: Clone PrimJS |
247 | 267 | shell: bash |
248 | 268 | run: | |
249 | | - git clone --depth 1 --branch "${{ github.event.inputs.primjs_ref || 'develop' }}" "$PRIMJS_REPO" primjs |
| 269 | + set -euxo pipefail |
| 270 | + ref="${{ github.event.inputs.primjs_ref || 'develop' }}" |
| 271 | + git init primjs |
| 272 | + git -C primjs remote add origin "$PRIMJS_REPO" |
| 273 | + git -C primjs fetch --depth 1 origin "$ref" |
| 274 | + git -C primjs -c advice.detachedHead=false checkout FETCH_HEAD |
250 | 275 | # PrimJS vendors deps via a script in some layouts; run it if present. |
251 | 276 | if [ -f primjs/tools/hooks/generate_gni.py ]; then python3 primjs/tools/hooks/generate_gni.py || true; fi |
252 | 277 |
|
|
0 commit comments