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
/github/home/.gitconfig does not exist for container runs #1169
Comments
* Print some debug information * Try potential fix Via actions/checkout#1169 (comment) * Would be great if I didn't fat-finger the fix, rip * Remove debug prints
At first I tried without |
slither-action had issue crytic/slither-action#50. Thanks. |
Summary: 1. Workaround for Debian Docker image bug that is breaking Debian build on GitHub (Explicitly mark Git repo as safe). 2. Pin zstd to a commit that resolves problems with older CMakes (note: affects all OSes, not just Debian) Context for 1: In latest Debian Docker image , there is a regression that affects the checkout action. From actions/checkout#1169: > - Checkout runs, and runs /usr/bin/git config --global --add safe.directory <path> > - The global .gitconfig does not exist > - Any calls to git remain unsafe/dubious The suggested workaround was to use --system instead of --global. Pull Request resolved: #200 Test Plan: See if GitHub Action Debian build is fixed. Reviewed By: therealgymmy Differential Revision: D43720363 Pulled By: jaesoo-fb fbshipit-source-id: 54f3586cc7f8e72045e60d8dd454c7a77725e6b2
Should note that the workaround described here is only for container runs |
Looks like there's a `git` bug with Github Actions: actions/checkout#1169. This commit implements the workaround described in the issue thread.
Looks like there's a `git` bug with Github Actions: actions/checkout#1169. This commit implements the workaround described in the issue thread.
Looks like there's a `git` bug with Github Actions: actions/checkout#1169. This commit implements the workaround described in the issue thread.
Summary: In D48757822, we added the safe directory to the system gitconfig. However, for native runs of workflows including Ubuntu-20 and Ubuntu-22, this does not work for permission error. (see actions/checkout#1169) This change fixes it by adding safe directory to global config instead. Reviewed By: therealgymmy Differential Revision: D48787452 fbshipit-source-id: dbe41ad42249e72d1c98e4af10ac977ba49b791d
FFR: Using the users opzion might help here for the related issue: |
pkgcheck uses git for some of it's checks, however, the github.workspace directory not being marked safe causes a failure See also: actions/checkout#1169 See also: https://github.com/pentoo/pentoo-overlay/actions/runs/7560749313/job/20587445443 Closes: pkgcore#18 Signed-of-by: Zero_Chaos <zerochaos@gentoo.org>
pkgcheck uses git for some of it's checks, however, the github.workspace directory not being marked safe causes a failure See also: actions/checkout#1169 See also: https://github.com/pentoo/pentoo-overlay/actions/runs/7560749313/job/20587445443 Closes: pkgcore#18 Signed-off-by: Zero_Chaos <zerochaos@gentoo.org>
pkgcheck uses git for some of it's checks, however, the github.workspace directory not being marked safe causes a failure See also: actions/checkout#1169 See also: https://github.com/pentoo/pentoo-overlay/actions/runs/7560749313/job/20587445443 Closes: #18 Signed-off-by: Zero_Chaos <zerochaos@gentoo.org> Closes: #19 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
I banged my head on what I think is this issue all day. Consider this config: name: Test Git
on:
push:
jobs:
bundle:
name: Git
runs-on: ubuntu-latest
container: alpine/git
steps:
- uses: actions/checkout@v4
- run: git archive -v --format zip --prefix foo/ --output foo.zip HEAD This results in this error:
Shouldn't we be able to do Git stuff with the repo in a container? Curious, I tried changing the last line to: - run: git config safe.directory It simply exits with no error message, as in this run:
Is that because the global config file is missing? I find it simply wild that there is no error message. Anyway, I then tried setting the global config: - run: git config --global --add safe.directory "$PWD" And that works. But I admit I'm pretty confused about why this isn't set up by default when an action starts. So fine, I can manually put this line into my workflow YAML files, but I'm mystified as to why it's necessary. Is it this issue or am I missing something? Thanks for bearing with my examples. |
FWIW I see the same error using actions/checkout@v3 in this build an using actions/checkout@v2 in this build. Color me confused. |
I'm fixing the issue in pgxn-tools by adding this line to the git config --system --add safe.directory '*' Is there any reason that is likely to be a security issue? |
…#19720) Closes #19712 This PR introduce a workaround for actions/runner#2033. This workaround was already introduced in #19703 in some of the jobs. `actions/checkout` has an issue filled about this too: actions/checkout#1169
Issue
If running a job that uses a container like the below, the file
/github/home/.gitconfig
will not exist, even after checkout runs a config command.Here is a demo:
/usr/bin/git config --global --add safe.directory /__w/sat/sat
The
safe.directory
settings set by the commandgit config --global --add safe.directory <path>
is a no-op.Workaround
Use the
--system
scope over--global
:$ git config --system --add safe.directory <path>
The text was updated successfully, but these errors were encountered: