From 4a32feeb74ddd2613fead17e41bb535fe1e5b5dc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joan=20Vallv=C3=A9=20Navarro?= <jvallve@iri.upc.edu>
Date: Fri, 19 Nov 2021 16:34:06 +0100
Subject: [PATCH] Update .gitlab-ci.yml file

---
 .gitlab-ci.yml | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a396d7956..40bef073d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -21,6 +21,11 @@
   - apt-get update
 
 .license_header_template: &license_header_definition
+  # configure git
+  - git config --global user.email "${CI_EMAIL}"
+  - git config --global user.name "${CI_USERNAME}"
+  - git checkout -b ci_processing # temporary branch
+
   - echo "current year of the headers:" ${LICENSE_HEADER_YEAR}
   - export LICENSE_HEADER_YEAR_NEW=$( date +'%Y' )
   # UPDATE: check if license headers have to be updated
@@ -35,16 +40,14 @@
   # ADD: add license headers 
   - else
   -   cd wolf_scripts
-  -   ./license_manager.sh --add --path=.. --license-header=license_header_${LICENSE_HEADER_YEAR}.txt
+  -   ./license_manager.sh --add --path=${PWD}/.. --license-header=license_header_${LICENSE_HEADER_YEAR}.txt
   - fi
   - cd ..
 
   # push changes (if any)
-  - git config --global user.email "${CI_EMAIL}"
-  - git config --global user.name "${CI_USERNAME}"
   - if git commit -u -m "[skip ci] license headers added or modified" ; then
   -   git remote set-url --push origin "ssh://git@gitlab.iri.upc.edu:2202/${CI_PROJECT_PATH}.git"
-  -   git push origin HEAD:${CI_COMMIT_REF_NAME}
+  -   git push origin ci_processing:${CI_COMMIT_REF_NAME}
   - else
   -   echo "No changes, nothing to commit!"
   - fi
-- 
GitLab