Configure username and email for automated commit

This commit is contained in:
Charlotte Van Petegem 2023-01-28 13:56:16 +01:00
parent 2f174725fe
commit 787d822ff8
No known key found for this signature in database
GPG key ID: 019E764B7184435A

View file

@ -40,9 +40,9 @@ commit-and-push:
artifacts: true
- job: build-nixos-configurations
script:
- url_host=`git remote get-url origin | sed -e "s/https:\/\/gitlab-ci-token:.*@//g"`
- git remote set-url origin "https://gitlab-ci-token:${CI_PUSH_TOKEN}@${url_host}"
- git add flake.lock
- git config user.email "$UPDATE_COMMIT_EMAIL"
- git config user.name "$UPDATE_COMMIT_NAME"
- git commit -m "Update dependencies"
- git push origin $CI_COMMIT_BRANCH
- git push https://gitlab-ci-token:${CI_PUSH_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git HEAD:$CI_COMMIT_BRANCH