Skip to content

Commit

Permalink
fix: remove credentials from git remote, if update fails (#253)
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Skowronek <[email protected]>
  • Loading branch information
patrickskowronekdkfz authored Dec 10, 2024
1 parent 45aefd2 commit e351036
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/update-bridgehead.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ for DIR in /etc/bridgehead $(pwd); do
OUT=$(retry 5 git -c http.proxy=$HTTPS_PROXY_FULL_URL -c https.proxy=$HTTPS_PROXY_FULL_URL -C $DIR fetch 2>&1 && retry 5 git -c http.proxy=$HTTPS_PROXY_FULL_URL -c https.proxy=$HTTPS_PROXY_FULL_URL -C $DIR pull 2>&1)
fi
if [ $? -ne 0 ]; then
report_error log "Unable to update git $DIR: $OUT"
OUT_SAN=$(echo $OUT | sed -E 's|://[^:]+:[^@]+@|://credentials@|g')
report_error log "Unable to update git $DIR: $OUT_SAN"
fi

new_git_hash="$(git -C $DIR rev-parse --verify HEAD)"
Expand Down

0 comments on commit e351036

Please sign in to comment.