Skip to content

exec doesn't resolve Windows .cmd/.bat files from the PATH #218

@ericsciple

Description

@ericsciple

Describe the bug

exec.exec('npm --version') does not work on Windows.

To Reproduce

name: CI
on: [push]
jobs:
  build:
    runs-on: windows-latest
    steps:
      - shell: cmd
        run: |
          echo Verify npm is in the PATH:
          where npm
          echo ----------------------------------------
          echo Invoking "npm --version" works on the command line:
          call npm --version
          echo ----------------------------------------
          echo Installing @actions/exec
          call npm install @actions/exec ./
          echo ----------------------------------------
          echo Invoking "npm --version" using @actions/exec fails:
          node -e "var exec = require('@actions/exec'); exec.exec('npm --version');"

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions