workflows: Fix Gitlab CI trigger + revert debug

Previous implementation added single quotes to the git command which
made it not trigger the Gitlab CI at all. Changing it to clasic bash if
condition.
This commit is contained in:
Jakub Rusz 2022-03-18 13:47:59 +01:00 committed by Ondřej Budai
parent 2023f7731d
commit 46a79a48da

View file

@ -76,7 +76,6 @@ jobs:
- name: Push to gitlab
run: |
set -x
mkdir -p ~/.ssh
echo "${SCHUTZBOT_SSH_KEY}" > ~/.ssh/id_rsa
chmod 400 ~/.ssh/id_rsa
@ -84,5 +83,8 @@ jobs:
ssh-keyscan -t rsa gitlab.com >> ~/.ssh/known_hosts
git remote add ci git@gitlab.com:osbuild/ci/osbuild-composer.git
SKIP_CI=$(cat SKIP_CI.txt)
[[ "${SKIP_CI}" == true ]] && PUSH_OPTION='-o ci.variable="SKIP_CI=true"' || PUSH_OPTION=""
git push -f ${PUSH_OPTION} ci
if [[ "${SKIP_CI}" == true ]];then
git push -f -o ci.variable="SKIP_CI=true" ci
else
git push -f ci
fi