gitlab-api

What is a GitLab line_code as referenced when creating a new merge request thread

别等时光非礼了梦想. 提交于 2021-02-08 15:01:59
问题 I'm trying to create a discussion note on a merge request on a certain line of a file with the GitLab api using this endpoint: https://docs.gitlab.com/ee/api/discussions.html#create-new-merge-request-thread Part of the payload asks for a line_code Attribute Type Required Description position[line_range][start][line_code] string yes Line code for the start line When I issue a POST I get a response with: "message": "400 (Bad request) \"Note {:line_code=>[\"can't be blank\", \"must be a valid

download directory from a branch using Gitlab API v4

孤街醉人 提交于 2021-02-08 10:42:48
问题 I am trying to download a directory inside of a 'release' branch of a repository from Gitlab. I am using API v4. The branch includes is of the below structure: - archive - outputs - history-2020-01-01T142535 - history-2020-01-15T142559 - history-2020-02-01T142540 I want to get the "history-2020-02-01T142540" directory. I can get a ZIP archive of the entire branch... https://<GITLAB_URL>/api/v4/projects/<PROJECT_ID>/repository/archive.zip?sha=<BRANCH_ID> How do I get a ZIP archive of only a

download directory from a branch using Gitlab API v4

蓝咒 提交于 2021-02-08 10:41:51
问题 I am trying to download a directory inside of a 'release' branch of a repository from Gitlab. I am using API v4. The branch includes is of the below structure: - archive - outputs - history-2020-01-01T142535 - history-2020-01-15T142559 - history-2020-02-01T142540 I want to get the "history-2020-02-01T142540" directory. I can get a ZIP archive of the entire branch... https://<GITLAB_URL>/api/v4/projects/<PROJECT_ID>/repository/archive.zip?sha=<BRANCH_ID> How do I get a ZIP archive of only a

gitlab api Tag creation error

梦想与她 提交于 2021-02-07 08:16:52
问题 Hi I am trying to create a tag to a project using the gitlab api, but it keeps saying tag name not valid. I even tried using the sample in gitlab api doc. Here is my attempt: ➜ /tmp curl -X POST -d @body.json https://mygitlabserver.com/api/v3/projects/9733/repository/tags --header "Content-Type:application/json" -H "PRIVATE-TOKEN:sNW8AGtLMdSGAJiGQ-gV" {"message":"Tag name invalid"}% ➜ /tmp cat body.json { "commit": { "author_email": "john@example.com", "author_name": "John Smith", "authored

gitlab api Tag creation error

橙三吉。 提交于 2021-02-07 08:15:33
问题 Hi I am trying to create a tag to a project using the gitlab api, but it keeps saying tag name not valid. I even tried using the sample in gitlab api doc. Here is my attempt: ➜ /tmp curl -X POST -d @body.json https://mygitlabserver.com/api/v3/projects/9733/repository/tags --header "Content-Type:application/json" -H "PRIVATE-TOKEN:sNW8AGtLMdSGAJiGQ-gV" {"message":"Tag name invalid"}% ➜ /tmp cat body.json { "commit": { "author_email": "john@example.com", "author_name": "John Smith", "authored

Updating and committing file by using gitlab api

空扰寡人 提交于 2019-12-11 07:00:01
问题 I want to update file content and commit it. To be able to achieve it, I looked the api of gitlab from the url; http://mygitlabadress/help/api/README.md It says Updating existing file is done as; http://mygitlabadress/help/api/repository_files.md#update-existing-file-in-repository I follow the instructions and write; http://mygitlabadress/api/v4/projects/:id/repository/files/file1%2Ffile2%2Ftest?ref=master&author_name=name%20surname&content=some%20other%20content&commit_message=update%20file

Gitlab-ci.yml to create merge reqeust

对着背影说爱祢 提交于 2019-12-08 06:58:30
问题 I have the following gitlab-ci.yml file running in DEV branch, with target as DEV as well. Since i couldnt point the TARGET as MASTER, there is no automatic MR getting created. I would like to know if its possible to create a merge request in the gitlab-ci script itself. dev: stage: deploy script: - url_host=`git remote get-url origin | sed -e "s/https:\/\/gitlab-ci-token:.*@//g"` - git remote set-url origin "https://gitlab-ci-token:${CI_TAG_UPLOAD_TOKEN}@${url_host}" - databricks workspace

Gitlab API: How to generate the private token

大憨熊 提交于 2019-11-28 21:29:57
This is what I tried: curl http://git.ep.petrobras.com.br/api/v3/session --data-urlencode 'login=myUser&password=myPass' Answer: {"message":"401 Unauthorized"} The problem is the data-urlencode CURL option. Since it's an HTTP POST you don't need to URL encode the data, and is actually encoding the & into & and causing your issue. Instead use the --data option. curl http://git.ep.petrobras.com.br/api/v3/session --data 'login=myUser&password=myPass' Also, be careful sending credentials over plain HTTP. It could be easily sniffed. This is how: $ curl http://git.ep.petrobras.com.br/api/v3/session/

Gitlab API: How to generate the private token

坚强是说给别人听的谎言 提交于 2019-11-27 13:53:54
问题 This is what I tried: curl http://git.ep.petrobras.com.br/api/v3/session --data-urlencode 'login=myUser&password=myPass' Answer: {"message":"401 Unauthorized"} 回答1: The problem is the data-urlencode CURL option. Since it's an HTTP POST you don't need to URL encode the data, and is actually encoding the & into & and causing your issue. Instead use the --data option. curl http://git.ep.petrobras.com.br/api/v3/session --data 'login=myUser&password=myPass' Also, be careful sending credentials