mirror of
https://github.com/aljazceru/addons.git
synced 2025-12-17 21:24:20 +01:00
GitPull: add support for ssh cloned GitHub repositories (#241)
* disabled StrictHostKeyChecking during ssh key validation * adds support to (ssh cloned) github repositories on key validation * update Changelog and config.json
This commit is contained in:
committed by
Pascal Vizeli
parent
f22b2f5709
commit
17576219dc
@@ -60,11 +60,11 @@ if [ -n "$DEPLOYMENT_KEY" ]; then
|
||||
echo "Check SSH connection"
|
||||
IFS=':' read -ra GIT_URL_PARTS <<< "$REPOSITORY"
|
||||
# shellcheck disable=SC2029
|
||||
if ! ssh -T -o "BatchMode=yes" "${GIT_URL_PARTS[0]}"
|
||||
then
|
||||
echo "Valid SSH connection for ${GIT_URL_PARTS[0]}"
|
||||
DOMAIN="${GIT_URL_PARTS[0]}"
|
||||
if OUTPUT_CHECK=$(ssh -T -o "StrictHostKeyChecking=no" -o "BatchMode=yes" "$DOMAIN" 2>&1) || ([[ $DOMAIN = *"@github.com"* ]] && [[ $OUTPUT_CHECK = *"You've successfully authenticated"* ]]); then
|
||||
echo "Valid SSH connection for $DOMAIN"
|
||||
else
|
||||
echo "No valid SSH connection for ${GIT_URL_PARTS[0]}"
|
||||
echo "No valid SSH connection for $DOMAIN"
|
||||
add-ssh-key
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user