diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a396d7956fe424217080c45426f25dc4f376486b..40bef073dfd1742f78686cabbc4459e10853e6ea 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