dorny/paths-filter

Error: Unable to locate executable file: git

Opened this issue ยท 5 comments

I use this in my github action:

      # Check for changes in the server component of the Archimate model
      - uses: dorny/paths-filter@v2
        id: changes
        with:
          filters: |
            archi:
              - 'docs/invite.archimate'
            server:
              - 'server/src/**'

This was working fine previously, but now the github action complains about missing the git executable:

Run dorny/paths-filter@v2
Get current git ref
Error: Unable to locate executable file: git. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.

@phavekes This action expects the git executable to be available in the PATH. Which runner do you use? Can you write here value of runs-on field of your job?

@dorny I'm using v3 and getting this error as well.

Get current git ref
  /usr/bin/git branch --show-current
  fatal: not a git repository (or any of the parent directories): .git
Error: The process '/usr/bin/git' failed with exit code 128
image
jobs:
  changes:
    runs-on: ubuntu-latest
    permissions:
      pull-requests: read
    outputs:
      ...
    steps:
      - uses: dorny/paths-filter@v3
        id: filter
        with:
          filters: |
            ...

What's weird is this is working for me on a pull_request trigger, but it's not working on a push trigger. Could this be github not providing git in the path for push triggers?

I'm having the same issue as @wweaver, works fine on PR not after merge with an almost identical yaml. Git is in path as you can see:
fatal: not a git repository (or any of the parent directories): .git

That is output from git.

Adding checkout such as:

      - uses: actions/checkout@v4
      - uses: dorny/paths-filter@v3
        id: filter
        ....

solved it...

Having this same issue when using act to test CI locally -> https://github.com/nektos/act