Yikun opened a new pull request, #37079:
URL: https://github.com/apache/spark/pull/37079

   ### What changes were proposed in this pull request?
   This patch add GITHUB_WORKSPACE to git trust safe.directory for container 
based job.
   
   There are 3 container based job in Spark Infra:
   - sparkr
   - lint
   - pyspark
   
   ### Why are the changes needed?
   
   ```
   docker run -ti dongjoon/apache-spark-github-action-image:20220207 bash
   root@41ec70d3df9d:/# git version
   git version 2.25.1
   ```
   
   When upgrade `git >= 2.35.2` (such as latest dev docker image in my case), 
fix a 
[CVE-2022-24765](https://github.blog/2022-04-12-git-security-vulnerability-announced/#cve-2022-24765)
 , and it has been backported [ubuntu 
git](https://github.com/actions/checkout/issues/760#issuecomment-1099355820)
   
   The `GITHUB_WORKSPACE` is belong to action user (in host), but the container 
user is `root` (in container) (root is required in our spark job), so cause the 
error like:
   ```
   fatal: unsafe repository ('/__w/spark/spark' is owned by someone else)
   To add an exception for this directory, call:
       git config --global --add safe.directory /__w/spark/spark
   fatal: unsafe repository ('/__w/spark/spark' is owned by someone else)
   To add an exception for this directory, call:
       git config --global --add safe.directory /__w/spark/spark
   ```
   
   The solution is from `action/checkout` 
https://github.com/actions/checkout/issues/760 , just add `GITHUB_WORKSPACE` to 
git trust safe.directory to make container user can checkout successfully.
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   
   ### How was this patch tested?
   CI passed.
   CI passed with latest ubuntu hosted runner, here is a simple e2e test for 
pyspark job https://github.com/apache/spark/pull/37005
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to