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

Error: Unable to locate executable file: git #212

Open
phavekes opened this issue Jan 8, 2024 · 5 comments
Open

Error: Unable to locate executable file: git #212

phavekes opened this issue Jan 8, 2024 · 5 comments

Comments

@phavekes
Copy link

phavekes commented Jan 8, 2024

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.
@dorny
Copy link
Owner

dorny commented Jan 27, 2024

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

@wweaver
Copy link

wweaver commented Feb 22, 2024

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

@corroleaus
Copy link

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.

@corroleaus
Copy link

Adding checkout such as:

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

solved it...

@jaisal1024
Copy link

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

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

5 participants