-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement CI_JOB_TOKEN, so private includes can be accessed #1038
Comments
I wonder how Gitlab CI knows that the remote include, which is basicly just a curl request needs a gitlab private-token. What if the url was not They must be doing some sort of matching to find that the URL contains subdomain.domain matching the gitlab instance. |
Thanks for your fast answer, in my case I have a self hosted gitlab. |
OK that's weird. |
Well, if your user has access to both projects, I'm guessing the pipeline is generating a tmp token impersonating your access permissions, so you need to include a "ci-module" that your user don't have access to. |
OK I checked and it's because my user has admin access, I would have expected that the permissions were about the projects and not the users when you run the pipeline. |
Indeed the access (or not) to remote include/trigger depends exclusively on the person launching the pipeline 😉 |
We need to implement a similar token feature that requires users to put a CI_JOB_TOKEN in their gcl variables. This token will then be used by include fetching if git remote "matches" include url. |
It would be the best :)
|
I have a workaround this problem manually
Also includes are working |
Hello,
sorry if I created this issue as a bug as it may be more of a feature request.
I've read the documentation, mostly the quirks section and this commit
Minimal .gitlab-ci.yml illustrating the issue
In the variables I specified a gitlab token:
~/.gitlab-ci-local/variables.yml
I'm using the above .gitlab-ci.yml on several projects to avoid rewriting the core ci in every projects.
Expected behavior
This should fetch the /ci/gitlab-ci-templates/.gitlab-ci.yml of the project ansible_hosting/ansible_config
It seems that gitlab-ci-local find the correct URL (probably because my current project come from the same gitlab URL) but it cannot use the token and prompts for a password:
Is it possible to use this feature with gitlab's token ?
I also tried this version:
Minimal .gitlab-ci.yml illustrating the issue
It doesn't work either and this time I get this error:
If I try to download the file with curl and the above token, it works.
If I create a public snippet on my gitlab, the include remote will work but it's not really a suitable solution for me.
Is there any other way so I can grab my ci file remotely with gitlab-ci-local ?
Thanks.
Host information
Ubuntu
gitlab-ci-local 4.38.1
Containerd binary
Docker version 24.0.5, build ced0996l.
Thanks !
The text was updated successfully, but these errors were encountered: