shawnblais
shawnblais

Reputation: 1248

GitHub Actions with a Self Hosted Windows-Runner "File not found: 'bash'"

I'm trying to write a Composite Run Step Action that runs on all platforms, including Windows.

runs:
  using: "composite"
  steps:
    - run: flutter pub get
      working-directory: ${{ inputs.working-dir }}

When I omit shell, I get the error "Required parameter shell missing". This is odd, since I just want to use the default of the OS.

When I specify 'bash' I get an error file not found 'bash' on my Windows runners, though according to the docs "When specifying a bash shell on Windows, the bash shell included with Git for Windows is used." https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell

I just want to run flutter pub get on all platforms from an action, using the default shell. Is there some simple way to accomplish this?

Upvotes: 1

Views: 5057

Answers (1)

riQQ
riQQ

Reputation: 12863

Make sure that the folder containing the bash executable is in the PATH environment variable of the Windows user that is running the GitHub Actions runner. The documentation you're referencing is about runners hosted by GitHub.

You get an error because shell is required for composite run actions. The reason is that, besides very simple scripts, you won't be able to run a script in different shells because of their big differences.

See also the docs

Upvotes: 2

Related Questions