Questions tagged [gitlab-api]

The GitLab API is the api for the GitLab Community Edition.

The GitLab API is the for the GitLab Community Edition, which is hosted on github. See for more information on GitLab.

The GitLab API offers numerous access and management resources, including the most common needed for effective :

Additional API resources are available to provide a rich source control environment. Full documentation can also be found in the GitLab API github repository.

663 questions
2
votes
2 answers

Gitlab API create discussion on file line

I'm trying to create discussion on specific line of changed file. Request i make: await axios.post('https://gitlab./api/v4/projects//merge_requests/103/discussions', { body: 'test123', 'position[base_sha]':…
Marcin
  • 510
  • 6
  • 22
2
votes
1 answer

Query GitLab projects with specific field values filtered via GraphQL API

I want to find a project on Gitlab using the sshUrlToRepo or httpUrlToRepo field as a filter. I'm trying to use the GraphQL API to do this, but am not having much success. My query, so far, looks like this: query { projects(search: "url_sub_str")…
Brad
  • 173
  • 2
  • 7
2
votes
1 answer

How to run job-to-job linking in multi-project pipelines on GitLab CI

Example: I have 3 different pipelines (projects) in GitLab. Each pipeline has multiple jobs, each targeting a different remote VM and set a different GitLab CI environment. The jobs are all manually triggered (currently). What I am trying to achieve…
Raul Butuc
  • 319
  • 1
  • 12
2
votes
1 answer

GitLab GraphQL API: Read Raw Data

I am attempting to read the raw contents of a specific file in my GitLab repository using the GraphQL API. Doing this with the REST Api is detailed here: https://docs.gitlab.com/ee/api/repository_files.html#get-raw-file-from-repository Yet I can’t…
Stib
  • 86
  • 1
  • 7
2
votes
1 answer

triggering a pipeline from another pipeline gitlab

I am trying to trigger a pipeline from another pipeline using '$CI_JOB_TOKEN' (https://docs.gitlab.com/ee/ci/triggers/README.html#when-used-with-multi-project-pipelines). The second pipeline is getting triggered, but it is always executing the build…
Shemeem
  • 198
  • 2
  • 14
2
votes
2 answers

In GitLab Pipelines is there a way to run a pipeline when a Merge Request is detached?

I am trying to run a pipeline when a merge request in gitlab is detach means that is not a success and is rejected or closed without merging into the branch. So is it possible to execute it only for CI_MERGE_REQUEST_EVENT_TYPE=detach as we execute…
Sarvesh Jhanwar
  • 97
  • 1
  • 2
  • 10
2
votes
0 answers

Gitlab Runner artifacts-downloader returns Forbidden when downloading artifacts

I have a pipeline with 3 jobs. The 2nd job would build docker file and upload. But the 3rd stage failed with this error. ERROR: Downloading artifacts from coordinator... error error=unexpected EOF So I tried to use gitlab-runner…
angelokh
  • 9,426
  • 9
  • 69
  • 139
2
votes
1 answer

Is there an efficient way of finding failed pipelines on gitlab?

I would like to get a list of all projects in a group, where the last pipeline has not succeeded. My current code: def failed_pipelines(groupid): g = gitlab.Gitlab('https://gitlab.com', private_token=GITLAB_API_TOKEN) group =…
thebjorn
  • 26,297
  • 11
  • 96
  • 138
2
votes
1 answer

Gitlab - How to list all merge requests for a branch from a bash shell?

I have a project with many branches and I would like to list all merge requests from a specific branch from the console. I found the merge requests API and I also found that I need an HTTP request to do it from this issue like this: curl --header…
belabrinel
  • 851
  • 8
  • 15
2
votes
4 answers

How can we download a specific folder from a gitlab repository using curl or wget?

I know how to download a file from a gitlab repo and I didn't find anything on downloading a directory. I need to download only a directory.
Ashwani
  • 1,340
  • 1
  • 16
  • 34
2
votes
2 answers

Multiple on_failure events for each job in gitlab?

Gitlab ci offers 'when: on_failure' error handler. What if I want to have a different handler for each job? Because on failure is triggered if any preceeding job has failed. So that's basically if I set that handler for each job if one job will fail…
kol23
  • 1,498
  • 3
  • 16
  • 35
2
votes
1 answer

How to add a group to a project in gitlab by API curl?

I have many project in my Gitlab and I want to add a group to all of my project. I'm looking for a curl command to invite a group to my Gitlab project. for example maintainer privileges
Mohammad Ravanbakhsh
  • 2,244
  • 1
  • 15
  • 26
2
votes
0 answers

GitLab API: Deleting repository tags in bulk does not delete images

The GitLab API docs show how to delete images/tags by given tag or in bulk. Deleting a single tag works fine, but deleting in bulk only returns "202" and nothing seems to happen. Deleting a single tag works fine, return code is "200" curl --request…
2
votes
2 answers

gitlab API - how can I create a branch from an issue

In git lab, you can create an issue, then within the issue you can create a branch. This branch is linked to the issue (I think because of the issue number at the start of the branch name), such that when you do a merge request on that branch it…
code_fodder
  • 15,263
  • 17
  • 90
  • 167
2
votes
1 answer

Call GitLab API without personal "Private Token"

Is there a way to call GitLab API apart from using personal "PRIVATE TOKEN"? Problem with PRIVATE TOKEN is , it need to be updated in settings -> CI/CD -> Environment Variables which is accessible to anyone with maintainer privilege. And its need…
Prasenjit
  • 418
  • 3
  • 7
  • 20