Closed deimosfr closed 6 years ago
@deimosfr I've successfully been using that endpoint for a new feature in one of my projects. If it helps here's the code https://github.com/zaquestion/lab/blob/ci/internal/gitlab/gitlab.go#L354
Would suggest looking at the returned response struct (second return arg) and making sure the request matches what you'd expect.
Thanks for the example @zaquestion, I'll take a look and keep you updated.
I looked at the answer, the target URL is good (project id and pipeline id is correct). I see the header set with token. I see every required stuffs that are requested when doing it with curl. I looked at your code as well and we are doing the same thing. However you are listing pipelines before (ListProjectPipelines). Is it mandatory to perform this action before ?
@deimosfr I don't believe so, I'm only doing that because I need to search for a specific pipeline
@deimosfr I tried a few things. One way I was able to replicate by having an empty PRIVATE-TOKEN
so the header is there but no value.
Maybe viper.GetString("gitlab_token")
returns an empty string? Try passing a hardcoded private token in there and test it out.
Most of the time the 401 is related to the private-token.
I was able to replicate the same result with https://www.getpostman.com/.
When I was passing my private-token I had no trouble to get a response from the API
I've found the issue. I though pipeline token was the same as the private token and I was using the private for everything. Thanks for you help :)
Hi,
I'm trying to deploy a pipeline job, for that, I'm using this code:
The error message I got is:
The pipeline creation is ok, but I'm not able to get the job because of the authorization. I tested with curl commands, and it works, I don't see what's wrong. Any help would be appreciated.
Thanks