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

working-directory does not work as expected #153

Open
oriash93 opened this issue Nov 11, 2024 · 3 comments
Open

working-directory does not work as expected #153

oriash93 opened this issue Nov 11, 2024 · 3 comments

Comments

@oriash93
Copy link

Hello,

I have python code in two directories, for example: path1 and path2.
I am using this action with working-directory as follows:

name: CI

on:
  pull_request:
    branches:
      - "*"

jobs:
  ci:
    strategy:
      matrix:
        path: [path1, path2]
      fail-fast: false

    defaults:
      run:
        working-directory: ${{ matrix.path}}

    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: 3.11.10
          cache: pip
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install -r requirements.txt
      - name: Black
        uses: psf/black@stable
        with:
          src: ${{ matrix.path}}
      - name: Pyright
        uses: jakebailey/pyright-action@v2
        with:
          working-directory: ${{ matrix.path}}

Expected behavior:
pyright runs on the code in the specified directory.

Actual behavior:
pyright runs on all python code in the repository.

@jakebailey
Copy link
Owner

Can you link to a workflow run which shows the problem?

You're also specifying working-directory in two separate places, not sure what effect that will have. (Will it duplicate?)

@oriash93
Copy link
Author

oriash93 commented Nov 15, 2024

Can you link to a workflow run which shows the problem?

Not exactly, since it is a private repository.

You're also specifying working-directory in two separate places, not sure what effect that will have. (Will it duplicate?)

I am specifying it once as the default for all run commands.
The other places are for passing specific parameters to uses steps. The pyright step should use this parameter.

@EmreKaratopuk
Copy link

I can confirm that this issue is still present. I used the extra-args parameter as a workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants