查询参数是 URL 中可以定制的部分,用于在 GitHub上共享特定的网页视图,如搜索过滤结果、议题模板或发行版表单页面。 要创建自己的查询参数,必须将键与值进行配对。
必须具有适当的权限才可执行使用相关查询参数的操作。 例如,必须具有创建发行版的权限才可预填发行版表单。 有关详细信息,请参阅“管理存储库中的发行版”。
如果使用查询参数创建无效的 URL,或者没有适当的权限,URL 将返回 404 错误页。
支持的查询参数
| 查询参数 | 示例 |
|---|---|
tag |
`https://github.com/octo-org/octo-repo/releases/new?tag=v1.0.1` 基于名为“v1.0.1”的标记创建发行版本。
target | https://github.com/octo-org/octo-repo/releases/new?target=release-1.0.1 基于对“release-1.0.1”分支的最新提交创建发布。
title | https://github.com/octo-org/octo-repo/releases/new?tag=v1.0.1&title=octo-1.0.1 基于名为“v1.0.1”的标签创建名为“octo-1.0.1”的发布。
body | https://github.com/octo-org/octo-repo/releases/new?body=Adds+widgets+support 创建在发布正文中包含描述“添加小组件支持”的发布。
prerelease | https://github.com/octo-org/octo-repo/releases/new?prerelease=1 创建标识为非生产就绪的发布。
其他阅读材料
-
[AUTOTITLE](/issues/tracking-your-work-with-issues/creating-an-issue#creating-an-issue-from-a-url-query) -
[AUTOTITLE](/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/using-query-parameters-to-create-a-pull-request)