This is an automated email from the ASF dual-hosted git repository. gurwls223 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push: new ecbfff0efe2 [SPARK-39610][INFRA] Add GITHUB_WORKSPACE to git trust safe.directory for container based job ecbfff0efe2 is described below commit ecbfff0efe2ba92068554e1434d90ec6dbec8248 Author: Yikun Jiang <yikunk...@gmail.com> AuthorDate: Tue Jul 5 20:54:07 2022 +0900 [SPARK-39610][INFRA] Add GITHUB_WORKSPACE to git trust safe.directory for container based job ### 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? 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 [latest 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 Closes #37079 from Yikun/SPARK-39610. Authored-by: Yikun Jiang <yikunk...@gmail.com> Signed-off-by: Hyukjin Kwon <gurwls...@apache.org> --- .github/workflows/build_and_test.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index ef2235c3749..ca375be2777 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -289,6 +289,9 @@ jobs: fetch-depth: 0 repository: apache/spark ref: ${{ inputs.branch }} + - name: Add GITHUB_WORKSPACE to git trust safe.directory + run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} - name: Sync the current branch with the latest in Apache Spark if: github.repository != 'apache/spark' run: | @@ -374,6 +377,9 @@ jobs: fetch-depth: 0 repository: apache/spark ref: ${{ inputs.branch }} + - name: Add GITHUB_WORKSPACE to git trust safe.directory + run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} - name: Sync the current branch with the latest in Apache Spark if: github.repository != 'apache/spark' run: | @@ -439,6 +445,9 @@ jobs: fetch-depth: 0 repository: apache/spark ref: ${{ inputs.branch }} + - name: Add GITHUB_WORKSPACE to git trust safe.directory + run: | + git config --global --add safe.directory ${GITHUB_WORKSPACE} - name: Sync the current branch with the latest in Apache Spark if: github.repository != 'apache/spark' run: | --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org