pyright-action icon indicating copy to clipboard operation
pyright-action copied to clipboard

`working-directory` does not work as expected

Open oriash93 opened this issue 1 year ago • 3 comments

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.

oriash93 avatar Nov 11 '24 09:11 oriash93

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?)

jakebailey avatar Nov 11 '24 19:11 jakebailey

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.

oriash93 avatar Nov 15 '24 09:11 oriash93

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

EmreKaratopuk avatar Dec 03 '24 12:12 EmreKaratopuk