Open Intrepidd opened 2 years ago
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 https://github.com/reviewdog/action-yamllint/pull/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 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 action-create-tag
) and it didn't help :/
@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: https://github.com/tiagoalmeidadarosa/action-create-tag/commit/6bf19be5aa9018f7d72463be24d1b66b546f9d10 Maybe it helps
Right, using a different git version is also probably a part of the cure. For me, CI broke when the Docker image started using 2.34.2-r0
instead of 2.34.1-r0
. Maybe it would be useful to pin the git version in the Dockerfile.
@tiagoalmeidadarosa Sadly that didn't work for me.
I followed the trail here and ended up hacking my build yaml:
- uses: actions/checkout@v2
- name: "Change perms on GITHUB_WORKSPACE"
run: |
sudo chown -R root:root $GITHUB_WORKSPACE
sudo chmod -R 0777 $GITHUB_WORKSPACE
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 https://github.com/rickstaa/action-create-tag/issues/10#issuecomment-1103134487 are two.
A statement from the GitHub theme is found at https://github.com/actions/checkout/issues/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 2.34.1-r0
.
I'm also happy to incorporate the workarounds given #11. Please let me know what you think is the best solution.
@rickstaa #11 didn't work for me, so I'm not sure what that will accomplish. Although I do find it amusing I have sudo access in a runner, and there doesn't seem to be any security issue with this.
@bakoontz2 did you try changing the docker alpine version as explained in https://github.com/rickstaa/action-create-tag/issues/10#issuecomment-1103101447? 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 https://github.com/rickstaa/action-test-repo/pull/67).
@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 https://github.com/actions/checkout/issues/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?
I applied #11 to the main branch please test it out. š
@rickstaa I test v1.3.0 (which I believe has #11 applied), and all is working again. Thank you!
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 checkout@v2
. I added checkout@v3
to the README to be sure people do not get this error for other steps in the same job (see https://github.com/actions/checkout/issues/766).
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 https://github.com/actions/checkout/issues/766. This fix can be removed in the future when a patch has been applied to the action ecosystem (See https://github.com/actions/checkout/issues/766). I will keep this issue open until an upstream fix has been applied.