From 435cbe7b1f2d8f276f701d1c35c0f82eec1a1106 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Mon, 7 Aug 2023 00:45:51 +0200 Subject: [PATCH] Keep track of the original .git/config path before running cd. --- .drone.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index a1c308254..9c9f70fbb 100644 --- a/.drone.yml +++ b/.drone.yml @@ -97,6 +97,11 @@ steps: commands: - apk add --update --no-cache git + + # Backup the original git configuration before changing attributes + - export GIT_CONF=$PWD/.git/config + - cp $GIT_CONF /tmp/git.config.orig + - git config --global --add safe.directory $PWD - cd platypush/backend/http/webapp - | @@ -135,8 +140,6 @@ steps: - chmod 0600 ~/.ssh/id_rsa - ssh-keyscan git.platypush.tech >> ~/.ssh/known_hosts 2>/dev/null - # Backup the original git configuration before changing name and email - - cp .git/config /tmp/git.config.orig - git config user.name "Platypush CI/CD Automation" - git config user.email "admin@platypush.tech" - git config commit.gpgsign true @@ -148,7 +151,7 @@ steps: - git push origin master # Restore the original git configuration - - mv /tmp/git.config.orig .git/config + - mv /tmp/git.config.orig $GIT_CONF - name: update-arch-packages image: python:3.11-alpine