question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[error] The process '/usr/bin/git' failed with exit code 128

See original GitHub issue

I’m unable to get my changes job to run which uses paths-filter within it. It always fails with the following error:

Screenshot 2020-07-16 11 09 05

My workflow looks like this:

name: Deploy API server
on:
  push:
    branches: [master]

jobs:
  changes:
    runs-on: ubuntu-latest
    # Set job outputs to values from filter step
    outputs:
      apiServer: ${{ steps.filter.outputs.apiServer }}
    steps:
    - name: Checkout source code
      uses: actions/checkout@v1

    - name: Check for changes
      uses: dorny/paths-filter@v2.2.0
      id: filter
      with:
        filters: |
          apiServer:
            - 'packages/api-server/**/*'

  tests:
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: packages/api-server

    if: ${{ needs.changes.outputs.apiServer == 'true' }}
    steps:
    - name: Checkout source code
      uses: actions/checkout@v1

    - name: Use Node.js 12.x
      uses: actions/setup-node@v1
      with:
        node-version: "12.x"

    - name: Install dependencies
      run: yarn

    - name: Tests
      run: yarn test

I don’t know if it’s paths-filter that’s causing it but thought I’ll open this issue just in case it helps.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
dornycommented, May 16, 2021

Hi @Hamza5 You are using the checkout action only in the backend job. In your changes job, there is no checkout of the git repository. When the paths-filter action is executed, there’s just an empty folder. That’s why you see the error: fatal: not a git repository (or any of the parent directories): .git.

It should work fine when the workflow is triggered by a pull request event. But it can’t work for push events - detecting changes in push events requires checkout of the repository.

So the solution is simple - just add the checkout step before paths-filter.

3reactions
dornycommented, Jul 16, 2020

I would say the issue is you are using v1 of the checkout action: uses: actions/checkout@v1. It doesn’t persist git authentication token so as paths-filter is trying to fetch additional commit, git command interactively asks for username/password which causes the error.

Please try it with uses: actions/checkout@v2 and let me know if it solved the issue. Anyway I should improve the documentation and error message for this case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: The process '/usr/bin/git' failed with exit code 128 · Issue ...
"This ERROR is caused when you have an Environment Variable called GIT_EXEC_PATH." ...
Read more >
VSTS Git Fetch Failed with exit code: 128 - Stack Overflow
Another possible cause of the "Git fetch failed with exit code: 128" error message - it happened to us for pull requests builds...
Read more >
Build fails with "Git fetch failed with exit code: 128" error with ...
During the get sources step of the build it is configured to fetch the git repository from bitbucket (https://bitbucket.org//provident/pm.com is the repo url)....
Read more >
GitHub Action: The process '/usr/bin/git' failed with exit code 128
温故而知新。
Read more >
Git failed with exit code 128 - Sublime Merge
Git failed with exit code 128 · Download and install the latest version of Git for Windows · If this does not solve...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found