diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bd85b7d5..aedde77f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,14 +11,20 @@ update_patched_master: - patched_changes script: - apk add --no-cache git - - git config user.name "$GITLAB_USER_NAME" - - git config user.email "$GITLAB_USER_EMAIL" - - echo "Setting remote URL with authentication..." - - git remote set-url origin https://oauth2:${CI_JOB_TOKEN}@git.haveno.com/${CI_PROJECT_PATH}.git - - echo "Fetching all branches..." - - git fetch --all - - echo "Resetting patched_master to patched_changes..." +stages: + - update_patched_master + +update_patched_master: + stage: update_patched_master + only: + - patched_changes + script: + - echo "Cloning repository locally..." + - git clone ${CI_PROJECT_DIR} /tmp/repo + - cd /tmp/repo + - echo "Checking out patched_master branch..." - git checkout patched_master || git checkout -b patched_master + - echo "Resetting patched_master to patched_changes..." - git reset --hard origin/patched_changes - - echo "Force-pushing patched_master to match patched_changes..." - - git push origin patched_master --force \ No newline at end of file + - echo "Pushing updated patched_master branch..." + - git push origin patched_master --force