From ff5b1214151ff3619b9b01d9d1c2e5093c0b51d2 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Tue, 28 Jul 2026 17:42:52 +1200 Subject: [PATCH 1/2] ci: inline Alpine node setup to fix flaky linux-musl CI The "Initialize Alpine Linux" step piped a network-fetched script (curl raw.githubusercontent.com | sudo bash) straight into a shell. When the fetch was rate-limited or truncated, the partial/error body was executed instead, failing with "syntax error near unexpected token 'newline'". This flaked on almost every push. The step runs before checkout (checkout is a JavaScript action that needs node symlinked first), so the script can't be read from the working tree. Inline it directly into the workflow instead, removing the network dependency entirely. The now-unused setup-node.sh is deleted. Fixes #5408 Co-Authored-By: Claude Opus 4.8 --- .github/alpine/setup-node.sh | 12 ------------ .github/workflows/build.yml | 30 ++++++++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 14 deletions(-) delete mode 100755 .github/alpine/setup-node.sh diff --git a/.github/alpine/setup-node.sh b/.github/alpine/setup-node.sh deleted file mode 100755 index f0e942f58a..0000000000 --- a/.github/alpine/setup-node.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# A workaround for "JavaScript Actions in Alpine containers are only supported on x64 Linux runners." -# https://github.com/actions/runner/blob/8a9b96806d12343f7d123c669e29c629138023dd/src/Runner.Worker/Handlers/StepHost.cs#L283-L290 -if [ "$(uname -m)" != "x86_64" ]; then - for node in /__e/node*; do - mkdir -p $node/bin - ln -s /usr/bin/node $node/bin/node - ln -s /usr/bin/npm $node/bin/npm - done - sed -i 's/ID=alpine/ID=unknown/' /usr/lib/os-release -fi diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 073a38c948..b7d95a2aad 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,8 +44,21 @@ jobs: steps: - name: Initialize Alpine Linux if: ${{ contains(matrix.container.image, 'alpine') }} + # A workaround for "JavaScript Actions in Alpine containers are only supported on x64 Linux runners." + # https://github.com/actions/runner/blob/8a9b96806d12343f7d123c669e29c629138023dd/src/Runner.Worker/Handlers/StepHost.cs#L283-L290 + # Inlined rather than fetched over the network: this step runs before checkout (checkout is itself a + # JavaScript action that needs node symlinked first), so it can't be read from the working tree, and + # piping a curl download straight into a shell made CI flaky when the fetch was rate-limited or + # truncated. See https://github.com/getsentry/sentry-dotnet/issues/5408. run: | - curl -sSL https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/.github/alpine/setup-node.sh | sudo bash /dev/stdin + if [ "$(uname -m)" != "x86_64" ]; then + for node in /__e/node*; do + sudo mkdir -p "$node/bin" + sudo ln -s /usr/bin/node "$node/bin/node" + sudo ln -s /usr/bin/npm "$node/bin/npm" + done + sudo sed -i 's/ID=alpine/ID=unknown/' /usr/lib/os-release + fi - name: Checkout uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 @@ -108,8 +121,21 @@ jobs: steps: - name: Initialize Alpine Linux if: ${{ contains(matrix.container.image, 'alpine') }} + # A workaround for "JavaScript Actions in Alpine containers are only supported on x64 Linux runners." + # https://github.com/actions/runner/blob/8a9b96806d12343f7d123c669e29c629138023dd/src/Runner.Worker/Handlers/StepHost.cs#L283-L290 + # Inlined rather than fetched over the network: this step runs before checkout (checkout is itself a + # JavaScript action that needs node symlinked first), so it can't be read from the working tree, and + # piping a curl download straight into a shell made CI flaky when the fetch was rate-limited or + # truncated. See https://github.com/getsentry/sentry-dotnet/issues/5408. run: | - curl -sSL https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/.github/alpine/setup-node.sh | sudo bash /dev/stdin + if [ "$(uname -m)" != "x86_64" ]; then + for node in /__e/node*; do + sudo mkdir -p "$node/bin" + sudo ln -s /usr/bin/node "$node/bin/node" + sudo ln -s /usr/bin/npm "$node/bin/npm" + done + sudo sed -i 's/ID=alpine/ID=unknown/' /usr/lib/os-release + fi - name: Cancel Previous Runs if: github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') From d8fe83ab4f44bc8d1193a738416844c83308ba1e Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Wed, 29 Jul 2026 11:00:10 +1200 Subject: [PATCH 2/2] Tweak comments (move detail to the PR description) Co-authored-by: James Crosswell --- .github/workflows/build.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b7d95a2aad..f6ea82168e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,12 +44,8 @@ jobs: steps: - name: Initialize Alpine Linux if: ${{ contains(matrix.container.image, 'alpine') }} - # A workaround for "JavaScript Actions in Alpine containers are only supported on x64 Linux runners." - # https://github.com/actions/runner/blob/8a9b96806d12343f7d123c669e29c629138023dd/src/Runner.Worker/Handlers/StepHost.cs#L283-L290 - # Inlined rather than fetched over the network: this step runs before checkout (checkout is itself a - # JavaScript action that needs node symlinked first), so it can't be read from the working tree, and - # piping a curl download straight into a shell made CI flaky when the fetch was rate-limited or - # truncated. See https://github.com/getsentry/sentry-dotnet/issues/5408. + # Enable JavaScript Actions in Alpine containers on Arm64 runners + # See https://github.com/getsentry/sentry-dotnet/pull/5455 run: | if [ "$(uname -m)" != "x86_64" ]; then for node in /__e/node*; do @@ -121,12 +117,8 @@ jobs: steps: - name: Initialize Alpine Linux if: ${{ contains(matrix.container.image, 'alpine') }} - # A workaround for "JavaScript Actions in Alpine containers are only supported on x64 Linux runners." - # https://github.com/actions/runner/blob/8a9b96806d12343f7d123c669e29c629138023dd/src/Runner.Worker/Handlers/StepHost.cs#L283-L290 - # Inlined rather than fetched over the network: this step runs before checkout (checkout is itself a - # JavaScript action that needs node symlinked first), so it can't be read from the working tree, and - # piping a curl download straight into a shell made CI flaky when the fetch was rate-limited or - # truncated. See https://github.com/getsentry/sentry-dotnet/issues/5408. + # Enable JavaScript Actions in Alpine containers on Arm64 runners + # See https://github.com/getsentry/sentry-dotnet/pull/5455 run: | if [ "$(uname -m)" != "x86_64" ]; then for node in /__e/node*; do