Skip to content

Commit

Permalink
fix: mark working directory as safe for git commands
Browse files Browse the repository at this point in the history
Newer git versions - newer than 2.35.2 - complain due to a security patch. This patch is for multi-user systems or Windows machines. Fortunately, the issue isn't _really_ an issue for the CI use-case, so it is okay to mark the directory as safe.

See https://github.blog/2022-04-12-git-security-vulnerability-announced/ for more details.

Closes #25
  • Loading branch information
josegonzalez committed Aug 8, 2022
1 parent 519943f commit acdbab2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions bin/dokku-deploy
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ if [ -n "$DEPLOY_DOCKER_IMAGE" ]; then
ssh "$ssh_remote" -- git:from-image "$remote_app_name" "$DEPLOY_DOCKER_IMAGE" "$DEPLOY_USER_NAME" "$DEPLOY_USER_EMAIL"
else
log-info "Pushing to Dokku Host"
git config --global --add safe.directory "$PWD"
# shellcheck disable=SC2086
git push $GIT_PUSH_FLAGS "$GIT_REMOTE_URL" "$commit_sha:refs/heads/$BRANCH"
fi
1 change: 1 addition & 0 deletions bin/parse-ci-commit
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ elif [ -n "$TRAVIS_COMMIT" ]; then
# travisci
value="$TRAVIS_COMMIT"
else
git config --global --add safe.directory "$PWD"
value=$(git rev-parse HEAD 2>/dev/null || true)
fi

Expand Down

0 comments on commit acdbab2

Please sign in to comment.