Skip to content
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

Jenkinsfile: Add root repository and submodule repositories as safe directories #2449

Merged
merged 15 commits into from
Apr 18, 2022
10 changes: 10 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ try {
try {
stage("Setup") {
checkout scm

// During CI runs, the user is different from the owner of the directories, which blocks the execution of git
// commands since the fix of the git vulnerability CVE-2022-24765. git commands can then only be executed if
// the corresponding directories are added as safe directories.
sh '''
git config --global --add safe.directory $WORKSPACE
# Get the paths of the submodules; for each path, add it as a git safe.directory
grep path .gitmodules | sed 's/.*=//' | xargs -n 1 -I '{}' git config --global --add safe.directory $WORKSPACE/'{}'
'''

sh "./install_dependencies.sh"

cmake = 'cmake -DCI_BUILD=ON'
Expand Down