Skip to content

Commit b06aa2b

Browse files
committed
ci: fix
1 parent b61ca02 commit b06aa2b

1 file changed

Lines changed: 29 additions & 4 deletions

File tree

.github/workflows/bytecode-compilers.yml

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,15 @@ jobs:
7070

7171
- name: Clone Hermes
7272
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
7482
7583
- name: Build hermesc (Unix)
7684
if: runner.os != 'Windows'
@@ -132,7 +140,13 @@ jobs:
132140

133141
- name: Clone QuickJS
134142
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
136150
137151
- name: Build shim
138152
shell: bash
@@ -187,7 +201,13 @@ jobs:
187201

188202
- name: Clone QuickJS-NG
189203
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
191211
192212
- name: Build lib + shim
193213
shell: bash
@@ -246,7 +266,12 @@ jobs:
246266
- name: Clone PrimJS
247267
shell: bash
248268
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
250275
# PrimJS vendors deps via a script in some layouts; run it if present.
251276
if [ -f primjs/tools/hooks/generate_gni.py ]; then python3 primjs/tools/hooks/generate_gni.py || true; fi
252277

0 commit comments

Comments
 (0)