Skip to content

Should we allow a runner to generate temporary personal access token in order to push in GitLab API projects ?

I saw this issue gitlab-ce#18106 that propose to allow a runner to push back in its project the changes he might have done. It proposes to use the developers' rights for that.

I am actually trying to do the same thing, i.e. clone & push, but in a separate project using three GitLab variables CI_JOB_TOKEN to clone & push, GITLAB_USER_NAME and GITLAB_USER_EMAIL to configure the git. However, despite having the right to clone & push in the separate project, I can't find any way to do that properly using http(s).

In fact, cloning, adding and commiting works fine with those but the push always fail.

I already managed to do that using the SSH key method but I would like to avoid this.

I don't know if it has already been discussed or if this isn't the right place to post this. I don't even know if GitLab forbids this process at first.

EDIT

I figured out the CI_JOB_TOKEN only has read access and that I should use a personal access token. Then it's a different question. Should we allow a GitLab runner to generate temporary personal access token ?

Discussion ~runner ~"CI/CD"

Edited by Baptiste