-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
[UPSTREAM_BUG] Error: fatal: not in a git directory #10
Comments
it's happen to me too |
@Intrepidd Thanks for reporting this. This might be due to spec changes in Git v2.35.2. Other actions I am a collaborator of also have problems. We might be able to use the workaround in reviewdog/action-yamllint#19. I will try to investigate this at the weekend. |
Fabulous, thanks a lot |
I opened #11 if you want to take a look into it :) |
I forked and tried your fix, unfortunately still getting the same error. |
I have also tried this fix manually in my CI (as a step right before running |
@bakoontz2 and @Kobzol In my fork I did a change in the docker file too (I just updated the alpine version to the latest) after adding the change in the #11 and it worked, look here: tiagoalmeidadarosa@6bf19be |
Right, using a different git version is also probably a part of the cure. For me, CI broke when the Docker image started using |
@tiagoalmeidadarosa Sadly that didn't work for me. I followed the trail here and ended up hacking my build yaml:
But I certainly don't consider this a real fix. |
I quickly looked at the issue, and it seems to be caused by https://github.blog/2022-04-12-git-security-vulnerability-announced/. People came up with multiple workarounds in the last few days to fix this issue (this StackOverflow post). Two of these workarounds are found in #11, and #10 (comment) are two. A statement from the GitHub theme is found at actions/checkout#766. They already incorporated a fix for this in the GitHub/checkout action and are now looking for a fix at the actions ecosystem level. I think the best solution is to use the @Kobzol suggestion and temporarily fix the git version to I'm also happy to incorporate the workarounds given #11. Please let me know what you think is the best solution. |
@bakoontz2 did you try changing the docker alpine version as explained in #10 (comment)? Nonetheless, my preference still goes to temporary fixing the git version till the Github team fixes the issue upstream. I will, however, wait till tomorrow so that others can also give their two cents. |
@rickstaa Working on that fix now... |
Great! If you want to test a solution you can use https://github.com/rickstaa/action-test-repo/tree/test/action-create-tag for testing PR found in this repo (see rickstaa/action-test-repo#67). |
This commit applies a hotfix for the 'fatal: unsafe repository' error that was introduced in https://github.blog/2022-04-12-git-security-vulnerability-announced/. This fix can be removed when a upstream fix has been applied to the action ecosystem. See actions/checkout#766 and #10 for more information.
This commit applies a hotfix for the 'fatal: unsafe repository' error introduced in https://github.blog/2022-04-12-git-security-vulnerability-announced/. This fix can be removed when an upstream fix has been applied to the action ecosystem. See actions/checkout#766 and #10 for more information.
@bakoontz2 I tried pinning the GitHub version to fix this issue (see #12). I, however, was not able to create a working docker in the short amount of time I had available for fixing #10. I tested the @Intrepidd solution, and it seems to work on all my systems. For now, I will therefore merge #10 into the main branch. It is both the recommended workaround (see actions/checkout#766) and the solution used in the majority of actions affected by this bug. Can you please provide a reproducible example of why #10 is not working for you? Tests |
I applied #11 to the main branch please test it out. 🚀 |
I can confirm that it also works for me! (I also upgraded to checkout@v3, not sure if that's necessary). Thanks :) |
@bakoontz2 and @Kobzol, thanks a lot for letting me know! The fix should also work with |
This action has been workign flawlessly for months, thanks !
Since yesterday I now get the
fatal: not in a git directory
error when running the action. The action version has not changed so this may be an issue with github actions itself or something may have changed ?Message by @rickstaa
Https://github.blog/2022-04-12-git-security-vulnerability-announced/ introduced the problem above. A official statement of the GitHub team about this problem can be found here.
I applied workaround #11, provided by @Intrepidd, to the main branch. This is also the suggested workaround in actions/checkout#766. This fix can be removed in the future when a patch has been applied to the action ecosystem (See actions/checkout#766). I will keep this issue open until an upstream fix has been applied.
The text was updated successfully, but these errors were encountered: