[ci] fix git checkout for CI jobs (fixes #5151) #5152
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #5151.
A security vulnerability was recently discovered in
git
, where the use of global git config files likeC:\.git\config
could allow one user to run arbitrary code as another user. Detailed at https://github.blog/2022-04-12-git-security-vulnerability-announced/.As reported in actions/checkout#760, something in the combination of how the
checkout
GitHub Action works, how containerized GitHub Actions jobs work, and the security patches published to newer versions ofgit
is causing LightGBM's containerized CI jobs on GitHub Actions to fail.This PR proposes fixing that issue by explicitly telling
git
to trust the directory thecheckout
action clones into.Notes for Reviewers
I hope we'll be able to revert this in the future if/when there is a change to https://github.com/actions/checkout. Just putting up this PR for now to unblock development on the project.