[error] The process '/usr/bin/git' failed with exit code 128
See original GitHub issueI’m unable to get my changes
job to run which uses paths-filter
within it. It always fails with the following error:
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:
- Created 3 years ago
- Comments:9 (7 by maintainers)
Top 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 >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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @Hamza5 You are using the
checkout
action only in thebackend
job. In yourchanges
job, there is no checkout of the git repository. When thepaths-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
.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 aspaths-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.