Gitlab CI_JOB_TOKEN won't work in addition to Personal Access Token #32697
Replies: 2 comments 3 replies
-
JSON files don't have access to env directly like you're trying. You could put this rule in a config.js file and then be able to access process.env that way. |
Beta Was this translation helpful? Give feedback.
-
Hi there, This issue or discussion is missing some logs, making it difficult or impossible to help you. Depending on which situation applies follow one, some or all of these instructions. No logs at allIf you haven't posted any log yet, we need you to find and copy/paste the log into the issue template. Finding logs on hosted appSelect me to read instructionsIf you use the Mend Renovate app (GitHub):
Finding logs when self-hostingSelect me to read instructionsRead the Renovate docs, troubleshooting, self-hosted to learn how to find the logs. Insufficient logsSelect me to read instructionsIf you already gave us a log, and the Renovate team said it's not enough, then follow the instructions from the No logs at all section. Formatting your logsSelect me to read instructionsPlease put your logs in a
If you feel the logs are too large to paste here, please use a service like GitHub Gist and paste the link here. Good luck, The Renovate team |
Beta Was this translation helpful? Give feedback.
-
How are you running Renovate?
Self-hosted Renovate
If you're self-hosting Renovate, tell us which platform (GitHub, GitLab, etc) and which version of Renovate.
Gitlab, renovateVersion - 39.26.3
Please tell us more about your question or problem
I have setup a renovate project to monitor a repo (
my-group/myrepo
). I'm using personal access token with api, read_repository and write_repositories permissions so that renovate can create merge requests. The renovate bot is meant to be tracking terraform module dependencies.We do not have a terraform "registry" as such. The terraform modules are hosted in different gitlab repos (
cloudplatform/<module name>
). While my PAT doesn't have access to these repos, the CI_JOB_TOKEN of my CI pipeline has read access to all the module repos.I have set
RENOVATE_TOKEN = ${PAT}
in my CI file. MR creation works fine for public dependencies.And I'm trying to setup renovate.json like so:
However, renovate isn't able to read the terraform dependencies. I keep receiving 401 Unauthorized error.
I also ran
curl --header "Authorization: Bearer ${CI_JOB_TOKEN} "<sample module url>
and it gave me successful result. So the token works. I'm just not able to use it in my renovate config.Question: Is my use case even possible? I read in another thread about "one pipeline, one token" - #30013
Or if my use case is indeed achievable, pls let me know how I can setup authentication.
Thank you!
Logs (if relevant)
Logs
Beta Was this translation helpful? Give feedback.
All reactions