From f757003a62ae918f3b54d5d9b10465cdcd068161 Mon Sep 17 00:00:00 2001
From: jaseg <git@jaseg.de>
Date: Wed, 18 Nov 2020 14:26:07 +0100
Subject: Fix CI auto-push

---
 .gitlab-ci.yml      | 3 +++
 tools/do_release.sh | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e2960aa..6fee2cb 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -19,3 +19,6 @@ release:
         - gitlab-release --zip "release-${CI_COMMIT_TAG}.zip" *
     only:
         - tags
+        - /^v-nightly-.*$/
+    except:
+        - schedules
diff --git a/tools/do_release.sh b/tools/do_release.sh
index 78e76b7..f24eaf6 100644
--- a/tools/do_release.sh
+++ b/tools/do_release.sh
@@ -69,7 +69,7 @@ git tag -a "v-productdb-$PRODUCTDB_VERSION" -m "Auto-release for STM32 Product D
 if [ ! -z ${GITLAB_ACCESS_TOKEN+x} ]; then
     echo "Access token found, pushing commit and tags"
     git remote add -f ci-origin https://oauth2:${GITLAB_ACCESS_TOKEN}@gitlab.com/${CI_PROJECT_PATH}
-    git push --tags --force ci-origin release
+    git push --tags --force ci-origin HEAD:release
 else
     echo "No access token found. Not pushing anything."
 fi
-- 
cgit