Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/windows.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pkg/workflow/jobs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,8 @@ func TestRenderStepForRunner(t *testing.T) {
"${{ steps.wsl_setup_node.outputs.node-version }}",
"SHASUMS256.txt.asc",
"gpgv --keyring",
"# runner-guard:ignore RGS-006 --",
"# runner-guard:ignore RGS-012 --",
"https://raw.githubusercontent.com/nodejs/release-keys/481637f813e912c4aa3622d7964ab426c97b8e8d/gpg/pubring.kbx",
"ln -sfn \"$install_dir\" /usr/local/lib/nodejs/current",
`export PATH="/usr/local/lib/nodejs/current/bin:$PATH"`,
Expand Down
2 changes: 2 additions & 0 deletions pkg/workflow/windows_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ func windowsWSLNodeBootstrapStep(nodeSetupID string) string {
GH_AW_WSL_NODE_VERSION: ${{ steps.%s.outputs.node-version }}
run: |
$ErrorActionPreference = 'Stop'
# runner-guard:ignore RGS-006 -- downloads are written to a staging directory and never piped to a shell; the Node.js archive is only extracted after gpgv verifies the signed SHASUMS256 manifest and sha256sum matches.
# runner-guard:ignore RGS-012 -- GET-only downloads from nodejs.org and a commit-pinned nodejs/release-keys keyring; no secrets or job data are sent in the requests.
$env:WSLENV = 'RUNNER_TEMP/p:GH_AW_WSL_NODE_VERSION'
& wsl.exe --distribution Ubuntu --user root --exec bash -lc 'set -euo pipefail; version="${GH_AW_WSL_NODE_VERSION#v}"; if ! [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "Invalid WSL Node.js version." >&2; exit 1; fi; archive="node-v${version}-linux-x64.tar.xz"; staging="$(mktemp -d)"; trap ''rm -rf "$staging"'' EXIT; curl -fsSL "https://nodejs.org/dist/v${version}/$archive" -o "$staging/$archive"; curl -fsSL "https://nodejs.org/dist/v${version}/SHASUMS256.txt.asc" -o "$staging/SHASUMS256.txt.asc"; curl -fsSL "https://raw.githubusercontent.com/nodejs/release-keys/481637f813e912c4aa3622d7964ab426c97b8e8d/gpg/pubring.kbx" -o "$staging/nodejs-release-keyring.kbx"; gpgv --keyring "$staging/nodejs-release-keyring.kbx" --output "$staging/SHASUMS256.txt" "$staging/SHASUMS256.txt.asc"; cd "$staging"; grep -F " $archive" SHASUMS256.txt | sha256sum -c -; install_dir="/usr/local/lib/nodejs/node-v${version}-linux-x64"; mkdir -p "$install_dir"; tar -xJf "$archive" -C "$install_dir" --strip-components=1; ln -sfn "$install_dir" /usr/local/lib/nodejs/current; ln -sfn "$install_dir/bin/node" /usr/local/bin/node; ln -sfn "$install_dir/bin/npm" /usr/local/bin/npm; ln -sfn "$install_dir/bin/npx" /usr/local/bin/npx'
if ($LASTEXITCODE -ne 0) { throw 'WSL could not install the pinned Linux Node.js runtime.' }
Expand Down
Loading