cli
cli copied to clipboard
Credential issue with gitlab provider
cli version: 1.39
Hi!
I'm experiencing a credential issue, more specifically using the gitlab provider when requesting to create a pull request the commits fail to fetch. Following are my job configuration and partial output
job:
package-manager: npm_and_yarn
allowed-updates:
- dependency-type: direct
update-type: all
source:
provider: gitlab
hostname: example.com
api-endpoint: https://example.com/api/v4
repo: my-project
directory: /my-folder
credentials:
- type: git_source
host: example.com
password: token
updater | 2023/11/08 10:57:07 INFO Submitting @apollo/client pull request for creation
proxy | 2023/11/08 10:57:15 [119] GET https://example.com:443/api/v4/projects/my-project/repository/commits?
proxy | 2023/11/08 10:57:15 [119] * authenticating git server request (host: example.com)
proxy | 2023/11/08 10:57:15 [119] 404 https://example.com:443/api/v4/projects/my-project/repository/commits?
proxy | 2023/11/08 10:57:15 [119] * auth'd git request returned 404, retrying without auth
proxy | 2023/11/08 10:57:15 [119] * de-auth'd request returned 404, ignoring response
I've looked through the codebase and noticed the dependency on the gitlab api ruby project so I did some testing with that one to understand where the problem lies and found that project to be working fine running the following command.
gitlab commits my-project
I think the problem is that it doesn't propagate the token in the PRIVATE_TOKEN header, more info here: https://docs.gitlab.com/ee/api/commits.html.
Steps to reproduce in your code: curl 'https://example.com:443/api/v4/projects/my-project/repository/commits?' curl -H 'PRIVATE-TOKEN: token' 'https://example.com:443/api/v4/projects/my-project/repository/commits?'