@futurelastic/colab-handbook 1.20.2-rc.1 → 1.20.2-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/templates/ci-laravel.yml +43 -3
- package/templates/ci-node.yml +43 -3
- package/templates/ci-python.yml +43 -3
package/package.json
CHANGED
package/templates/ci-laravel.yml
CHANGED
|
@@ -277,6 +277,12 @@ jobs:
|
|
|
277
277
|
key: gitleaks-${{ env.GITLEAKS_VERSION }}-${{ runner.os }}-${{ runner.arch }}
|
|
278
278
|
|
|
279
279
|
- name: Install gitleaks (pinned release binary)
|
|
280
|
+
env:
|
|
281
|
+
# Authenticated (#698). Under load GitHub sheds ANONYMOUS release downloads first:
|
|
282
|
+
# measured 2026-11-09, ~90 min of instant 504s from github.com/…/releases/download,
|
|
283
|
+
# while the API asset path below answered 200 with the same file. The job's own token
|
|
284
|
+
# is enough — reading a public release needs an identity, not a permission.
|
|
285
|
+
GH_TOKEN: ${{ github.token }}
|
|
280
286
|
run: |
|
|
281
287
|
# NOT gitleaks/gitleaks-action@v2 — it demands a paid GITLEAKS_LICENSE for
|
|
282
288
|
# organization-owned repositories. The plain release binary is MIT.
|
|
@@ -308,14 +314,48 @@ jobs:
|
|
|
308
314
|
mkdir -p "$dir"
|
|
309
315
|
tmp="$(mktemp -d "$dir.XXXXXX")"
|
|
310
316
|
trap 'rm -rf "$tmp"' EXIT
|
|
317
|
+
asset="gitleaks_${GITLEAKS_VERSION}_${os}_${arch}.tar.gz"
|
|
318
|
+
sums="gitleaks_${GITLEAKS_VERSION}_checksums.txt"
|
|
319
|
+
# fetch <accept> <url> <file> — every request of this step, one curl line.
|
|
311
320
|
# --fail: on an HTTP error curl otherwise saves the error page and exits 0, and tar
|
|
312
321
|
# then fails with "not in gzip format", naming neither the download nor the host.
|
|
313
322
|
# --retry: a re-run during the same upstream error spends the one re-run branch CI
|
|
314
323
|
# allows, so a brief error is retried here first. A longer outage still fails, at
|
|
315
324
|
# curl, naming the status (#690).
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
325
|
+
# The token reaches api.github.com only: curl drops an -H Authorization header when
|
|
326
|
+
# the asset's 302 leads to another host, so the download CDN never sees it.
|
|
327
|
+
fetch() {
|
|
328
|
+
curl -fsSL --retry 5 --retry-delay 10 --retry-all-errors --connect-timeout 10 --max-time 120 \
|
|
329
|
+
-H "Authorization: Bearer ${GH_TOKEN}" -H "Accept: $1" -o "$3" "$2"
|
|
330
|
+
}
|
|
331
|
+
# The API serves an asset by id, not by name, so look the ids up in the release. No jq:
|
|
332
|
+
# a self-hosted runner need not have it. Splitting on , { [ leaves one key per line
|
|
333
|
+
# whether the JSON comes pretty or compact; within an asset, "url" precedes "name". Were
|
|
334
|
+
# that order ever to change, the wrong file would arrive and the sha256 check below
|
|
335
|
+
# would refuse it — a loud failure, never a wrong binary.
|
|
336
|
+
fetch application/vnd.github+json \
|
|
337
|
+
"https://api.github.com/repos/gitleaks/gitleaks/releases/tags/v${GITLEAKS_VERSION}" "$tmp/release.json"
|
|
338
|
+
for f in "$asset" "$sums"; do
|
|
339
|
+
url="$(tr ',{[' '\n\n\n' < "$tmp/release.json" | awk -F'"' -v want="$f" '
|
|
340
|
+
$2 == "url" && $4 ~ /\/releases\/assets\/[0-9]+$/ { u = $4 }
|
|
341
|
+
$2 == "name" && $4 == want && !found { print u; found = 1 }')"
|
|
342
|
+
if [ -z "$url" ]; then
|
|
343
|
+
echo "::error::gitleaks release v${GITLEAKS_VERSION} has no asset $f"; exit 1
|
|
344
|
+
fi
|
|
345
|
+
fetch application/octet-stream "$url" "$tmp/$f"
|
|
346
|
+
done
|
|
347
|
+
# Verified before tar (#698): an error page, a truncated file or a wrong archive stops
|
|
348
|
+
# here, naming the file, instead of reaching tar — or, for a valid archive, the PATH.
|
|
349
|
+
want="$(awk -v f="$asset" '$2 == f { print $1 }' "$tmp/$sums")"
|
|
350
|
+
if command -v sha256sum >/dev/null; then got="$(sha256sum "$tmp/$asset" | awk '{ print $1 }')"
|
|
351
|
+
else got="$(shasum -a 256 "$tmp/$asset" | awk '{ print $1 }')"; fi # macOS self-hosted
|
|
352
|
+
if [ -z "$want" ]; then
|
|
353
|
+
echo "::error::$sums does not list $asset, so it cannot be verified"; exit 1
|
|
354
|
+
fi
|
|
355
|
+
if [ "$got" != "$want" ]; then
|
|
356
|
+
echo "::error::sha256 mismatch for $asset: got $got, $sums lists $want"; exit 1
|
|
357
|
+
fi
|
|
358
|
+
tar -xzf "$tmp/$asset" -C "$tmp" gitleaks
|
|
319
359
|
chmod +x "$tmp/gitleaks"
|
|
320
360
|
# One rename on one filesystem: a job sharing this tool cache sees no binary or a
|
|
321
361
|
# whole one, never half of one.
|
package/templates/ci-node.yml
CHANGED
|
@@ -263,6 +263,12 @@ jobs:
|
|
|
263
263
|
key: gitleaks-${{ env.GITLEAKS_VERSION }}-${{ runner.os }}-${{ runner.arch }}
|
|
264
264
|
|
|
265
265
|
- name: Install gitleaks (pinned release binary)
|
|
266
|
+
env:
|
|
267
|
+
# Authenticated (#698). Under load GitHub sheds ANONYMOUS release downloads first:
|
|
268
|
+
# measured 2026-11-09, ~90 min of instant 504s from github.com/…/releases/download,
|
|
269
|
+
# while the API asset path below answered 200 with the same file. The job's own token
|
|
270
|
+
# is enough — reading a public release needs an identity, not a permission.
|
|
271
|
+
GH_TOKEN: ${{ github.token }}
|
|
266
272
|
run: |
|
|
267
273
|
# Deliberately NOT gitleaks/gitleaks-action@v2: that action requires a paid
|
|
268
274
|
# GITLEAKS_LICENSE for repositories owned by an organization (free only for
|
|
@@ -298,14 +304,48 @@ jobs:
|
|
|
298
304
|
mkdir -p "$dir"
|
|
299
305
|
tmp="$(mktemp -d "$dir.XXXXXX")"
|
|
300
306
|
trap 'rm -rf "$tmp"' EXIT
|
|
307
|
+
asset="gitleaks_${GITLEAKS_VERSION}_${os}_${arch}.tar.gz"
|
|
308
|
+
sums="gitleaks_${GITLEAKS_VERSION}_checksums.txt"
|
|
309
|
+
# fetch <accept> <url> <file> — every request of this step, one curl line.
|
|
301
310
|
# --fail: on an HTTP error curl otherwise saves the error page and exits 0, and tar
|
|
302
311
|
# then fails with "not in gzip format", naming neither the download nor the host.
|
|
303
312
|
# --retry: a re-run during the same upstream error spends the one re-run branch CI
|
|
304
313
|
# allows, so a brief error is retried here first. A longer outage still fails, at
|
|
305
314
|
# curl, naming the status (#690).
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
315
|
+
# The token reaches api.github.com only: curl drops an -H Authorization header when
|
|
316
|
+
# the asset's 302 leads to another host, so the download CDN never sees it.
|
|
317
|
+
fetch() {
|
|
318
|
+
curl -fsSL --retry 5 --retry-delay 10 --retry-all-errors --connect-timeout 10 --max-time 120 \
|
|
319
|
+
-H "Authorization: Bearer ${GH_TOKEN}" -H "Accept: $1" -o "$3" "$2"
|
|
320
|
+
}
|
|
321
|
+
# The API serves an asset by id, not by name, so look the ids up in the release. No jq:
|
|
322
|
+
# a self-hosted runner need not have it. Splitting on , { [ leaves one key per line
|
|
323
|
+
# whether the JSON comes pretty or compact; within an asset, "url" precedes "name". Were
|
|
324
|
+
# that order ever to change, the wrong file would arrive and the sha256 check below
|
|
325
|
+
# would refuse it — a loud failure, never a wrong binary.
|
|
326
|
+
fetch application/vnd.github+json \
|
|
327
|
+
"https://api.github.com/repos/gitleaks/gitleaks/releases/tags/v${GITLEAKS_VERSION}" "$tmp/release.json"
|
|
328
|
+
for f in "$asset" "$sums"; do
|
|
329
|
+
url="$(tr ',{[' '\n\n\n' < "$tmp/release.json" | awk -F'"' -v want="$f" '
|
|
330
|
+
$2 == "url" && $4 ~ /\/releases\/assets\/[0-9]+$/ { u = $4 }
|
|
331
|
+
$2 == "name" && $4 == want && !found { print u; found = 1 }')"
|
|
332
|
+
if [ -z "$url" ]; then
|
|
333
|
+
echo "::error::gitleaks release v${GITLEAKS_VERSION} has no asset $f"; exit 1
|
|
334
|
+
fi
|
|
335
|
+
fetch application/octet-stream "$url" "$tmp/$f"
|
|
336
|
+
done
|
|
337
|
+
# Verified before tar (#698): an error page, a truncated file or a wrong archive stops
|
|
338
|
+
# here, naming the file, instead of reaching tar — or, for a valid archive, the PATH.
|
|
339
|
+
want="$(awk -v f="$asset" '$2 == f { print $1 }' "$tmp/$sums")"
|
|
340
|
+
if command -v sha256sum >/dev/null; then got="$(sha256sum "$tmp/$asset" | awk '{ print $1 }')"
|
|
341
|
+
else got="$(shasum -a 256 "$tmp/$asset" | awk '{ print $1 }')"; fi # macOS self-hosted
|
|
342
|
+
if [ -z "$want" ]; then
|
|
343
|
+
echo "::error::$sums does not list $asset, so it cannot be verified"; exit 1
|
|
344
|
+
fi
|
|
345
|
+
if [ "$got" != "$want" ]; then
|
|
346
|
+
echo "::error::sha256 mismatch for $asset: got $got, $sums lists $want"; exit 1
|
|
347
|
+
fi
|
|
348
|
+
tar -xzf "$tmp/$asset" -C "$tmp" gitleaks
|
|
309
349
|
chmod +x "$tmp/gitleaks"
|
|
310
350
|
# One rename on one filesystem: a job sharing this tool cache sees no binary or a
|
|
311
351
|
# whole one, never half of one.
|
package/templates/ci-python.yml
CHANGED
|
@@ -274,6 +274,12 @@ jobs:
|
|
|
274
274
|
key: gitleaks-${{ env.GITLEAKS_VERSION }}-${{ runner.os }}-${{ runner.arch }}
|
|
275
275
|
|
|
276
276
|
- name: Install gitleaks (pinned release binary)
|
|
277
|
+
env:
|
|
278
|
+
# Authenticated (#698). Under load GitHub sheds ANONYMOUS release downloads first:
|
|
279
|
+
# measured 2026-11-09, ~90 min of instant 504s from github.com/…/releases/download,
|
|
280
|
+
# while the API asset path below answered 200 with the same file. The job's own token
|
|
281
|
+
# is enough — reading a public release needs an identity, not a permission.
|
|
282
|
+
GH_TOKEN: ${{ github.token }}
|
|
277
283
|
run: |
|
|
278
284
|
# Deliberately NOT gitleaks/gitleaks-action@v2: that action requires a paid
|
|
279
285
|
# GITLEAKS_LICENSE for repositories owned by an organization (free only for
|
|
@@ -309,14 +315,48 @@ jobs:
|
|
|
309
315
|
mkdir -p "$dir"
|
|
310
316
|
tmp="$(mktemp -d "$dir.XXXXXX")"
|
|
311
317
|
trap 'rm -rf "$tmp"' EXIT
|
|
318
|
+
asset="gitleaks_${GITLEAKS_VERSION}_${os}_${arch}.tar.gz"
|
|
319
|
+
sums="gitleaks_${GITLEAKS_VERSION}_checksums.txt"
|
|
320
|
+
# fetch <accept> <url> <file> — every request of this step, one curl line.
|
|
312
321
|
# --fail: on an HTTP error curl otherwise saves the error page and exits 0, and tar
|
|
313
322
|
# then fails with "not in gzip format", naming neither the download nor the host.
|
|
314
323
|
# --retry: a re-run during the same upstream error spends the one re-run branch CI
|
|
315
324
|
# allows, so a brief error is retried here first. A longer outage still fails, at
|
|
316
325
|
# curl, naming the status (#690).
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
326
|
+
# The token reaches api.github.com only: curl drops an -H Authorization header when
|
|
327
|
+
# the asset's 302 leads to another host, so the download CDN never sees it.
|
|
328
|
+
fetch() {
|
|
329
|
+
curl -fsSL --retry 5 --retry-delay 10 --retry-all-errors --connect-timeout 10 --max-time 120 \
|
|
330
|
+
-H "Authorization: Bearer ${GH_TOKEN}" -H "Accept: $1" -o "$3" "$2"
|
|
331
|
+
}
|
|
332
|
+
# The API serves an asset by id, not by name, so look the ids up in the release. No jq:
|
|
333
|
+
# a self-hosted runner need not have it. Splitting on , { [ leaves one key per line
|
|
334
|
+
# whether the JSON comes pretty or compact; within an asset, "url" precedes "name". Were
|
|
335
|
+
# that order ever to change, the wrong file would arrive and the sha256 check below
|
|
336
|
+
# would refuse it — a loud failure, never a wrong binary.
|
|
337
|
+
fetch application/vnd.github+json \
|
|
338
|
+
"https://api.github.com/repos/gitleaks/gitleaks/releases/tags/v${GITLEAKS_VERSION}" "$tmp/release.json"
|
|
339
|
+
for f in "$asset" "$sums"; do
|
|
340
|
+
url="$(tr ',{[' '\n\n\n' < "$tmp/release.json" | awk -F'"' -v want="$f" '
|
|
341
|
+
$2 == "url" && $4 ~ /\/releases\/assets\/[0-9]+$/ { u = $4 }
|
|
342
|
+
$2 == "name" && $4 == want && !found { print u; found = 1 }')"
|
|
343
|
+
if [ -z "$url" ]; then
|
|
344
|
+
echo "::error::gitleaks release v${GITLEAKS_VERSION} has no asset $f"; exit 1
|
|
345
|
+
fi
|
|
346
|
+
fetch application/octet-stream "$url" "$tmp/$f"
|
|
347
|
+
done
|
|
348
|
+
# Verified before tar (#698): an error page, a truncated file or a wrong archive stops
|
|
349
|
+
# here, naming the file, instead of reaching tar — or, for a valid archive, the PATH.
|
|
350
|
+
want="$(awk -v f="$asset" '$2 == f { print $1 }' "$tmp/$sums")"
|
|
351
|
+
if command -v sha256sum >/dev/null; then got="$(sha256sum "$tmp/$asset" | awk '{ print $1 }')"
|
|
352
|
+
else got="$(shasum -a 256 "$tmp/$asset" | awk '{ print $1 }')"; fi # macOS self-hosted
|
|
353
|
+
if [ -z "$want" ]; then
|
|
354
|
+
echo "::error::$sums does not list $asset, so it cannot be verified"; exit 1
|
|
355
|
+
fi
|
|
356
|
+
if [ "$got" != "$want" ]; then
|
|
357
|
+
echo "::error::sha256 mismatch for $asset: got $got, $sums lists $want"; exit 1
|
|
358
|
+
fi
|
|
359
|
+
tar -xzf "$tmp/$asset" -C "$tmp" gitleaks
|
|
320
360
|
chmod +x "$tmp/gitleaks"
|
|
321
361
|
# One rename on one filesystem: a job sharing this tool cache sees no binary or a
|
|
322
362
|
# whole one, never half of one.
|