run npx pointing to the specific commit SHA (#17970)

Co-authored-by: Bryan Morgan <bryanmorgan@google.com>
This commit is contained in:
Sehoon Shon
2026-01-30 14:42:29 -05:00
committed by GitHub
parent d1cd69a20d
commit 12531a06f8

View File

@@ -179,12 +179,16 @@ jobs:
- name: 'Smoke test npx installation'
run: |
# Create a temporary directory to avoid picking up local node_modules
mkdir -p ../npx-test
cd ../npx-test
# Run npx pointing to the checkout directory. This simulates a user
# installing the package from a git reference.
npx ${{ github.workspace }} --version
# 1. Package the project into a tarball
TARBALL=$(npm pack | tail -n 1)
# 2. Move to a fresh directory for isolation
mkdir -p ../smoke-test-dir
mv "$TARBALL" ../smoke-test-dir/
cd ../smoke-test-dir
# 3. Run npx from the tarball
npx "./$TARBALL" --version
- name: 'Wait for file system sync'
run: 'sleep 2'
@@ -263,12 +267,16 @@ jobs:
- name: 'Smoke test npx installation'
run: |
# Create a temporary directory to avoid picking up local node_modules
mkdir -p ../npx-test
cd ../npx-test
# Run npx pointing to the checkout directory. This simulates a user
# installing the package from a git reference.
npx ${{ github.workspace }} --version
# 1. Package the project into a tarball
TARBALL=$(npm pack | tail -n 1)
# 2. Move to a fresh directory for isolation
mkdir -p ../smoke-test-dir
mv "$TARBALL" ../smoke-test-dir/
cd ../smoke-test-dir
# 3. Run npx from the tarball
npx "./$TARBALL" --version
- name: 'Wait for file system sync'
run: 'sleep 2'
@@ -416,12 +424,17 @@ jobs:
- name: 'Smoke test npx installation'
run: |
# Create a temporary directory to avoid picking up local node_modules
New-Item -ItemType Directory -Force -Path ../npx-test
Set-Location ../npx-test
# Run npx pointing to the checkout directory. This simulates a user
# installing the package from a git reference.
npx ${{ github.workspace }} --version
# 1. Package the project into a tarball
$PACK_OUTPUT = npm pack
$TARBALL = $PACK_OUTPUT[-1]
# 2. Move to a fresh directory for isolation
New-Item -ItemType Directory -Force -Path ../smoke-test-dir
Move-Item $TARBALL ../smoke-test-dir/
Set-Location ../smoke-test-dir
# 3. Run npx from the tarball
npx "./$TARBALL" --version
shell: 'pwsh'
ci: