Skip to content

Commit 8829adc

Browse files
committed
ci: fix github rate limit
1 parent 7b348ca commit 8829adc

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

.github/actions/node/action.yml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,44 @@ runs:
1919
inputs.version }}
2020
check-latest: true
2121
registry-url: ${{ inputs.registry-url || 'https://registry.npmjs.org' }}
22+
# Avoid GitHub REST API tag lookups (api.github.com/.../git/refs/tags) which can hit installation rate limits
23+
# in large orgs / high-parallelism workflows. Instead, use a direct release asset URL.
24+
#
25+
# Note: setup-bun's `bun-download-url` skips its own AVX2 detection, so we do a minimal check ourselves for
26+
# Linux x64 (fallback to baseline build when AVX2 isn't present).
27+
- id: bun-download-url
28+
run: |
29+
set -euo pipefail
30+
31+
BUN_VERSION="1.3.1"
32+
33+
case "${RUNNER_OS}:${RUNNER_ARCH}" in
34+
Linux:X64)
35+
ASSET="bun-linux-x64.zip"
36+
if ! grep -qiE '(^|\\s)avx2(\\s|$)' /proc/cpuinfo; then
37+
ASSET="bun-linux-x64-baseline.zip"
38+
fi
39+
;;
40+
Linux:ARM64)
41+
ASSET="bun-linux-aarch64.zip"
42+
;;
43+
macOS:X64)
44+
ASSET="bun-darwin-x64.zip"
45+
;;
46+
macOS:ARM64)
47+
ASSET="bun-darwin-aarch64.zip"
48+
;;
49+
Windows:X64)
50+
ASSET="bun-windows-x64.zip"
51+
;;
52+
*)
53+
echo "Unsupported runner: ${RUNNER_OS}/${RUNNER_ARCH}" >&2
54+
exit 1
55+
;;
56+
esac
57+
58+
echo "url=https://github.com/oven-sh/bun/releases/download/bun-v${BUN_VERSION}/${ASSET}" >> "$GITHUB_OUTPUT"
59+
shell: bash
2260
- uses: oven-sh/setup-bun@3d267786b128fe76c2f16a390aa2448b815359f3 # v2.1.2
2361
with:
24-
bun-version: "1.3.1"
62+
bun-download-url: ${{ steps.bun-download-url.outputs.url }}

0 commit comments

Comments
 (0)