-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 |
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 <[email protected]>
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 <[email protected]> Closes: #19 Signed-off-by: Arthur Zamarin <[email protected]>
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
Thanks for this. Adding a step to our job with For info, did a little experiment and added a step to print the
For reference, the upstream change to git that performs the "dubious ownership" check appears to be git/git@f4aa8c8 |
Add workaround for test-reporting issue [1169](actions/checkout#1169)
Split job into macOS and Ubuntu specific jobs Add concurrency setting to GHA so only one per branch will run at a time Update GH actions to their latest versions Replace setup-swift action with xcode-select-version-action and update to Xcode 16 on macOS Build tests when building package Use --skip testGetPullRequestsPerformance to not run long running tests Set TEST_GITHUB_TOKEN environment variable at the swift test level Update test-reporting path to new swift-testing results file path Add workaround for test-reporting issue [1169](actions/checkout#1169) Switch swift-testing package to use newly released v0.12.0 Update missed Swift Testing migration of XCTSkip to @suite(.disabled()) in EndpointTests Change testGetPullRequestsPerformance timeout to 3 minutes TODO: Collapse macOS and Ubuntu jobs back into one
Split job into macOS and Ubuntu specific jobs Add concurrency setting to GHA so only one per branch will run at a time Update GH actions to their latest versions Update GH runner to latest Swift Ubuntu image Update GH runner to macOS 15 Replace setup-swift action with xcode-select-version-action and update to Xcode 16 on macOS Build tests when building package Use --skip testGetPullRequestsPerformance to not run long running tests Set TEST_GITHUB_TOKEN environment variable at the swift test level Update test-reporting path to new swift-testing results file path Add workaround for test-reporting issue [1169](actions/checkout#1169) Switch swift-testing package to use newly released v0.12.0 Update missed Swift Testing migration of XCTSkip to @suite(.disabled()) in EndpointTests Change testGetPullRequestsPerformance timeout to 3 minutes TODO: Collapse macOS and Ubuntu jobs back into one
* test: Migrate to Swift Testing Add swift-testing package to project Upgrade devcontainer image to use nightly-6.0-jammy for swift-testing support on Linux Convert the following XCTests to Swift Testing: - RepoTests - EndpointSessionTests - EndpointTests Move EndpointTests performance test into new EndpointPerformanceTests XCTestCase Delete redundant GitHubStatsCore and associated XCTests * test: Update GHA jobs to support new Swift Testing Split job into macOS and Ubuntu specific jobs Add concurrency setting to GHA so only one per branch will run at a time Update GH actions to their latest versions Update GH runner to latest Swift Ubuntu image Update GH runner to macOS 15 Replace setup-swift action with xcode-select-version-action and update to Xcode 16 on macOS Build tests when building package Use --skip testGetPullRequestsPerformance to not run long running tests Set TEST_GITHUB_TOKEN environment variable at the swift test level Update test-reporting path to new swift-testing results file path Add workaround for test-reporting issue [1169](actions/checkout#1169) Switch swift-testing package to use newly released v0.12.0 Update missed Swift Testing migration of XCTSkip to @suite(.disabled()) in EndpointTests Change testGetPullRequestsPerformance timeout to 3 minutes TODO: Collapse macOS and Ubuntu jobs back into one
Instead of manually running the docker command to obtain the test image and run, setup the CI job to run all steps on the CI container image. This also set the current working directory as safe to workaround: actions/checkout#1169 Signed-off-by: Anderson Toshiyuki Sasaki <[email protected]>
Set the current working directory as safe to workaround: actions/checkout#1169 Signed-off-by: Anderson Toshiyuki Sasaki <[email protected]>
Any working arounds for this, I am seeing the same /github/home/.gitconfig doesn't exist message on Terraform-docs/gh-actions. |
Use a matrix with jobs in order to parallelize running different tools. The check for GITHUB_HEAD_REF is used so the same workflow works for PRs and for branches. We ignore some files with cppcheck due to issues with Catch2. An example of an error generated by cppcheck with Catch2: util/tests/bits-test.cc:36:5: error: There is an unknown macro here somewhere. Configuration is required. If _catch_sr is a macro then please configure it. [unknownMacro] CHECK_THROWS_AS(clear_and_insert(reg, 1000U, range_mask), std::runtime_error); The issue causing git-config(1) to be necessary is tracked in [1]. [1] actions/checkout#1169
Use a matrix with jobs in order to parallelize running different tools. The check for GITHUB_HEAD_REF is used so the same workflow works for PRs and for branches. We ignore some files with cppcheck due to issues with Catch2. An example of an error generated by cppcheck with Catch2: util/tests/bits-test.cc:36:5: error: There is an unknown macro here somewhere. Configuration is required. If _catch_sr is a macro then please configure it. [unknownMacro] CHECK_THROWS_AS(clear_and_insert(reg, 1000U, range_mask), std::runtime_error); The issue causing git-config(1) to be necessary is tracked in [1]. [1] actions/checkout#1169
Use a matrix with jobs in order to parallelize running different tools. The check for GITHUB_HEAD_REF is used so the same workflow works for PRs and for branches. We ignore some files with cppcheck due to issues with Catch2. An example of an error generated by cppcheck with Catch2: util/tests/bits-test.cc:36:5: error: There is an unknown macro here somewhere. Configuration is required. If _catch_sr is a macro then please configure it. [unknownMacro] CHECK_THROWS_AS(clear_and_insert(reg, 1000U, range_mask), std::runtime_error); The issue causing git-config(1) to be necessary is tracked in [1]. [1] actions/checkout#1169
Use a matrix with jobs in order to parallelize running different tools. The check for GITHUB_HEAD_REF is used so the same workflow works for PRs and for branches. We ignore some files with cppcheck due to issues with Catch2. An example of an error generated by cppcheck with Catch2: util/tests/bits-test.cc:36:5: error: There is an unknown macro here somewhere. Configuration is required. If _catch_sr is a macro then please configure it. [unknownMacro] CHECK_THROWS_AS(clear_and_insert(reg, 1000U, range_mask), std::runtime_error); The issue causing git-config(1) to be necessary is tracked in [1]. Meson supports a clang-tidy target of its own, but it's not really usable for our purposes [2]. [1] actions/checkout#1169 [2] mesonbuild/meson#2383
Use a matrix with jobs in order to parallelize running different tools. The check for GITHUB_HEAD_REF is used so the same workflow works for PRs and for branches. We ignore some files with cppcheck due to issues with Catch2. An example of an error generated by cppcheck with Catch2: util/tests/bits-test.cc:36:5: error: There is an unknown macro here somewhere. Configuration is required. If _catch_sr is a macro then please configure it. [unknownMacro] CHECK_THROWS_AS(clear_and_insert(reg, 1000U, range_mask), std::runtime_error); The issue causing git-config(1) to be necessary is tracked in [1]. Meson supports a clang-tidy target of its own, but it's not really usable for our purposes [2]. [1] actions/checkout#1169 [2] mesonbuild/meson#2383
Use a matrix with jobs in order to parallelize running different tools. The check for GITHUB_HEAD_REF is used so the same workflow works for PRs and for branches. We ignore some files with cppcheck due to issues with Catch2. An example of an error generated by cppcheck with Catch2: util/tests/bits-test.cc:36:5: error: There is an unknown macro here somewhere. Configuration is required. If _catch_sr is a macro then please configure it. [unknownMacro] CHECK_THROWS_AS(clear_and_insert(reg, 1000U, range_mask), std::runtime_error); The issue causing git-config(1) to be necessary is tracked in [1]. Meson supports a clang-tidy target of its own, but it's not really usable for our purposes [2]. [1] actions/checkout#1169 [2] mesonbuild/meson#2383
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: