Drone CI 中文文档

删除存储库

在 Drone 中禁用一个指定的存储库,并在源码控制系统(如 GitHub)中禁用 WebHook。请注意,这个 API 需要对存储库的管理权限。被操作的存储库对象的密钥 (Secret) 和构建不会被删除。

1
DELETE /api/repos/{owner}/{repo}

以下是响应体的示例:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{
    "id": 42,
    "uid": "16607898",
    "user_id": 2,
    "namespace": "octocat",
    "name": "octocat",
    "slug": "octocat/hello-world",
    "scm": "git",
    "git_http_url": "https://github.com/octocat/hello-world.git",
    "git_ssh_url": "git@github.com:octocat/hello-world.git",
    "link": "https://github.com/octocat/hello-world",
    "default_branch": "master",
    "private": false,
    "visibility": "public",
    "active": false,
    "config_path": ".drone.yml",
    "trusted": false,
    "protected": false,
    "ignore_forks": false,
    "ignore_pull_requests": false,
    "timeout": 60,
    "counter": 185,
    "synced": 1542160374,
    "created": 1542160374,
    "updated": 1542160374,
    "version": 187
}

As mentioned above, this endpoint disables but does not delete the repository. Use the remove query parameter to delete the repository from the database. Please note the repository may be automatically re-added to the database when you perform your next sync operation, if the repository still exists in your source control management system.

DELETE /api/repos/{owner}/{repo}?remove=true