However, because my own personal token is used, the pushed commits are reported as coming from me.
I would prefer them to come from a bot user.
I tried to use the new project access tokens
I went to mygroup/myproject settings and created a project access token with write_repository scope.
Alas, the git push fails:
Shouldn’t this work?
The doc explicitly mentions using the token for API access, but not for git access (But what would be the purpose of the write_repository scope without a git access ?).
I’m using gitlab 13.3.1-ee.
I am not sure, but have you tried with git push https://project_{project_id}_bot:${PROJECT_ACCESS_TOKEN}@gitlab.mydomain.com/mygroup/myproject.git? Using project_{project_id}_bot instead of myusername?
I don’t know if you are the same user, but someone raised the same issue on the Gitlab issue tracker, so I suppose the best thing is waiting for a triage by someone from the Gitlab team: https://gitlab.com/gitlab-org/gitlab/-/issues/244491
yes this is the same issue (and I’m not the reporter).
I reached Gitlab support which confirmed there is currently no workaround.
They also hinted at tweaking the author (in git config) for commits done by the automated job in order to distinguish them from the ones I do myself.
This is a good idea.
However, the pipelines triggered when the job pushes those commits still appears as being triggered by me.
I’ll wait for the project token to be fixed to improve that part.