Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default shell not being detected - currently treats all run on Linux as shell #409

Closed
ElvenSpellmaker opened this issue Mar 22, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@ElvenSpellmaker
Copy link

When using a default shell:

defaults:
  run:
    shell: pwsh

It's not being detected and actionlint is calling shellcheck on all runs without an explicit shell.

Ideally this would be taken into account and all run would use the default shell defined.

We use pwsh on Linux (as pwsh is cross-OS and a better scripting language than bash) so #315 isn't a solution of just branching workflows.

Relevant Issues: #315

@rhysd
Copy link
Owner

rhysd commented Mar 27, 2024

Would you share a minimal complete workflow which actionlint can cause the issue?

@rhysd rhysd added the bug Something isn't working label Mar 27, 2024
@rhysd
Copy link
Owner

rhysd commented Apr 4, 2024

I confirmed that this is a bug when actionlint fails to detect Windows runner from runs-on.

Reproduction:

on: push

defaults:
  run:
    shell: pwsh

jobs:
  test:
    strategy:
      matrix:
        os: [windows-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - run: |
          $Env:FOO = "FOO"

This doesn't reproduce when a Windows runner is directly set:

on: push

defaults:
  run:
    shell: pwsh

jobs:
  test:
    runs-on: windows-latest
    steps:
      - run: |
          $Env:FOO = "FOO"

@rhysd rhysd closed this as completed in f09672e Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants