diff --git a/app/docs/slate/source/includes/_repositories.md b/app/docs/slate/source/includes/_repositories.md index eaae10746..81dbe1441 100644 --- a/app/docs/slate/source/includes/_repositories.md +++ b/app/docs/slate/source/includes/_repositories.md @@ -274,6 +274,84 @@ await octokit.request('GET /api/yystopf/ceshi/detail.json') } ``` +## 仓库标签列表 +仓库标签列表 + +> 示例: + +```shell +curl -X GET http://localhost:3000/api/yystopf/csfjkkj/tags.json +``` + +```javascript +await octokit.request('GET /api/yystopf/csfjkkj/tags.json') +``` + +### HTTP 请求 +`GET /api/:owner/:repo/tags.json` + +### 请求参数: +参数 | 必选 | 默认 | 类型 | 字段说明 +--------- | ------- | ------- | -------- | ---------- +|owner |是| |string |用户登录名 | +|repo |是| |string |项目标识identifier | + + +### 返回字段说明: +参数 | 类型 | 字段说明 +--------- | ----------- | ----------- +|id |int |标签id | +|name |string|标签名称| +|zipball_url |string|标签zip包下载地址| +|tarball_url |string|标签tar包下载地址| +|commit |object|标签最后一个commit| +|commit.sha |string|commit的id| +|commit.message |string|commit的提交信息| +|commit.time_ago|string|commit的提交时间| +|commit.commiter|object|commit的提交者| + + +> 返回的JSON示例: + +```json +[ + { + "name": "v2.0.0", + "id": "c7d0873ee41796d1a0e193063095ccf539a9bf31", + "zipball_url": "http://localhost:3000/api/yystopf/csfjkkj/archive/v2.0.0.zip", + "tarball_url": "http://localhost:3000/api/yystopf/csfjkkj/archive/v2.0.0.tar.gz", + "commit": { + "sha": "08fe383f1e5ebe2e2a384a8ea3ee890a758c7cd7", + "message": "add\n", + "time_ago": "4小时前", + "committer": { + "id": 4, + "login": "testforge1", + "name": "testforge1", + "image_url": "system/lets/letter_avatars/2/T/19_237_174/120.png" + } + } + }, + { + "name": "v1.0.0", + "id": "12168ad39c3ef201a445a2db181a3e43d50e40dd", + "zipball_url": "http://localhost:3000/api/yystopf/csfjkkj/archive/v1.0.0.zip", + "tarball_url": "http://localhost:3000/api/yystopf/csfjkkj/archive/v1.0.0.tar.gz", + "commit": { + "sha": "5291b5e45a377c1f7710cc6647259887ed7aaccf", + "message": "ADD file via upload\n", + "time_ago": "9天前", + "committer": { + "id": 2, + "login": "yystopf", + "name": "heh", + "image_url": "system/lets/letter_avatars/2/H/188_239_142/120.png" + } + } + } +] +``` + ## 编辑仓库信息 编辑仓库信息 diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 72f3f3415..c37fd59da 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -434,6 +434,10 @@ module ApplicationHelper User.find_by_login login end + def find_user_by_login_and_mail(login, mail) + User.find_by(login: login, mail: mail) + end + def find_user_by_gitea_uid(gitea_uid) User.find_by(gitea_uid: gitea_uid) end diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index d9679cb80..ee60b64a4 100644 --- a/app/helpers/repositories_helper.rb +++ b/app/helpers/repositories_helper.rb @@ -30,8 +30,8 @@ module RepositoriesHelper if author_json["id"].present? return find_user_by_gitea_uid author_json['id'] end - if author_json["id"].nil? && author_json["name"].present? - return find_user_by_login author_json['name'] + if author_json["id"].nil? && (author_json["name"].present? && author_json["email"].present?) + return find_user_by_login_and_mail(author_json['name'], author_json["email"]) end end diff --git a/app/views/repositories/tags.json.jbuilder b/app/views/repositories/tags.json.jbuilder index 9db3ff93e..011fad46a 100644 --- a/app/views/repositories/tags.json.jbuilder +++ b/app/views/repositories/tags.json.jbuilder @@ -6,6 +6,11 @@ json.array! @tags do |tag| json.tarball_url render_tar_url(@owner, @repository, tag['name']) json.commit do json.sha tag['commit']['sha'] + json.message tag['commit_message'] + json.time_ago time_from_now(tag['commit_time'].to_time) + json.committer do + json.partial! 'commit_author', user: render_commit_author(tag['commiter']), name: tag['commiter']['name'] + end end end end diff --git a/public/docs/api.html b/public/docs/api.html index 4ec491b4f..763134f4e 100644 --- a/public/docs/api.html +++ b/public/docs/api.html @@ -469,6 +469,9 @@
  • 仓库详情(新版)
  • +
  • + 仓库标签列表 +
  • 编辑仓库信息
  • @@ -6185,16 +6188,16 @@ http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/organizat "Shell": "0.1%" } } -

    编辑仓库信息

    -

    编辑仓库信息

    +

    仓库标签列表

    +

    仓库标签列表

    示例:

    -
    curl -X GET http://localhost:3000/api/jasder/jasder_test/edit.json
    -
    await octokit.request('GET /api/jasder/jasder_test/edit.json')
    +
    curl -X GET http://localhost:3000/api/yystopf/csfjkkj/tags.json
    +
    await octokit.request('GET /api/yystopf/csfjkkj/tags.json')
     

    HTTP 请求

    -

    GET /api/:owner/:repo/edit.json

    +

    GET /api/:owner/:repo/tags.json

    请求参数:

    @@ -6229,6 +6232,135 @@ http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/organizat + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    idint标签id
    namestring标签名称
    zipball_urlstring标签zip包下载地址
    tarball_urlstring标签tar包下载地址
    commitobject标签最后一个commit
    commit.shastringcommit的id
    commit.messagestringcommit的提交信息
    commit.time_agostringcommit的提交时间
    commit.commiterobjectcommit的提交者
    + +
    +

    返回的JSON示例:

    +
    +
    [
    +    {
    +        "name": "v2.0.0",
    +        "id": "c7d0873ee41796d1a0e193063095ccf539a9bf31",
    +        "zipball_url": "http://localhost:3000/api/yystopf/csfjkkj/archive/v2.0.0.zip",
    +        "tarball_url": "http://localhost:3000/api/yystopf/csfjkkj/archive/v2.0.0.tar.gz",
    +        "commit": {
    +            "sha": "08fe383f1e5ebe2e2a384a8ea3ee890a758c7cd7",
    +            "message": "add\n",
    +            "time_ago": "4小时前",
    +            "committer": {
    +                "id": 4,
    +                "login": "testforge1",
    +                "name": "testforge1",
    +                "image_url": "system/lets/letter_avatars/2/T/19_237_174/120.png"
    +            }
    +        }
    +    },
    +    {
    +        "name": "v1.0.0",
    +        "id": "12168ad39c3ef201a445a2db181a3e43d50e40dd",
    +        "zipball_url": "http://localhost:3000/api/yystopf/csfjkkj/archive/v1.0.0.zip",
    +        "tarball_url": "http://localhost:3000/api/yystopf/csfjkkj/archive/v1.0.0.tar.gz",
    +        "commit": {
    +            "sha": "5291b5e45a377c1f7710cc6647259887ed7aaccf",
    +            "message": "ADD file via upload\n",
    +            "time_ago": "9天前",
    +            "committer": {
    +                "id": 2,
    +                "login": "yystopf",
    +                "name": "heh",
    +                "image_url": "system/lets/letter_avatars/2/H/188_239_142/120.png"
    +            }
    +        }
    +    }
    +]
    +

    编辑仓库信息

    +

    编辑仓库信息

    + +
    +

    示例:

    +
    +
    curl -X GET http://localhost:3000/api/jasder/jasder_test/edit.json
    +
    await octokit.request('GET /api/jasder/jasder_test/edit.json')
    +

    HTTP 请求

    +

    GET /api/:owner/:repo/edit.json

    +

    请求参数:

    + + + + + + + + + + + + + + + + + + + + + + + +
    参数必选默认类型字段说明
    ownerstring用户登录名
    repostring项目标识identifier
    +

    返回字段说明:

    + + + + + + + + @@ -6297,9 +6429,9 @@ http://localhost:3000/api/ceshi1/ceshi_repo1/applied_transfer_projects/organizat -d"private=true"\ http://localhost:3000/api/jasder/jasder_test.json
    await octokit.request('PATCH /api/jasder/jasder_test.json')
    -

    HTTP 请求

    +

    HTTP 请求

    PATCH /api/:owner/:repo

    -

    请求参数:

    +

    请求参数:

    参数类型字段说明
    identifier string 仓库标识
    @@ -6359,7 +6491,7 @@ http://localhost:3000/api/jasder/jasder_test.json
    参数项目是否私有, true:为私有,false: 公开,默认为公开
    -

    返回字段说明:

    +

    返回字段说明:

    @@ -6424,9 +6556,9 @@ http://localhost:3000/api/jasder/jasder_test.json
    curl -X DELETE http://localhost:3000/api/jasder/jasder_test.json
     
    await octokit.request('DELETE /api/jasder/jasder_test.json')
    -

    HTTP 请求

    +

    HTTP 请求

    PATCH /api/:owner/:repo

    -

    请求参数:

    +

    请求参数:

    参数
    @@ -6451,7 +6583,7 @@ http://localhost:3000/api/jasder/jasder_test.json
    参数项目标识identifier
    -

    返回字段说明:

    +

    返回字段说明:

    @@ -6492,83 +6624,8 @@ http://localhost:3000/api/jasder/jasder_test.json -d"user_id=12"\ http://localhost:3000/api/jasder/jasder_test/collaborators.json
    await octokit.request('POST /api/jasder/jasder_test/collaborators.json')
    -

    HTTP 请求

    -

    POST /api/:owner/:repo/collaborators.json

    -

    请求参数:

    -
    参数
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    参数必选默认类型字段说明
    ownerstring用户登录名
    repostring项目标识identifier
    user_idint用户id
    -

    返回字段说明:

    - - - - - - - - - - - - - - - - - -
    参数类型字段说明
    statusint返回状态, 0: 表示操作成功
    messagestring返回信息说明
    - -
    -

    返回的JSON示例:

    -
    -
    {
    -  "status": 0,
    -  "message": "success"
    -}
    -
    - -

    删除仓库成员

    -

    仓库中删除成员操作

    - -
    -

    示例:

    -
    -
    curl -X DELETE \
    --d "user_id=12" \
    -http://localhost:3000/api/jasder/jasder_test/collaborators.json
    -
    await octokit.request('DELETE /api/jasder/jasder_test/collaborators.json')
     

    HTTP 请求

    -

    DELETE /api/:owner/:repo/collaborators.json

    +

    POST /api/:owner/:repo/collaborators.json

    请求参数:

    @@ -6621,6 +6678,81 @@ http://localhost:3000/api/jasder/jasder_test/collaborators.json
    +
    +

    返回的JSON示例:

    +
    +
    {
    +  "status": 0,
    +  "message": "success"
    +}
    +
    + +

    删除仓库成员

    +

    仓库中删除成员操作

    + +
    +

    示例:

    +
    +
    curl -X DELETE \
    +-d "user_id=12" \
    +http://localhost:3000/api/jasder/jasder_test/collaborators.json
    +
    await octokit.request('DELETE /api/jasder/jasder_test/collaborators.json')
    +

    HTTP 请求

    +

    DELETE /api/:owner/:repo/collaborators.json

    +

    请求参数:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    参数必选默认类型字段说明
    ownerstring用户登录名
    repostring项目标识identifier
    user_idint用户id
    +

    返回字段说明:

    + + + + + + + + + + + + + + + + + +
    参数类型字段说明
    statusint返回状态, 0: 表示操作成功
    messagestring返回信息说明
    +

    返回的JSON示例:

    @@ -6643,9 +6775,9 @@ http://localhost:3000/api/jasder/jasder_test/collaborators.json -d "role=Developer" \ http://localhost:3000/api/jasder/jasder_test/change_role.json
    await octokit.request('PUT /api/jasder/jasder_test/change_role.json')
    -

    HTTP 请求

    +

    HTTP 请求

    PUT /api/:owner/:repo/change_role.json

    -

    请求参数:

    +

    请求参数:

    @@ -6684,7 +6816,7 @@ http://localhost:3000/api/jasder/jasder_test/change_role.json
    参数取值范围:"Manager", "Developer", "Reporter";分别为项目管理人员(拥有所有操作权限)、项目开发人员(只拥有读写权限)、项目报告人员(只拥有读权限)
    -

    返回字段说明:

    +

    返回字段说明:

    @@ -6726,9 +6858,9 @@ http://localhost:3000/api/jasder/jasder_test/change_role.json -d"limit=5"\ http://localhost:3000/api/jasder/jasder_test/collaborators.json
    await octokit.request('GET /api/jasder/jasder_test/collaborators.json')
    -

    HTTP 请求

    +

    HTTP 请求

    GET /api/:owner/:repo/collaborators.json

    -

    请求参数:

    +

    请求参数:

    参数
    @@ -6767,7 +6899,7 @@ http://localhost:3000/api/jasder/jasder_test/collaborators.json
    参数每页多少条数据,默认15条
    -

    返回字段说明:

    +

    返回字段说明:

    @@ -6855,9 +6987,9 @@ http://localhost:3000/api/jasder/jasder_test/collaborators.json -d"ref=develop"\ http://localhost:3000/api/yystopf/ceshi/files.json
    await octokit.request('GET /api/yystopf/ceshi/files.json')
    -

    HTTP 请求

    +

    HTTP 请求

    GET /api/:owner/:repo/files

    -

    请求参数:

    +

    请求参数:

    参数
    @@ -6896,7 +7028,7 @@ http://localhost:3000/api/yystopf/ceshi/files.json
    参数分支名,默认为仓库默认分支
    -

    返回字段说明:

    +

    返回字段说明:

    @@ -6978,9 +7110,9 @@ http://localhost:3000/api/yystopf/ceshi/files.json -d"ref=develop"\ http://localhost:3000//api/jasder/jasder_test/entries.json
    await octokit.request('GET /api/jasder/jasder_test/entries.json')
    -

    HTTP 请求

    +

    HTTP 请求

    GET /api/:owner/:repo/entries.json

    -

    请求参数:

    +

    请求参数:

    参数
    @@ -7012,7 +7144,7 @@ http://localhost:3000//api/jasder/jasder_test/entries.json
    参数分支名称、tag名称或是提交记录id,默认为master分支
    -

    返回字段说明:

    +

    返回字段说明:

    @@ -7126,9 +7258,9 @@ http://localhost:3000//api/jasder/jasder_test/entries.json -d"filepath=file"\ http://localhost:3000//api/jasder/jasder_test/sub_entries.json
    await octokit.request('GET /api/jasder/jasder_test/sub_entries.json')
    -

    HTTP 请求

    +

    HTTP 请求

    GET /api/:owner/:repo/sub_entries.json

    -

    请求参数:

    +

    请求参数:

    参数
    @@ -7167,7 +7299,7 @@ http://localhost:3000//api/jasder/jasder_test/sub_entries.json
    参数分支名称、tag名称或是提交记录id,默认为master分支
    -

    返回字段说明:

    +

    返回字段说明:

    @@ -7264,9 +7396,9 @@ http://localhost:3000//api/jasder/jasder_test/sub_entries.json -d"filepath=lib"\ http://localhost:3000/api/yystopf/csfjkkj/readme.json
    await octokit.request('GET /api/yystopf/csfjkkj/readme.json')
    -

    HTTP 请求

    +

    HTTP 请求

    GET /api/:owner/:repo/readme.json

    -

    请求参数:

    +

    请求参数:

    参数
    @@ -7305,7 +7437,7 @@ http://localhost:3000/api/yystopf/csfjkkj/readme.json
    参数子目录名称,默认为空
    -

    返回字段说明:

    +

    返回字段说明:

    @@ -7377,9 +7509,9 @@ http://localhost:3000/api/yystopf/csfjkkj/readme.json -d"filepath=lib"\ http://localhost:3000/api/yystopf/csfjkkj/contributors.json
    await octokit.request('GET /api/yystopf/csfjkkj/contributors.json')
    -

    HTTP 请求

    +

    HTTP 请求

    GET /api/:owner/:repo/contributors.json

    -

    请求参数:

    +

    请求参数:

    参数
    @@ -7418,7 +7550,7 @@ http://localhost:3000/api/yystopf/csfjkkj/contributors.json
    参数子目录名称,默认为空
    -

    返回字段说明:

    +

    返回字段说明:

    @@ -7493,9 +7625,9 @@ http://localhost:3000/api/yystopf/csfjkkj/contributors.json
    curl -X GET \
     http://localhost:3000/api/yystopf/ceshi/webhooks.json
     
    await octokit.request('GET /api/yystopf/ceshi/webhooks.json')
    -

    HTTP 请求

    +

    HTTP 请求

    GET /api/:owner/:repo/webhooks.json

    -

    请求参数:

    +

    请求参数:

    参数
    @@ -7520,7 +7652,7 @@ http://localhost:3000/api/yystopf/ceshi/webhooks.json
    参数项目标识identifier
    -

    返回字段说明:

    +

    返回字段说明:

    @@ -7622,9 +7754,9 @@ http://localhost:3000/api/yystopf/ceshi/webhooks.json
    curl -X GET \
     http://localhost:3000/api/yystopf/ceshi/webhooks/3/edit.json
     
    await octokit.request('GET /api/yystopf/ceshi/webhooks/3/edit.json')
    -

    HTTP 请求

    +

    HTTP 请求

    GET /api/:owner/:repo/webhooks/:id/edit.json

    -

    请求参数:

    +

    请求参数:

    参数
    @@ -7656,7 +7788,7 @@ http://localhost:3000/api/yystopf/ceshi/webhooks/3/edit.json
    参数webhook ID
    -

    返回字段说明:

    +

    返回字段说明:

    @@ -7857,266 +7989,8 @@ http://localhost:3000/api/yystopf/ceshi/webhooks/3/edit.json
    curl -X POST \
     http://localhost:3000/api/yystopf/ceshi/webhooks.json
     
    await octokit.request('POST /api/yystopf/ceshi/webhooks.json')
    -

    HTTP 请求

    -

    POST /api/:owner/:repo/webhooks.json

    -

    请求参数:

    -
    参数
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    参数必选默认类型字段说明
    ownerstring用户登录名
    repostring项目标识identifier
    webhook.urlstring目标url
    webhook.typestring类型
    webhook.http_methodstringhttp方法, POST和GET
    webhook.content_typestringPOST Content Type
    webhook.secretstring密钥文本
    webhook.activebool是否激活
    webhook.branch_filterstring分支过滤
    webhook.eventsarray触发事件
    - -

    触发事件字段说明

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    参数含义
    create创建分支或标签
    delete分支或标签删除
    fork仓库被fork
    pushgit仓库推送
    issue易修已打开、已关闭、已重新打开或编辑
    issue_assign易修被指派
    issue_label易修标签被更新或删除
    issue_milestone易修被收入里程碑
    issue_comment易修评论
    pull_request合并请求
    pull_request_assign合并请求被指派
    pull_request_label合并请求被贴上标签
    pull_request_milestone合并请求被记录于里程碑中
    pull_request_comment合并请求被评论
    pull_request_review_approved合并请求被批准
    pull_request_review_rejected合并请求被拒绝
    pull_request_review_comment合并请求被提出审查意见
    pull_request_sync合并请求被同步
    repository创建或删除仓库
    release版本发布
    - -
    -

    请求的JSON示例:

    -
    -
    {
    -    "active": true, 
    -    "content_type": "json",
    -    "http_method": "GET",
    -    "secret": "123456",
    -    "url": "http://localhost:10000",
    -    "branch_filter": "*",
    -    "events": ["push"]
    -}
    -

    返回字段说明:

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    参数类型字段说明
    idintid
    urlstring地址
    content_typestringPOST Content Type
    is_activebool是否激活
    typestring类型
    eventsarray触发事件
    create_timestring创建时间
    - -
    -

    返回的JSON示例:

    -
    -
    {
    -    "id": 18,
    -    "type": "gitea",
    -    "content_type": "json",
    -    "url": "http://localhost:10000",
    -    "events": [
    -        "push"
    -    ],
    -    "active": true,
    -    "create_time": "2021-07-26 18:53:43"
    -}
    -
    - -

    更新仓库webhook

    -

    更新仓库webhook

    - -
    -

    示例:

    -
    -
    curl -X PATCH \
    -http://localhost:3000/api/yystopf/ceshi/webhooks/7.json
    -
    await octokit.request('PATCH /api/yystopf/ceshi/webhooks/7.json')
     

    HTTP 请求

    -

    PATCH /api/:owner/:repo/webhooks/:id.json

    +

    POST /api/:owner/:repo/webhooks.json

    请求参数:

    @@ -8142,13 +8016,6 @@ http://localhost:3000/api/yystopf/ceshi/webhooks/7.json - - - - - - - @@ -8309,28 +8176,79 @@ http://localhost:3000/api/yystopf/ceshi/webhooks/7.json "events": ["push"] }

    返回字段说明:

    +
    项目标识identifier
    idstringwebhook id
    webhook.url
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    参数类型字段说明
    idintid
    urlstring地址
    content_typestringPOST Content Type
    is_activebool是否激活
    typestring类型
    eventsarray触发事件
    create_timestring创建时间
    +

    返回的JSON示例:

    {
    -    "status": 0,
    -    "message": "success"
    +    "id": 18,
    +    "type": "gitea",
    +    "content_type": "json",
    +    "url": "http://localhost:10000",
    +    "events": [
    +        "push"
    +    ],
    +    "active": true,
    +    "create_time": "2021-07-26 18:53:43"
     }
     
    -

    删除仓库webhook

    -

    删除仓库webhook

    +

    更新仓库webhook

    +

    更新仓库webhook

    示例:

    -
    curl -X DELETE \
    +
    curl -X PATCH \
     http://localhost:3000/api/yystopf/ceshi/webhooks/7.json
    -
    await octokit.request('DELETE /api/yystopf/ceshi/webhooks/7.json')
    +
    await octokit.request('PATCH /api/yystopf/ceshi/webhooks/7.json')
     

    HTTP 请求

    -

    DELETE /api/:owner/:repo/webhooks/:id.json

    +

    PATCH /api/:owner/:repo/webhooks/:id.json

    请求参数:

    @@ -8362,8 +8280,222 @@ http://localhost:3000/api/yystopf/ceshi/webhooks/7.json + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    string webhook id
    webhook.urlstring目标url
    webhook.typestring类型
    webhook.http_methodstringhttp方法, POST和GET
    webhook.content_typestringPOST Content Type
    webhook.secretstring密钥文本
    webhook.activebool是否激活
    webhook.branch_filterstring分支过滤
    webhook.eventsarray触发事件
    -

    返回字段说明:

    + +

    触发事件字段说明

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    参数含义
    create创建分支或标签
    delete分支或标签删除
    fork仓库被fork
    pushgit仓库推送
    issue易修已打开、已关闭、已重新打开或编辑
    issue_assign易修被指派
    issue_label易修标签被更新或删除
    issue_milestone易修被收入里程碑
    issue_comment易修评论
    pull_request合并请求
    pull_request_assign合并请求被指派
    pull_request_label合并请求被贴上标签
    pull_request_milestone合并请求被记录于里程碑中
    pull_request_comment合并请求被评论
    pull_request_review_approved合并请求被批准
    pull_request_review_rejected合并请求被拒绝
    pull_request_review_comment合并请求被提出审查意见
    pull_request_sync合并请求被同步
    repository创建或删除仓库
    release版本发布
    + +
    +

    请求的JSON示例:

    +
    +
    {
    +    "active": true, 
    +    "content_type": "json",
    +    "http_method": "GET",
    +    "secret": "123456",
    +    "url": "http://localhost:10000",
    +    "branch_filter": "*",
    +    "events": ["push"]
    +}
    +

    返回字段说明:

    +
    +

    返回的JSON示例:

    +
    +
    {
    +    "status": 0,
    +    "message": "success"
    +}
    +
    + +

    删除仓库webhook

    +

    删除仓库webhook

    + +
    +

    示例:

    +
    +
    curl -X DELETE \
    +http://localhost:3000/api/yystopf/ceshi/webhooks/7.json
    +
    await octokit.request('DELETE /api/yystopf/ceshi/webhooks/7.json')
    +

    HTTP 请求

    +

    DELETE /api/:owner/:repo/webhooks/:id.json

    +

    请求参数:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    参数必选默认类型字段说明
    ownerstring用户登录名
    repostring项目标识identifier
    idstringwebhook id
    +

    返回字段说明:

    返回的JSON示例:

    @@ -8384,9 +8516,9 @@ http://localhost:3000/api/yystopf/ceshi/webhooks/7.json
    curl -X GET \
     http://localhost:3000/api/yystopf/ceshi/webhooks/3/tasks.json
     
    await octokit.request('GET /api/yystopf/ceshi/webhooks/3/tasks.json')
    -

    HTTP 请求

    +

    HTTP 请求

    GET /api/:owner/:repo/webhooks/:id/tasks.json

    -

    请求参数:

    +

    请求参数:

    @@ -8418,7 +8550,7 @@ http://localhost:3000/api/yystopf/ceshi/webhooks/3/tasks.json
    参数webhook ID
    -

    返回字段说明:

    +

    返回字段说明:

    @@ -8655,9 +8787,9 @@ http://localhost:3000/api/yystopf/ceshi/webhooks/3/tasks.json
    curl -X POST \
     http://localhost:3000/api/yystopf/ceshi/webhooks/3/test.json
     
    await octokit.request('POST /api/yystopf/ceshi/webhooks/3/test.json')
    -

    HTTP 请求

    +

    HTTP 请求

    POST /api/:owner/:repo/webhooks/:id/test.json

    -

    请求参数:

    +

    请求参数:

    参数
    @@ -8689,7 +8821,7 @@ http://localhost:3000/api/yystopf/ceshi/webhooks/3/test.json
    参数webhook ID
    -

    返回字段说明:

    +

    返回字段说明:

    返回的JSON示例: