From 903082c3caca53614d47c4652114245ddd99ec40 Mon Sep 17 00:00:00 2001 From: WinterMyst Date: Sun, 22 Sep 2024 19:32:23 +0200 Subject: [PATCH] g --- .gitlab-ci.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9ee9eab..60687b2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -38,19 +38,18 @@ release: - mkdir -p ~/.ssh - chmod 700 ~/.ssh # Decode and set up the SSH private key - - | - printf '%s' $SSH_PRIVATE_KEY_ENCODED | tr -d '\r\n' | base64 --decode > ~/.ssh/id_rsa - if [ $? -ne 0 ]; then + - echo $SSH_PRIVATE_KEY_ENCODED | tr -d '\r\n' | base64 --decode > ~/.ssh/id_rsa + - if [ $? -ne 0 ]; then echo "Error: Failed to decode SSH_PRIVATE_KEY_BASE64." exit 1 fi - # Verify the key file - if [ ! -s ~/.ssh/id_rsa ]; then + # Verify the key file + - if [ ! -s ~/.ssh/id_rsa ]; then echo "Error: SSH private key file is empty or does not exist." exit 1 fi - ssh-keygen -y -f ~/.ssh/id_rsa > /dev/null - if [ $? -ne 0 ]; then + - ssh-keygen -y -f ~/.ssh/id_rsa > /dev/null + - if [ $? -ne 0 ]; then echo "Error: Invalid SSH private key." exit 1 fi