From 3b279430c25ba4f6bd3e691f1829915dd69e7e8f Mon Sep 17 00:00:00 2001 From: Amy Qualls Date: Wed, 11 Jun 2025 11:58:57 -0700 Subject: [PATCH 1/2] Add information about glab deploy key commands We should mention the CLI in these places, so people know it's available. --- doc/user/project/deploy_keys/_index.md | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/doc/user/project/deploy_keys/_index.md b/doc/user/project/deploy_keys/_index.md index 007e92881c54a8..5ccd3aa674d47c 100644 --- a/doc/user/project/deploy_keys/_index.md +++ b/doc/user/project/deploy_keys/_index.md @@ -93,6 +93,8 @@ The deploy keys available are listed: - **Privately accessible deploy keys**: Project deploy keys that don't have access to the project. - **Public accessible deploy keys**: Public deploy keys that don't have access to the project. +The [GitLab CLI](../../../editor_extensions/gitlab_cli/_index.md) provides a `glab deploy-key list` command. + ## Create a project deploy key Prerequisites: @@ -113,6 +115,8 @@ Prerequisites: A project deploy key is enabled when it is created. You can modify only a project deploy key's name and permissions. If the deploy key is enabled in more than one project, you can't modify the deploy key name. +The [GitLab CLI](../../../editor_extensions/gitlab_cli/_index.md) provides a `glab deploy-key add` command. + ## Create a public deploy key {{< details >}} @@ -194,6 +198,10 @@ What happens to the deploy key when it is disabled depends on the following: - If the key is privately accessible and also in use by other projects, it is removed from the project, but still available in the **Privately accessible deploy keys** tab. +## Related topics + +- GitLab CLI [commands for deploy keys](https://gitlab.com/gitlab-org/cli/-/tree/main/docs/source/deploy-key) + ## Troubleshooting ### Deploy key cannot push to a protected branch @@ -217,9 +225,10 @@ To resolve this issue, you can use the deploy keys API to create deploy keys for 1. Use the deploy key API to [create a deploy key for the service account user](../../../api/deploy_keys.md#add-deploy-key): ```shell - curl --request POST --header "PRIVATE-TOKEN: " --header "Content-Type: application/json" \ - --data '{"title": "My deploy key", "key": "ssh-rsa AAAA...", "can_push": "true"}' \ - "https://gitlab.example.com/api/v4/projects/5/deploy_keys/" + curl --request POST --header "PRIVATE-TOKEN: " \n + --header "Content-Type: application/json" \ + --data '{"title": "My deploy key", "key": "ssh-rsa AAAA...", "can_push": "true"}' \ + --url "https://gitlab.example.com/api/v4/projects/5/deploy_keys/" ``` #### Identify deploy keys associated with non-member and blocked users -- GitLab From ddcb70e344e6ee8024cf4f7ab4cd8de008810bfd Mon Sep 17 00:00:00 2001 From: Amy Qualls Date: Wed, 11 Jun 2025 12:05:15 -0700 Subject: [PATCH 2/2] Apply 1 suggestion(s) to 1 file(s) --- doc/user/project/deploy_keys/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/user/project/deploy_keys/_index.md b/doc/user/project/deploy_keys/_index.md index 5ccd3aa674d47c..0a324eb3880f9b 100644 --- a/doc/user/project/deploy_keys/_index.md +++ b/doc/user/project/deploy_keys/_index.md @@ -225,7 +225,7 @@ To resolve this issue, you can use the deploy keys API to create deploy keys for 1. Use the deploy key API to [create a deploy key for the service account user](../../../api/deploy_keys.md#add-deploy-key): ```shell - curl --request POST --header "PRIVATE-TOKEN: " \n + curl --request POST --header "PRIVATE-TOKEN: " \ --header "Content-Type: application/json" \ --data '{"title": "My deploy key", "key": "ssh-rsa AAAA...", "can_push": "true"}' \ --url "https://gitlab.example.com/api/v4/projects/5/deploy_keys/" -- GitLab