1
0
mirror of synced 2025-12-30 12:02:01 -05:00

New translation batch for cn (#28808)

This commit is contained in:
docubot
2022-06-29 13:31:20 +02:00
committed by GitHub
parent 0f450e97da
commit f1e73165c0
162 changed files with 4859 additions and 718 deletions

View File

@@ -91,6 +91,7 @@ translations/zh-CN/content/admin/monitoring-activity-in-your-enterprise/analyzin
translations/zh-CN/content/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/audit-log-events-for-your-enterprise.md,broken liquid tags
translations/zh-CN/content/admin/overview/about-enterprise-accounts.md,Listed in localization-support#489
translations/zh-CN/content/admin/overview/about-enterprise-accounts.md,rendering error
translations/zh-CN/content/admin/overview/about-github-enterprise-server.md,broken liquid tags
translations/zh-CN/content/admin/overview/creating-an-enterprise-account.md,broken liquid tags
translations/zh-CN/content/admin/packages/configuring-package-ecosystem-support-for-your-enterprise.md,broken liquid tags
translations/zh-CN/content/admin/packages/enabling-github-packages-with-aws.md,broken liquid tags
@@ -156,6 +157,8 @@ translations/zh-CN/content/code-security/code-scanning/using-codeql-code-scannin
translations/zh-CN/content/code-security/code-scanning/using-codeql-code-scanning-with-your-existing-ci-system/installing-codeql-cli-in-your-ci-system.md,broken liquid tags
translations/zh-CN/content/code-security/code-scanning/using-codeql-code-scanning-with-your-existing-ci-system/running-codeql-runner-in-your-ci-system.md,broken liquid tags
translations/zh-CN/content/code-security/dependabot/dependabot-alerts/about-dependabot-alerts.md,rendering error
translations/zh-CN/content/code-security/dependabot/dependabot-alerts/browsing-security-advisories-in-the-github-advisory-database.md,broken liquid tags
translations/zh-CN/content/code-security/dependabot/dependabot-alerts/configuring-dependabot-alerts.md,broken liquid tags
translations/zh-CN/content/code-security/dependabot/dependabot-security-updates/about-dependabot-security-updates.md,broken liquid tags
translations/zh-CN/content/code-security/dependabot/dependabot-security-updates/configuring-dependabot-security-updates.md,broken liquid tags
translations/zh-CN/content/code-security/dependabot/index.md,broken liquid tags
@@ -185,6 +188,9 @@ translations/zh-CN/content/codespaces/managing-codespaces-for-your-organization/
translations/zh-CN/content/codespaces/the-githubdev-web-based-editor.md,broken liquid tags
translations/zh-CN/content/codespaces/troubleshooting/troubleshooting-your-connection-to-codespaces.md,broken liquid tags
translations/zh-CN/content/communities/maintaining-your-safety-on-github/reporting-abuse-or-spam.md,broken liquid tags
translations/zh-CN/content/copilot/configuring-github-copilot/configuring-github-copilot-in-visual-studio-code.md,broken liquid tags
translations/zh-CN/content/copilot/configuring-github-copilot/configuring-github-copilot-in-visual-studio.md,broken liquid tags
translations/zh-CN/content/copilot/getting-started-with-github-copilot/getting-started-with-github-copilot-in-visual-studio.md,broken liquid tags
translations/zh-CN/content/desktop/contributing-and-collaborating-using-github-desktop/adding-and-cloning-repositories/adding-an-existing-project-to-github-using-github-desktop.md,broken liquid tags
translations/zh-CN/content/desktop/installing-and-configuring-github-desktop/configuring-and-customizing-github-desktop/about-git-large-file-storage-and-github-desktop.md,broken liquid tags
translations/zh-CN/content/desktop/installing-and-configuring-github-desktop/installing-and-authenticating-to-github-desktop/about-connections-to-github.md,broken liquid tags
1 file reason
91 translations/zh-CN/content/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/audit-log-events-for-your-enterprise.md broken liquid tags
92 translations/zh-CN/content/admin/overview/about-enterprise-accounts.md Listed in localization-support#489
93 translations/zh-CN/content/admin/overview/about-enterprise-accounts.md rendering error
94 translations/zh-CN/content/admin/overview/about-github-enterprise-server.md broken liquid tags
95 translations/zh-CN/content/admin/overview/creating-an-enterprise-account.md broken liquid tags
96 translations/zh-CN/content/admin/packages/configuring-package-ecosystem-support-for-your-enterprise.md broken liquid tags
97 translations/zh-CN/content/admin/packages/enabling-github-packages-with-aws.md broken liquid tags
157 translations/zh-CN/content/code-security/code-scanning/using-codeql-code-scanning-with-your-existing-ci-system/installing-codeql-cli-in-your-ci-system.md broken liquid tags
158 translations/zh-CN/content/code-security/code-scanning/using-codeql-code-scanning-with-your-existing-ci-system/running-codeql-runner-in-your-ci-system.md broken liquid tags
159 translations/zh-CN/content/code-security/dependabot/dependabot-alerts/about-dependabot-alerts.md rendering error
160 translations/zh-CN/content/code-security/dependabot/dependabot-alerts/browsing-security-advisories-in-the-github-advisory-database.md broken liquid tags
161 translations/zh-CN/content/code-security/dependabot/dependabot-alerts/configuring-dependabot-alerts.md broken liquid tags
162 translations/zh-CN/content/code-security/dependabot/dependabot-security-updates/about-dependabot-security-updates.md broken liquid tags
163 translations/zh-CN/content/code-security/dependabot/dependabot-security-updates/configuring-dependabot-security-updates.md broken liquid tags
164 translations/zh-CN/content/code-security/dependabot/index.md broken liquid tags
188 translations/zh-CN/content/codespaces/the-githubdev-web-based-editor.md broken liquid tags
189 translations/zh-CN/content/codespaces/troubleshooting/troubleshooting-your-connection-to-codespaces.md broken liquid tags
190 translations/zh-CN/content/communities/maintaining-your-safety-on-github/reporting-abuse-or-spam.md broken liquid tags
191 translations/zh-CN/content/copilot/configuring-github-copilot/configuring-github-copilot-in-visual-studio-code.md broken liquid tags
192 translations/zh-CN/content/copilot/configuring-github-copilot/configuring-github-copilot-in-visual-studio.md broken liquid tags
193 translations/zh-CN/content/copilot/getting-started-with-github-copilot/getting-started-with-github-copilot-in-visual-studio.md broken liquid tags
194 translations/zh-CN/content/desktop/contributing-and-collaborating-using-github-desktop/adding-and-cloning-repositories/adding-an-existing-project-to-github-using-github-desktop.md broken liquid tags
195 translations/zh-CN/content/desktop/installing-and-configuring-github-desktop/configuring-and-customizing-github-desktop/about-git-large-file-storage-and-github-desktop.md broken liquid tags
196 translations/zh-CN/content/desktop/installing-and-configuring-github-desktop/installing-and-authenticating-to-github-desktop/about-connections-to-github.md broken liquid tags

View File

@@ -56,7 +56,7 @@ shortTitle: 您的个人资料自述文件
生成的自述文件用模板预先填充,为您创建个人资料自述文件提供一些启发。 ![带有预填充模板的自述文件](/assets/images/help/repository/personal-repository-readme-template.png)
有关所有可用表情符号及其代码的摘要,请参阅“[表情符号备忘清单](http://www.emoji-cheat-sheet.com/)” 。
有关所有可用表情符号及其代码的摘要,请参阅“[表情符号备忘清单](https://www.webfx.com/tools/emoji-cheat-sheet/)” 。
## 删除个人资料自述文件

View File

@@ -30,7 +30,7 @@ shortTitle: 个性化
**注意{% ifversion ghec %}s{% endif %}**{% ifversion ghec %}
* {% endif %}头像应为 1 MB 以下的 PNG、JPG 或 GIF 文件。 为获取质量最佳的渲染,建议图像的像素保持在大约 500 x 500 像素。
* {% endif %}您的头像应为 PNG、JPG 或 GIF 文件,并且其大小必须小于 1 MB 且小于 3000 x 3000 像素。 为获取质量最佳的渲染,建议图像的像素保持在大约 500 x 500 像素。
{% ifversion ghec %}* {% data variables.product.prodname_emus %} 不支持 Gravatar 头像。{% endif %}
{% endnote %}
@@ -39,14 +39,14 @@ shortTitle: 个性化
{% data reusables.user-settings.access_settings %}
2. 在 **Profile Picture头像**下,单击 {% octicon "pencil" aria-label="The edit icon" %} **Edit编辑**。 ![编辑头像](/assets/images/help/profile/edit-profile-photo.png)
3. 单击 **Upload a photo...(上传片...** ![更新头像](/assets/images/help/profile/edit-profile-picture-options.png)
3. 单击 **Upload a photo...(上传片...**{% ifversion not ghae %} ![Update profile picture](/assets/images/help/profile/edit-profile-picture-options.png){% endif %}
3. 裁剪图片。 完成后,单击 **Set new profile picture设置新头像**。 ![裁剪上传的照片](/assets/images/help/profile/avatar_crop_and_save.png)
### 将头像重置为默认肖像
{% data reusables.user-settings.access_settings %}
2. 在 **Profile Picture头像**下,单击 {% octicon "pencil" aria-label="The edit icon" %} **Edit编辑**。 ![编辑头像](/assets/images/help/profile/edit-profile-photo.png)
3. 要还原为默认肖像,请单击 **Remove photo删除照片**。 如果您的电子邮件地址与[个人全球统一标识](https://en.gravatar.com/)关联,则无法还原到默认肖像。 此时请单击 **Revert to Gravatar还原到个人全球统一标识**。 ![更新头像](/assets/images/help/profile/edit-profile-picture-options.png)
3. 要还原为默认肖像,请单击 **Remove photo删除照片**{% ifversion not ghae %}如果您的电子邮件地址与[个人全球统一标识](https://en.gravatar.com/)关联,则无法还原到默认肖像。 此时请单击 **Revert to Gravatar还原到个人全球统一标识**。 ![Update profile picture](/assets/images/help/profile/edit-profile-picture-options.png){% endif %}
## 更改个人资料名称

View File

@@ -49,8 +49,8 @@ shortTitle: 仓库权限
{% endif %}
| 自定义仓库的社交媒体预览 | "[自定义仓库的社交媒体预览](/github/administering-a-repository/customizing-your-repositorys-social-media-preview)" |
| 从仓库创建模板 | "[创建模板仓库](/github/creating-cloning-and-archiving-repositories/creating-a-template-repository)" |{% ifversion fpt or ghes or ghae or ghec %}
| Control access to {% data variables.product.prodname_dependabot_alerts %} | "[管理仓库的安全和分析设置](/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-security-and-analysis-settings-for-your-repository#granting-access-to-security-alerts)" |{% endif %}{% ifversion fpt or ghec %}
| 忽略仓库中的 {% data variables.product.prodname_dependabot_alerts %} | "[Viewing and updating {% data variables.product.prodname_dependabot_alerts %}](/code-security/dependabot/dependabot-alerts/viewing-and-updating-dependabot-alerts)" |
| 控制对 {% data variables.product.prodname_dependabot_alerts %} 的访问 | "[管理仓库的安全和分析设置](/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-security-and-analysis-settings-for-your-repository#granting-access-to-security-alerts)" |{% endif %}{% ifversion fpt or ghec %}
| 忽略仓库中的 {% data variables.product.prodname_dependabot_alerts %} | [查看和更新 {% data variables.product.prodname_dependabot_alerts %}](/code-security/dependabot/dependabot-alerts/viewing-and-updating-dependabot-alerts) |
| 管理私有仓库的数据使用 | “[管理私有仓库的数据使用设置](/get-started/privacy-on-github/managing-data-use-settings-for-your-private-repository)”
{% endif %}
| 定义仓库的代码所有者 | "[关于代码所有者](/github/creating-cloning-and-archiving-repositories/about-code-owners)" |

View File

@@ -0,0 +1,217 @@
---
title: Building and testing Go
intro: You can create a continuous integration (CI) workflow to build and test your Go project.
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
type: tutorial
topics:
- CI
shortTitle: Build & test Go
---
{% data reusables.actions.enterprise-beta %}
{% data reusables.actions.enterprise-github-hosted-runners %}
## 简介
This guide shows you how to build, test, and publish a Go package.
{% ifversion ghae %}
{% data reusables.actions.self-hosted-runners-software %}
{% else %} {% data variables.product.prodname_dotcom %}-hosted runners have a tools cache with preinstalled software, which includes the dependencies for Go. For a full list of up-to-date software and the preinstalled versions of Go, see "[About {% data variables.product.prodname_dotcom %}-hosted runners](/actions/using-github-hosted-runners/about-github-hosted-runners#preinstalled-software)."
{% endif %}
## 基本要求
您应该已经熟悉 YAML 语法及其如何与 {% data variables.product.prodname_actions %} 结合使用。 更多信息请参阅“[{% data variables.product.prodname_actions %} 的工作流程语法](/actions/using-workflows/workflow-syntax-for-github-actions)”。
We recommend that you have a basic understanding of the Go language. For more information, see [Getting started with Go](https://golang.org/doc/tutorial/getting-started).
## Using the Go starter workflow
{% data variables.product.prodname_dotcom %} provides a Go starter workflow that should work for most Go projects. 本指南包含可用于自定义入门工作流程的示例。 For more information, see the [Go starter workflow](https://github.com/actions/starter-workflows/blob/main/ci/go.yml).
要快速开始,请将入门工作流程添加到仓库的 `.github/workflows` 目录中。
```yaml{:copy}
name: Go package
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: {% data reusables.actions.action-checkout %}
- name: Set up Go
uses: {% data reusables.actions.action-setup-go %}
with:
go-version: 1.15
- name: Build
run: go build -v ./...
- name: Test
run: go test -v ./...
```
## Specifying a Go version
The easiest way to specify a Go version is by using the `setup-go` action provided by {% data variables.product.prodname_dotcom %}. For more information see, the [`setup-go` action](https://github.com/actions/setup-go/).
To use a preinstalled version of Go on a {% data variables.product.prodname_dotcom %}-hosted runner, pass the relevant version to the `go-version` property of the `setup-go` action. This action finds a specific version of Go from the tools cache on each runner, and adds the necessary binaries to `PATH`. 这些更改将持续用于作业的其余部分。
The `setup-go` action is the recommended way of using Go with {% data variables.product.prodname_actions %}, because it helps ensure consistent behavior across different runners and different versions of Go. If you are using a self-hosted runner, you must install Go and add it to `PATH`.
### Using multiple versions of Go
```yaml{:copy}
name: Go
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.14', '1.15', '1.16.x' ]
steps:
- uses: {% data reusables.actions.action-checkout %}
- name: Setup Go {% raw %}${{ matrix.go-version }}{% endraw %}
uses: {% data reusables.actions.action-setup-go %}
with:
go-version: {% raw %}${{ matrix.go-version }}{% endraw %}
# You can test your matrix by printing the current Go version
- name: Display Go version
run: go version
```
### Using a specific Go version
You can configure your job to use a specific version of Go, such as `1.16.2`. 或者,您也可以使用语义版本语法来获得最新的次要版本。 This example uses the latest patch release of Go 1.16:
```yaml{:copy}
- name: Setup Go 1.16.x
uses: {% data reusables.actions.action-setup-go %}
with:
# Semantic version range syntax or exact version of Go
go-version: '1.16.x'
```
## 安装依赖项
You can use `go get` to install dependencies:
```yaml{:copy}
steps:
- uses: {% data reusables.actions.action-checkout %}
- name: Setup Go
uses: {% data reusables.actions.action-setup-go %}
with:
go-version: '1.16.x'
- name: Install dependencies
run: |
go get .
go get example.lab/octo-examplemodule
go get example.lab/octo-examplemodule@v1.3.4
```
{% ifversion actions-caching %}
### 缓存依赖项
You can cache and restore the dependencies using the [`setup-go` action](https://github.com/actions/setup-go). By default, caching is disabled, but you can set the `cache` parameter to `true` to enable it.
When caching is enabled, the `setup-go` action searches for the dependency file, `go.sum`, in the repository root and uses the hash of the dependency file as a part of the cache key.
```yaml{:copy}
- name: Setup Go
uses: {% data reusables.actions.action-setup-go %}
with:
go-version: '1.16.x'
cache: true
```
Alternatively, you can use the `cache-dependency-path` parameter for cases when multiple dependency files are used, or when they are located in different subdirectories.
```yaml{:copy}
- uses: {% data reusables.actions.action-setup-go %}
with:
go-version: '1.17'
cache: true
cache-dependency-path: subdir/go.sum
```
如果您有自定义要求或需要更精确的缓存控制,则可以使用 [`cache` 操作](https://github.com/marketplace/actions/cache)。 更多信息请参阅“[缓存依赖项以加快工作流程](/actions/using-workflows/caching-dependencies-to-speed-up-workflows)”。
{% endif %}
## 构建和测试代码
您可以使用与本地相同的命令来构建和测试代码。 This example workflow demonstrates how to use `go build` and `go test` in a job:
```yaml{:copy}
name: Go
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: {% data reusables.actions.action-checkout %}
- name: Setup Go
uses: {% data reusables.actions.action-setup-go %}
with:
go-version: '1.16.x'
- name: Install dependencies
run: go get .
- name: Build
run: go build -v ./...
- name: Test with the Go CLI
run: go test
```
## 将工作流数据打包为构件
工作流程完成后,您可以上传产生的项目进行分析。 例如,您可能需要保存日志文件、核心转储、测试结果或屏幕截图。 下面的示例演示如何使用 `upload-artifact` 操作来上传测试结果。
For more information, see "[Storing workflow data as artifacts](/actions/using-workflows/storing-workflow-data-as-artifacts)."
```yaml{:copy}
name: Upload Go test results
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.14', '1.15', '1.16.x' ]
steps:
- uses: {% data reusables.actions.action-checkout %}
- name: Setup Go
uses: {% data reusables.actions.action-setup-go %}
with:
go-version: {% raw %}${{ matrix.go-version }}{% endraw %}
- name: Install dependencies
run: go get .
- name: Test with Go
run: go test -json > TestResults-{% raw %}${{ matrix.go-version }}{% endraw %}.json
- name: Upload Go test results
uses: {% data reusables.actions.action-upload-artifact %}
with:
name: Go-results-{% raw %}${{ matrix.go-version }}{% endraw %}
path: TestResults-{% raw %}${{ matrix.go-version }}{% endraw %}.json
```

View File

@@ -57,7 +57,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9"]
python-version: ["3.7", "3.8", "3.9", "3.10"]
steps:
- uses: {% data reusables.actions.action-checkout %}
@@ -114,7 +114,7 @@ jobs:
# You can use PyPy versions in python-version.
# For example, {% ifversion actions-node16-action %}pypy-2.7 and pypy-3.8{% else %}pypy2 and pypy3{% endif %}
matrix:
python-version: ["2.7", "3.6", "3.7", "3.8", "3.9"]
python-version: ["2.7", "3.7", "3.8", "3.9", "3.10"]
steps:
- uses: {% data reusables.actions.action-checkout %}
@@ -129,7 +129,7 @@ jobs:
### 使用特定的 Python 版本
您可以配置 python 的特定版本。 例如3.8。 或者,您也可以使用语义版本语法来获得最新的次要版本。 此示例使用 Python 3 最新的次要版本。
您可以配置 python 的特定版本。 例如3.9。 或者,您也可以使用语义版本语法来获得最新的次要版本。 此示例使用 Python 3 最新的次要版本。
```yaml{:copy}
name: Python package
@@ -173,12 +173,12 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.6", "3.7", "3.8", "3.9", {% ifversion actions-node16-action %}pypy-2.7, pypy-3.8{% else %}pypy2, pypy3{% endif %}]
python-version: ["3.7", "3.8", "3.9", "3.10", {% ifversion actions-node16-action %}pypy-2.7, pypy-3.8{% else %}pypy2, pypy3{% endif %}]
exclude:
- os: macos-latest
python-version: "3.6"
python-version: "3.7"
- os: windows-latest
python-version: "3.6"
python-version: "3.7"
```
### 使用默认 Python 版本
@@ -238,7 +238,7 @@ steps:
- uses: {% data reusables.actions.action-checkout %}
- uses: {% data reusables.actions.action-setup-python %}
with:
python-version: '3.9'
python-version: '3.10'
cache: 'pip'
- run: pip install -r requirements.txt
- run: pip test
@@ -315,7 +315,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.7", "3.8", "3.9"]
python: ["3.8", "3.9", "3.10"]
steps:
- uses: {% data reusables.actions.action-checkout %}
@@ -347,7 +347,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9"]
python-version: ["3.7", "3.8", "3.9", "3.10"]
steps:
- uses: {% data reusables.actions.action-checkout %}

View File

@@ -18,6 +18,7 @@ redirect_from:
- /actions/automating-builds-and-tests/building-and-testing-nodejs-or-python
children:
- /about-continuous-integration
- /building-and-testing-go
- /building-and-testing-java-with-ant
- /building-and-testing-java-with-gradle
- /building-and-testing-java-with-maven

View File

@@ -664,254 +664,249 @@ branding:
<td>eye</td>
</tr>
<tr>
<td>facebook</td>
<td>快进</td>
<td>feather</td>
<td>file-minus</td>
<td>file-plus</td>
</tr>
<tr>
<td>file-plus</td>
<td>file-text</td>
<td>文件</td>
<td>film</td>
<td>filter</td>
</tr>
<tr>
<td>filter</td>
<td>flag</td>
<td>folder-minus</td>
<td>folder-plus</td>
<td>folder</td>
</tr>
<tr>
<td>folder</td>
<td>gift</td>
<td>git-branch</td>
<td>git-commit</td>
<td>git-merge</td>
</tr>
<tr>
<td>git-merge</td>
<td>git-pull-request</td>
<td>globe</td>
<td>grid</td>
<td>hard-drive</td>
</tr>
<tr>
<td>hard-drive</td>
<td>哈希</td>
<td>headphones</td>
<td>heart</td>
<td>help-circle</td>
</tr>
<tr>
<td>help-circle</td>
<td>home</td>
<td>image</td>
<td>inbox</td>
<td>info</td>
</tr>
<tr>
<td>info</td>
<td>italic</td>
<td>layers</td>
<td>layout</td>
<td>life-buoy</td>
</tr>
<tr>
<td>life-buoy</td>
<td>link-2</td>
<td>link</td>
<td>list</td>
<td>loader</td>
</tr>
<tr>
<td>loader</td>
<td>lock</td>
<td>log-in</td>
<td>log-out</td>
<td>mail</td>
</tr>
<tr>
<td>mail</td>
<td>map-pin</td>
<td>map</td>
<td>maximize-2</td>
<td>maximize</td>
</tr>
<tr>
<td>maximize</td>
<td>menu</td>
<td>message-circle</td>
<td>message-square</td>
<td>mic-off</td>
</tr>
<tr>
<td>mic-off</td>
<td>mic</td>
<td>minimize-2</td>
<td>minimize</td>
<td>minus-circle</td>
</tr>
<tr>
<td>minus-circle</td>
<td>minus-square</td>
<td>minus</td>
<td>monitor</td>
<td>moon</td>
</tr>
<tr>
<td>moon</td>
<td>more-horizontal</td>
<td>more-vertical</td>
<td>move</td>
<td>music</td>
</tr>
<tr>
<td>music</td>
<td>navigation-2</td>
<td>navigation</td>
<td>octagon</td>
<td>package</td>
</tr>
<tr>
<td>package</td>
<td>paperclip</td>
<td>pause-circle</td>
<td>pause</td>
<td>percent</td>
</tr>
<tr>
<td>percent</td>
<td>phone-call</td>
<td>phone-forwarded</td>
<td>phone-incoming</td>
<td>phone-missed</td>
</tr>
<tr>
<td>phone-missed</td>
<td>phone-off</td>
<td>phone-outgoing</td>
<td>phone</td>
<td>pie-chart</td>
</tr>
<tr>
<td>pie-chart</td>
<td>play-circle</td>
<td>play</td>
<td>plus-circle</td>
<td>plus-square</td>
</tr>
<tr>
<td>plus-square</td>
<td>plus</td>
<td>pocket</td>
<td>power</td>
<td>printer</td>
</tr>
<tr>
<td>printer</td>
<td>radio</td>
<td>refresh-ccw</td>
<td>refresh-cw</td>
<td>repeat</td>
</tr>
<tr>
<td>repeat</td>
<td>倒回</td>
<td>rotate-ccw</td>
<td>rotate-cw</td>
<td>rss</td>
</tr>
<tr>
<td>rss</td>
<td>save</td>
<td>scissors</td>
<td>search</td>
<td>send</td>
</tr>
<tr>
<td>send</td>
<td>server</td>
<td>settings</td>
<td>share-2</td>
<td>share</td>
</tr>
<tr>
<td>share</td>
<td>shield-off</td>
<td>shield</td>
<td>shopping-bag</td>
<td>shopping-cart</td>
</tr>
<tr>
<td>shopping-cart</td>
<td>shuffle</td>
<td>边栏</td>
<td>skip-back</td>
<td>skip-forward</td>
</tr>
<tr>
<td>skip-forward</td>
<td>slash</td>
<td>sliders</td>
<td>smartphone</td>
<td>speaker</td>
</tr>
<tr>
<td>speaker</td>
<td>square</td>
<td>星标</td>
<td>stop-circle</td>
<td>sun</td>
</tr>
<tr>
<td>sun</td>
<td>sunrise</td>
<td>sunset</td>
<td>tablet</td>
<td>标记</td>
</tr>
<tr>
<td>标记</td>
<td>target</td>
<td>terminal</td>
<td>thermometer</td>
<td>thumbs-down</td>
</tr>
<tr>
<td>thumbs-down</td>
<td>thumbs-up</td>
<td>toggle-left</td>
<td>toggle-right</td>
<td>trash-2</td>
</tr>
<tr>
<td>trash-2</td>
<td>trash</td>
<td>trending-down</td>
<td>trending-up</td>
<td>triangle</td>
</tr>
<tr>
<td>triangle</td>
<td>truck</td>
<td>tv</td>
<td>type</td>
<td>umbrella</td>
</tr>
<tr>
<td>umbrella</td>
<td>underline</td>
<td>unlock</td>
<td>upload-cloud</td>
<td>上传</td>
</tr>
<tr>
<td>上传</td>
<td>user-check</td>
<td>user-minus</td>
<td>user-plus</td>
<td>user-x</td>
</tr>
<tr>
<td>user-x</td>
<td>用户</td>
<td>用户</td>
<td>video-off</td>
<td>video</td>
</tr>
<tr>
<td>video</td>
<td>voicemail</td>
<td>volume-1</td>
<td>volume-2</td>
<td>volume-x</td>
</tr>
<tr>
<td>volume-x</td>
<td>volume</td>
<td>查看</td>
<td>wifi-off</td>
<td>wifi</td>
</tr>
<tr>
<td>wifi</td>
<td>wind</td>
<td>x-circle</td>
<td>x-square</td>
<td>x</td>
</tr>
<tr>
<td>x</td>
<td>zap-off</td>
<td>zap</td>
<td>zoom-in</td>
</tr>
<tr>
<td>zoom-out</td>
<td></td>
<td></td>
<td></td>
</tr>
</table>

View File

@@ -57,6 +57,12 @@ There are some limits on {% data variables.product.prodname_actions %} usage whe
| Pro | 40 | 5 |
| Team | 60 | 5 |
| Enterprise | 180 | 50 |
{% note %}
**Note:** If required, customers on enterprise plans can request a higher limit for concurrent jobs. For more information, contact {% data variables.contact.contact_ent_support %} or your sales representative.
{% endnote %}
- **Job matrix** - {% data reusables.actions.usage-matrix-limits %}
{% data reusables.actions.usage-workflow-queue-limits %}

View File

@@ -24,32 +24,13 @@ miniTocMaxHeadingLevel: 3
要缓存作业的依赖项,可以使用 {% data variables.product.prodname_dotcom %} 的 [`cache` 操作](https://github.com/actions/cache)。 该操作将创建并还原由唯一键标识的缓存。 或者,如果要缓存下面列出的包管理器,则使用其各自的 setup-* 操作时需要的配置最少,并且将为您创建和还原依赖项缓存。
<table>
<thead>
<tr>
<th>包管理器</th>
<th>用于缓存的 setup-* 操作</th>
</tr>
</thead>
<tbody>
<tr>
<td>npm, yarn, pnpm</td>
<td><a href="https://github.com/actions/setup-node#caching-global-packages-data">setup-node</a></td>
</tr>
<tr>
<td>pip, pipenv, poetry</td>
<td><a href="https://github.com/actions/setup-python#caching-packages-dependencies">setup-python</a></td>
</tr>
<tr>
<td>gradle, maven</td>
<td><a href="https://github.com/actions/setup-java#caching-packages-dependencies">setup-java</a></td>
</tr>
<tr>
<td>ruby gems</td>
<td><a href="https://github.com/ruby/setup-ruby#caching-bundle-install-automatically">setup-ruby</a></td>
</tr>
</tbody>
</table>
| 包管理器 | 用于缓存的 setup-* 操作 |
| ------------------- | ------------------------------------------------------------------------------------------ |
| npm, Yarn, pnpm | [setup-node](https://github.com/actions/setup-node#caching-global-packages-data) |
| pip, pipenv, Poetry | [setup-python](https://github.com/actions/setup-python#caching-packages-dependencies) |
| Gradle, Maven | [setup-java](https://github.com/actions/setup-java#caching-packages-dependencies) |
| RubyGems | [setup-ruby](https://github.com/ruby/setup-ruby#caching-bundle-install-automatically) |
| Go `go.sum` | [setup-go](https://github.com/actions/setup-go#caching-dependency-files-and-build-outputs) |
{% warning %}
@@ -269,6 +250,6 @@ restore-keys: |
## 管理缓存
您可以使用 {% data variables.product.product_name %} REST API 来管理缓存。 目前,您可以使用 API 查看缓存使用情况,并期望在未来的更新中提供更多功能。 更多信息请参阅 REST API 文档中的“[操作](/rest/reference/actions#cache)”。
您可以使用 {% data variables.product.product_name %} REST API 来管理缓存。 {% ifversion actions-cache-list-delete-apis %}您可以使用 API 列出和删除缓存条目,并查看缓存使用情况。{% elsif actions-cache-management %}目前,您可以使用 API 查看缓存使用情况,预计在将来的更新中会有更多功能。{% endif %} 有关详细信息请参阅“[{% data variables.product.prodname_actions %} 缓存](/rest/actions/cache)”REST API 文档
{% endif %}

View File

@@ -921,6 +921,12 @@ on:
push
```
{% note %}
**注意**:当 `push` web 挂钩事件触发工作流程运行时,操作 UI 的“推送者”字段显示推送者的帐户,而不是作者或提交者的帐户。 但是,如果使用带有部署密钥的 SSH 身份验证将更改推送到存储库,则“推送者”字段将是存储库管理员,他在将部署密钥添加到存储库时对其进行了验证。
{% endnote %}
#### 仅在推送到特定分支时运行工作流程
您可以使用 `branches``branches-ignore` 筛选器,将工作流程配置为仅在推送特定分支时运行。 更多信息请参阅“[GitHub Actions 的工作流程语法](/actions/learn-github-actions/workflow-syntax-for-github-actions#onpushbranchestagsbranches-ignoretags-ignore)”。

View File

@@ -17,7 +17,7 @@ topics:
如果配置的是主机名,而不是硬编码 IP 地址,您将能够更改运行 {% data variables.product.product_location %} 的物理硬件,而不会影响用户或客户端软件。
{% data variables.enterprise.management_console %} 中的主机名设置应设置为合适的完全限定域名 (FQDN),此域名可在互联网上或您的内部网络内解析。 例如,您的主机名设置可能是 `github.companyname.com。` Web 和 API 请求将自动重定向到 {% data variables.enterprise.management_console %} 中配置的主机名。
{% data variables.enterprise.management_console %} 中的主机名设置应设置为合适的完全限定域名 (FQDN),此域名可在互联网上或您的内部网络内解析。 例如,您的主机名设置可能是 `github.companyname.com。` Web 和 API 请求将自动重定向到 {% data variables.enterprise.management_console %} 中配置的主机名。 请注意,`localhost` 不是有效的主机名设置。
配置主机名后,可以启用子域隔离以进一步提高 {% data variables.product.product_location %} 的安全性。 更多信息请参阅“[启用子域隔离](/enterprise/admin/guides/installation/enabling-subdomain-isolation/)”。

View File

@@ -36,6 +36,8 @@ topics:
您可以使用 `ghe-ssl-generate-csr` 命令为实例生成证书签名请求 (CSR)。 更多信息请参阅“[命令行实用程序](/enterprise/admin/guides/installation/command-line-utilities/#ghe-ssl-generate-csr)”。
您的密钥必须是 RSA 密钥,并且不能有密码。 更多信息请参阅“[将密码从密钥文件中移除](/admin/guides/installation/troubleshooting-ssl-errors#removing-the-passphrase-from-your-key-file)”。
## 上传自定义 TLS 证书
{% data reusables.enterprise_site_admin_settings.tls-downtime %}
@@ -48,11 +50,6 @@ topics:
5. 在“Certificate”下单击 **Choose File**,选择要安装的 TLS 证书或证书链PEM 格式)。 此文件通常采用 *.pem*、*.crt* 或 *.cer* 扩展名。 ![用于查找 TLS 证书文件的按钮](/assets/images/enterprise/management-console/install-tls-certificate.png)
6. 在“Unencrypted key未加密密钥”下单击 **Choose File选择文件**选择要安装的 RSA 密钥PEM 格式)。 此文件通常采用 *.key* 扩展名。 ![用于查找 TLS 密钥文件的按钮](/assets/images/enterprise/management-console/install-tls-key.png)
{% warning %}
**警告**:您的密钥必须是 RSA 密钥,并且不能有密码。 更多信息请参阅“[将密码从密钥文件中移除](/admin/guides/installation/troubleshooting-ssl-errors#removing-the-passphrase-from-your-key-file)”。
{% endwarning %}
{% data reusables.enterprise_management_console.save-settings %}
## 关于 Let's Encrypt 支持

View File

@@ -6,6 +6,7 @@ redirect_from:
- /enterprise/admin/guides/installation/finding-the-current-github-enterprise-release
- /enterprise/admin/enterprise-management/upgrade-requirements
- /admin/enterprise-management/upgrade-requirements
- /enterprise/admin/guides/installation/about-upgrade-requirements
versions:
ghes: '*'
type: reference

View File

@@ -22,7 +22,7 @@ shortTitle: MinIO Gateway for NAS storage
Before enabling {% data variables.product.prodname_actions %}, make sure you have completed the following steps:
* To avoid resource contention on the appliance, we recommend that MinIO be hosted separately from {% data variables.product.product_location %}.
* Create your bucket for storing workflow data. To set up your bucket and access key, see the [MinIO documentation](https://docs.min.io/docs/minio-gateway-for-nas.html). {% indented_data_reference reusables.actions.enterprise-s3-permission spaces=2 %}
* Create your bucket for storing workflow data. {% indented_data_reference reusables.actions.enterprise-s3-permission spaces=2 %}
{% data reusables.actions.enterprise-common-prereqs %}
@@ -38,7 +38,7 @@ Before enabling {% data variables.product.prodname_actions %}, make sure you hav
* **AWS Service URL**: The URL to your MinIO service. For example, `https://my-minio.example:9000`.
* **AWS S3 Bucket**: The name of your S3 bucket.
* **AWS S3 Access Key** and **AWS S3 Secret Key**: The `MINIO_ACCESS_KEY` and `MINIO_SECRET_KEY` used for your MinIO instance. For more information, see the [MinIO documentation](https://docs.min.io/docs/minio-gateway-for-nas.html).
* **AWS S3 Access Key** and **AWS S3 Secret Key**: The `MINIO_ACCESS_KEY` and `MINIO_SECRET_KEY` used for your MinIO instance.
![Radio button for selecting Amazon S3 Storage and fields for MinIO configuration](/assets/images/enterprise/management-console/actions-minio-s3-storage.png)
1. Under "Artifact & Log Storage", select **Force path style**.

View File

@@ -42,8 +42,8 @@ After you configure {% data variables.product.product_location %} to use {% data
Any VM that you use for {% data variables.product.prodname_dependabot %} runners must meet the requirements for self-hosted runners. In addition, they must meet the following requirements.
- Linux operating system
- Git installed
- Linux operating system{% ifversion ghes < 3.5 %}
- Git installed{% endif %}
- Docker installed with access for the runner users:
- We recommend installing Docker in rootless mode and configuring the runners to access Docker without `root` privileges.
- Alternatively, install Docker and give the runner users raised privileges to run Docker.
@@ -68,9 +68,9 @@ If you specify more than 14 concurrent runners on a VM, you must also update the
1. Provision self-hosted runners, at the repository, organization, or enterprise account level. For more information, see "[About self-hosted runners](/actions/hosting-your-own-runners/about-self-hosted-runners)" and "[Adding self-hosted runners](/actions/hosting-your-own-runners/adding-self-hosted-runners)."
2. Set up the self-hosted runners with the requirements described above. For example, on a VM running Ubuntu 20.04 you would:
2. Set up the self-hosted runners with the requirements described above. For example, on a VM running Ubuntu 20.04 you would:{% ifversion ghes < 3.5 %}
- Verify that Git is installed: `command -v git`
- Verify that Git is installed: `command -v git`{% endif %}
- Install Docker and ensure that the runner users have access to Docker. For more information, see the Docker documentation.
- [Install Docker Engine on Ubuntu](https://docs.docker.com/engine/install/ubuntu/)
- Recommended approach: [Run the Docker daemon as a non-root user (Rootless mode)](https://docs.docker.com/engine/security/rootless/)

View File

@@ -30,7 +30,7 @@ You can populate the runner tool cache by running a {% data variables.product.pr
{% note %}
**Note:** You can only use a {% data variables.product.prodname_dotcom %}-hosted runner's tool cache for a self-hosted runner that has an identical operating system and architecture. For example, if you are using a `ubuntu-18.04` {% data variables.product.prodname_dotcom %}-hosted runner to generate a tool cache, your self-hosted runner must be a 64-bit Ubuntu 18.04 machine. For more information on {% data variables.product.prodname_dotcom %}-hosted runners, see "<a href="/actions/reference/virtual-environments-for-github-hosted-runners#supported-runners-and-hardware-resources" class="dotcom-only">Virtual environments for GitHub-hosted runners</a>."
**Note:** You can only use a {% data variables.product.prodname_dotcom %}-hosted runner's tool cache for a self-hosted runner that has an identical operating system and architecture. For example, if you are using a `ubuntu-18.04` {% data variables.product.prodname_dotcom %}-hosted runner to generate a tool cache, your self-hosted runner must be a 64-bit Ubuntu 18.04 machine. For more information on {% data variables.product.prodname_dotcom %}-hosted runners, see "[Virtual environments for GitHub-hosted runners](/free-pro-team@latest/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources)."
{% endnote %}

View File

@@ -96,7 +96,9 @@ Before your developers can use {% data variables.product.prodname_ghe_cloud %} w
{% endnote %}
3. After you log in to your setup user, get started by configuring {% ifversion oidc-for-emu %}how your members will authenticate. If you are using Azure Active Directory as your identity provider, you can choose between OpenID Connect (OIDC) and Security Assertion Markup Language (SAML). Both options provide a seamless sign-in experience for your members, but only OIDC includes support for Conditional Access Policies (CAP). If you are using Okta as your identity provider, you can use SAML to authenticate your members.{% else %}SAML SSO for your enterprise. For more information, see "[Configuring SAML single sign-on for Enterprise Managed Users](/admin/identity-and-access-management/managing-iam-with-enterprise-managed-users/configuring-saml-single-sign-on-for-enterprise-managed-users)."{% endif %}
3. After you log in as the setup user, we recommend enabling two-factor authentication. For more information, see "[Configuring two-factor authentication](/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication)."
1. To get started, configure {% ifversion oidc-for-emu %}how your members will authenticate. If you are using Azure Active Directory as your identity provider, you can choose between OpenID Connect (OIDC) and Security Assertion Markup Language (SAML). Both options provide a seamless sign-in experience for your members, but only OIDC includes support for Conditional Access Policies (CAP). If you are using Okta as your identity provider, you can use SAML to authenticate your members.{% else %}SAML SSO for your enterprise. For more information, see "[Configuring SAML single sign-on for Enterprise Managed Users](/admin/identity-and-access-management/managing-iam-with-enterprise-managed-users/configuring-saml-single-sign-on-for-enterprise-managed-users)."{% endif %}
{% ifversion oidc-for-emu %}

View File

@@ -27,7 +27,7 @@ Groups in your IdP can be used to manage team membership within your enterprise'
Before you can configure provisioning for {% data variables.product.prodname_emus %}, you must configure SAML{% ifversion oidc-for-emu %} or OIDC{% endif %} single-sign on. {% ifversion oidc-for-emu %}
- For more information on configuring OIDC, see "[Configuring OIDC for Enterprise Managed Users](/admin/identity-and-access-management/managing-iam-with-enterprise-managed-users/configuring-oidc-for-enterprise-managed-users)"
- For more information on configuring OIDC, see "[Configuring OIDC for Enterprise Managed Users](/admin/identity-and-access-management/using-enterprise-managed-users-for-iam/configuring-oidc-for-enterprise-managed-users)"
- {% endif %}For information on configuring SAML, see "[Configuring SAML single sign-on for Enterprise Managed Users](/admin/identity-and-access-management/managing-iam-with-enterprise-managed-users/configuring-saml-single-sign-on-for-enterprise-managed-users)."
## Creating a personal access token

View File

@@ -42,6 +42,15 @@ permissions: Enterprise owners can configure audit log streaming.
### 设置流式传输到 Amazon S3
{% ifversion streaming-oidc-s3 %}
您可以使用访问密钥设置流式传输到 S3或者为了避免在 {% data variables.product.product_name %} 中存储长期存在的密钥,请使用 OpenID Connect (OIDC)。
- [使用访问密钥设置流式传输到 S3](#setting-up-streaming-to-s3-with-access-keys)
- [使用 OpenID Connect 设置流式传输到 S3](#setting-up-streaming-to-s3-with-openid-connect)
#### 使用访问密钥设置流式传输到 S3
{% endif %}
要将审核日志流式传输到 Amazon 的 S3 终端节点,您必须拥有存储桶和访问密钥。 更多信息请参阅 AWS 文档中的[创建、配置和使用 Amazon S3 存储桶](https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-buckets-s3.html)。 请务必阻止对存储桶的公共访问,以保护您的审核日志信息。
要设置来自 {% data variables.product.prodname_dotcom %} 审核日志流式处理,您需要:
@@ -52,23 +61,70 @@ permissions: Enterprise owners can configure audit log streaming.
有关创建或访问访问密钥 ID 和密钥的信息,请参阅 AWS 文档中的[了解和获取您的 AWS 凭据](https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html)。
{% data reusables.enterprise.navigate-to-log-streaming-tab %}
1. 单击 **Configure stream配置流**,然后选择 **Amazon S3**
{% data reusables.audit_log.streaming-choose-s3 %}{% ifversion streaming-oidc-s3 %}
1. 在“Authentication身份验证”下单击 **Access keys访问密钥**
![从下拉菜单中选择 Amazon S3](/assets/images/help/enterprises/audit-stream-choice-s3.png)
1. 在配置页面上,输入:
* 要流式传输到的存储桶的名称。 例如,`auditlog-streaming-test`
* 您的访问密钥 ID。 例如,`ABCAIOSFODNN7EXAMPLE1`
* 您的密钥。 例如,`aBcJalrXUtnWXYZ/A1MDENG/zPxRfiCYEXAMPLEKEY`
![输入流设置](/assets/images/help/enterprises/audit-stream-add-s3.png)
1. 单击 **Check endpoint检查端点**以验证 {% data variables.product.prodname_dotcom %} 是否可以连接并写入 Amazon S3 端点。
![检查端点](/assets/images/help/enterprises/audit-stream-check.png)
![用于流式传输到 Amazon S3 的身份验证选项的屏幕截图](/assets/images/help/enterprises/audit-log-streaming-s3-access-keys.png){% endif %}
1. 配置流设置。
- 在“Bucket存储桶”下键入要流式传输到的存储桶的名称。 例如,`auditlog-streaming-test`
- 在“Access Key ID访问密钥 ID”下键入您的访问密钥 ID。 例如,`ABCAIOSFODNN7EXAMPLE1`
- 在“Secret Key密钥”下键入您的密钥。 例如,`aBcJalrXUtnWXYZ/A1MDENG/zPxRfiCYEXAMPLEKEY`
{% data reusables.audit_log.streaming-check-s3-endpoint %}
{% data reusables.enterprise.verify-audit-log-streaming-endpoint %}
{% ifversion streaming-oidc-s3 %}
#### 使用 OpenID Connect 设置流式传输到 S3
1. 在 AWS 中,将 {% data variables.product.prodname_dotcom %} OIDC 提供商添加到 IAM。 有关更多信息,请参阅 AWS 文档中的[创建 OpenID Connect (OIDC) 身份提供程序](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_oidc.html)。
- 对于提供程序 URL请使用 `https://oidc-configuration.audit-log.githubusercontent.com`
- 对于“受众”,请使用 `sts.amazonaws.com`
1. 创建存储桶,并阻止对存储桶的公共访问。 更多信息请参阅 AWS 文档中的[创建、配置和使用 Amazon S3 存储桶](https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-buckets-s3.html)。
1. 创建允许 {% data variables.product.company_short %} 写入存储桶的策略。 {% data variables.product.prodname_dotcom %} 只需要以下权限。
```
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"s3:PutObject"
],
"Resource": "arn:aws:s3:::example-bucket/*"
}
]
}
```
更多信息请参阅 AWS 文档中的[创建 IAM 策略](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html)。
1. 为 {% data variables.product.prodname_dotcom %} IdP 配置角色和信任策略。 更多信息请参阅 AWS 文档中的[为 Web 身份创建角色或 OpenID Connect Federation控制台](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp_oidc.html) 。
- 添加您在上面创建的权限策略以允许写入存储桶。
- 编辑信任关系以将 `sub` 字段添加到验证条件,将 `ENTERPRISE` 替换为企业名称。
```
"Condition": {
"StringEquals": {
"oidc-configuration.audit-log.githubusercontent.com:aud": "sts.amazonaws.com",
"oidc-configuration.audit-log.githubusercontent.com:sub": "https://github.com/ENTERPRISE"
}
}
```
- 记下所创建角色的 Amazon 资源名称 (ARN)。
{% data reusables.enterprise.navigate-to-log-streaming-tab %}
{% data reusables.audit_log.streaming-choose-s3 %}
1. 在“Authentication身份验证”下单击 **OpenID Connect**
![用于流式传输到 Amazon S3 的身份验证选项的屏幕截图](/assets/images/help/enterprises/audit-log-streaming-s3-oidc.png)
1. 配置流设置。
- 在“Bucket存储桶”下键入要流式传输到的存储桶的名称。 例如,`auditlog-streaming-test`
- 在“ARN RoleARN 角色)”下,键入您之前记下的 ARN 角色。 例如 `arn:aws::iam::1234567890:role/github-audit-log-streaming-role`
{% data reusables.audit_log.streaming-check-s3-endpoint %}
{% data reusables.enterprise.verify-audit-log-streaming-endpoint %}
{% endif %}
### 设置流式传输到 Azure Blob Storage
在 {% data variables.product.prodname_dotcom %} 中设置流之前,必须先在 Microsoft Azure 中创建存储帐户和容器。 有关详细信息,请参阅 Microsoft 文档中的“[Azure Blob Storage 简介](https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blobs-introduction)”。

View File

@@ -1,6 +1,6 @@
---
title: About GitHub Enterprise Server
intro: '{% data variables.product.product_name %} is a software development platform that you can host in a private environment.'
intro: "{% data variables.product.product_name %} is a software development platform that you can host in a private environment."
versions:
ghes: '*'
type: overview
@@ -9,7 +9,7 @@ topics:
- Fundamentals
---
## 关于 {% data variables.product.product_name %}
## About {% data variables.product.product_name %}
{% data reusables.enterprise.ghes-is-a-self-hosted-platform %} Your team can use {% data variables.product.product_name %} to build and ship software using Git version control, powerful APIs, productivity and collaboration tools, and integrations. Developers familiar with {% data variables.product.prodname_dotcom_the_website %} can onboard and contribute seamlessly using familiar features and workflows.
@@ -35,7 +35,7 @@ You can deploy {% data variables.product.product_name %} to a virtualization hyp
- Google Cloud Platform (GCP)
- Microsoft Azure
更多信息请参阅“[设置 {% data variables.product.prodname_ghe_server %} 实例](/admin/installation/setting-up-a-github-enterprise-server-instance)”。
For more information, see "[Setting up a {% data variables.product.prodname_ghe_server %} instance](/admin/installation/setting-up-a-github-enterprise-server-instance)."
## About releases and upgrades
@@ -45,7 +45,7 @@ You can deploy {% data variables.product.product_name %} to a virtualization hyp
You can configure and monitor {% data variables.product.product_name %} via browser, administrative SSH access, and REST or GraphQL APIs. {% data variables.product.company_short %} has found that people with Linux administration experience are more successful with the deployment and maintainance of {% data variables.product.product_name %}.
You can give certain employees administrative access to {% data variables.product.product_name %}, so they can set up external authentication, configure the instance to meet developer needs, and monitor the instance's activity and performance. To ensure compliance with business rules or regulatory restrictions, administrators can configure policies that control how people use {% data variables.product.product_location %}. 更多信息请参阅以下文章。
You can give certain employees administrative access to {% data variables.product.product_name %}, so they can set up external authentication, configure the instance to meet developer needs, and monitor the instance's activity and performance. To ensure compliance with business rules or regulatory restrictions, administrators can configure policies that control how people use {% data variables.product.product_location %}. For more information, see the following articles.
- "[About authentication for your enterprise](/admin/identity-and-access-management/managing-iam-for-your-enterprise/about-authentication-for-your-enterprise)"
- "[Configuring your enterprise](/admin/configuration/configuring-your-enterprise)"
@@ -58,42 +58,42 @@ You can give certain employees administrative access to {% data variables.produc
You can configure optional features for {% data variables.product.product_name %} that improve the software development lifecycle for your enterprise.
| 功能 | 描述 | 更多信息 |
|:------------------------------------------------------------ |:---------------------------------------------------------------------------------------------------- |:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| {% data variables.product.prodname_actions %} | Automate CI/CD and development workflows | "[关于企业的 {% data variables.product.prodname_actions %}](/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/about-github-actions-for-enterprises)" |
| {% data variables.product.prodname_github_connect %} | Benefit from the power of {% data variables.product.prodname_dotcom_the_website %} in limited ways | "[关于 {% data variables.product.prodname_github_connect %}](/admin/configuration/configuring-github-connect/about-github-connect)" |
| {% data variables.product.prodname_GH_advanced_security %} | Improve code security and quality | "[关于 {% data variables.product.prodname_GH_advanced_security %}](/get-started/learning-about-github/about-github-advanced-security)" |
| {% data variables.product.prodname_registry %} | Host software packages for your enterprise | "[Introduction to {% data variables.product.prodname_registry %}](/packages/learn-github-packages/introduction-to-github-packages)" |
| Feature | Description | More information |
| :- | :- | :- |
| {% data variables.product.prodname_actions %} | Automate CI/CD and development workflows | "[About {% data variables.product.prodname_actions %} for enterprises](/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/about-github-actions-for-enterprises)" |
| {% data variables.product.prodname_github_connect %} | Benefit from the power of {% data variables.product.prodname_dotcom_the_website %} in limited ways | "[About {% data variables.product.prodname_github_connect %}](/admin/configuration/configuring-github-connect/about-github-connect)" |
| {% data variables.product.prodname_GH_advanced_security %} | Improve code security and quality | "[About {% data variables.product.prodname_GH_advanced_security %}](/get-started/learning-about-github/about-github-advanced-security)" |
| {% data variables.product.prodname_registry %} | Host software packages for your enterprise | "[Introduction to {% data variables.product.prodname_registry %}](/packages/learn-github-packages/introduction-to-github-packages)" |
## About deployment topologies
By default, {% data variables.product.product_name %} runs as a standalone instance. You can increase the reliability and performance of {% data variables.product.product_name %} by using a different topology for your deployment.
- To mitigate the impact of system or network failures, you can deploy a passive replica instance. During an outage that affects your primary instance, you can manually fail over to the replica instance. 更多信息请参阅“[关于高可用性配置](/admin/enterprise-management/configuring-high-availability/about-high-availability-configuration)”。
- You can configure multiple active replicas to improve performance for developers who are geographically distant from your primary instance. 更多信息请参阅“[关于 Geo-replication](/admin/enterprise-management/configuring-high-availability/about-geo-replication)”。
- Some enterprises with tens of thousands of developers may benefit from a cluster configuration that scales horizontally instead of vertically. 更多信息请参阅“[关于集群](/admin/enterprise-management/configuring-clustering/about-clustering)。”
- To mitigate the impact of system or network failures, you can deploy a passive replica instance. During an outage that affects your primary instance, you can manually fail over to the replica instance. For more information, see "[About high availability configuration](/admin/enterprise-management/configuring-high-availability/about-high-availability-configuration)."
- You can configure multiple active replicas to improve performance for developers who are geographically distant from your primary instance. For more information, see "[About geo-replication](/admin/enterprise-management/configuring-high-availability/about-geo-replication)."
- Some enterprises with tens of thousands of developers may benefit from a cluster configuration that scales horizontally instead of vertically. For more information, see "[About clustering](/admin/enterprise-management/configuring-clustering/about-clustering)."
## About backups and disaster recovery
To safeguard against data loss or service disruptions for your developers, {% data variables.product.company_short %} strongly recommends that you establish a plan for disaster recovery. You can back up your instance's configuration and user data by deploying and configuring a Linux or Unix host system with {% data variables.product.prodname_enterprise_backup_utilities %}. 更多信息请参阅“[在设备上配置备份](/admin/configuration/configuring-your-enterprise/configuring-backups-on-your-appliance)”。
To safeguard against data loss or service disruptions for your developers, {% data variables.product.company_short %} strongly recommends that you establish a plan for disaster recovery. You can back up your instance's configuration and user data by deploying and configuring a Linux or Unix host system with {% data variables.product.prodname_enterprise_backup_utilities %}. For more information, see "[Configuring backups on your appliance](/admin/configuration/configuring-your-enterprise/configuring-backups-on-your-appliance)."
Additionally, you can configure a passive replica instance to fail over to in the event of a system or network failure. For more information, see "[About deployment](#about-deployment-topologies)."
## About documentation
Documentation for both administrators and users of {% data variables.product.product_name %} is available on this site, {% data variables.product.prodname_docs %}.
Documentation for both administrators and users of {% data variables.product.product_name %} is available on this site, {% data variables.product.prodname_docs %}.
- [企业管理员文档](/admin)
- [Enterprise administrator documentation](/admin)
- [User documentation](/)
Different versions of {% data variables.product.product_name %} are reflected separately in the documentation on {% data variables.product.prodname_docs %}. 更多信息请参阅“[关于 {% data variables.product.prodname_docs %} 的版本](/get-started/learning-about-github/about-versions-of-github-docs)”。
Different versions of {% data variables.product.product_name %} are reflected separately in the documentation on {% data variables.product.prodname_docs %}. For more information, see "[About versions of {% data variables.product.prodname_docs %}](/get-started/learning-about-github/about-versions-of-github-docs)."
## Trying {% data variables.product.product_name %}
You can sign up for a free, 45-day trial of {% data variables.product.product_name %}. 更多信息请参阅“[设置 {% data variables.product.prodname_ghe_server %} 的试用](/get-started/signing-up-for-github/setting-up-a-trial-of-github-enterprise-server)”。
You can sign up for a free, 45-day trial of {% data variables.product.product_name %}. For more information, see "[Setting up a trial of {% data variables.product.prodname_ghe_server %}](/get-started/signing-up-for-github/setting-up-a-trial-of-github-enterprise-server)."
## 延伸阅读
## Further reading
- "[开始使用 {% data variables.product.product_name %}](/get-started/onboarding/getting-started-with-github-enterprise-server)"
- [关于 {% data variables.contact.github_support %}](/support/learning-about-github-support/about-github-support)
- `github/roadmap` 仓库中的 [ {% data variables.product.prodname_roadmap %} ]({% data variables.product.prodname_roadmap_link %})
- "[Getting started with {% data variables.product.product_name %}](/get-started/onboarding/getting-started-with-github-enterprise-server)"
- "[About {% data variables.contact.github_support %}](/support/learning-about-github-support/about-github-support)"
- [ {% data variables.product.prodname_roadmap %} ]( {% data variables.product.prodname_roadmap_link %} ) in the `github/roadmap` repository

View File

@@ -105,9 +105,7 @@ Other modes of MinIO remain available with standard support.
minio/minio gateway nas /data
```
For more information, see "[MinIO Gateway for NAS](https://docs.min.io/docs/minio-gateway-for-nas.html)."
* Run MinIO using Docker as a cluster. This MinIO deployment uses several hosts and MinIO's erasure coding for the strongest data protection. To run MinIO in a cluster mode, see the "[Distributed MinIO Quickstart Guide](https://docs.min.io/docs/distributed-minio-quickstart-guide.html).
* Run MinIO using Docker as a cluster. This MinIO deployment uses several hosts and MinIO's erasure coding for the strongest data protection. To run MinIO in a cluster mode, see the "[Distributed MinIO Quickstart Guide](https://docs.min.io/docs/distributed-minio-quickstart-guide.html)."
## 3. Create your MinIO bucket for {% data variables.product.prodname_registry %}

View File

@@ -100,7 +100,9 @@ shortTitle: 仓库管理策略
{% data reusables.enterprise-accounts.repo-creation-policy %}
{% data reusables.enterprise-accounts.repo-creation-types %}
{% else %}
6. 在“Repository creation仓库创建”下使用下拉菜单并选择策略。 ![包含仓库创建策略的下拉菜单](/assets/images/enterprise/site-admin-settings/repository-creation-drop-down.png)
6. 在“Repository creation仓库创建”下使用下拉菜单并选择策略。
![包含仓库创建策略的下拉菜单](/assets/images/enterprise/site-admin-settings/repository-creation-drop-down.png)
{% endif %}
## 实施有关复刻私有或内部仓库的策略
@@ -111,7 +113,16 @@ shortTitle: 仓库管理策略
{% data reusables.enterprise-accounts.policies-tab %}
{% data reusables.enterprise-accounts.repositories-tab %}
3. 在“Repository forking”仓库复刻审查有关更改设置的信息。 {% data reusables.enterprise-accounts.view-current-policy-config-orgs %}
4. 在“Repository forking仓库复刻”下使用下拉菜单并选择策略。 ![带有仓库复刻策略选项的下拉菜单](/assets/images/help/business-accounts/repository-forking-policy-drop-down.png)
4. 在“Repository forking仓库复刻”下使用下拉菜单并选择策略。
![带有仓库复刻策略选项的下拉菜单](/assets/images/help/business-accounts/repository-forking-policy-drop-down.png)
{% ifversion innersource-fork-policies %}
5. 如果启用了复刻,则可以指定允许用户复刻存储库的位置。 查看有关更改设置的信息并选择策略。
![显示存储库复刻策略选项列表的屏幕截图](/assets/images/help/business-accounts/repository-forking-policy-settings.png)
{% endif %}
## 执行邀请{% ifversion ghec %} 外部{% endif %} 协作者参与仓库的策略
@@ -122,6 +133,7 @@ shortTitle: 仓库管理策略
{% data reusables.enterprise-accounts.repositories-tab %}
3. 在“仓库 {% ifversion ghec %}外部协作者{% elsif ghes or ghae %}邀请{% endif %}”下,请查看有关更改设置的信息。 {% data reusables.enterprise-accounts.view-current-policy-config-orgs %}
4. 在“仓库 {% ifversion ghec %}外部协作者{% elsif ghes or ghae %}邀请{% endif %}”下,使用下拉菜单并选择策略。
{% ifversion ghec %}
![带有外部协作者邀请策略选项的下拉菜单](/assets/images/help/business-accounts/repository-invitation-policy-drop-down.png)
{% elsif ghes or ghae %}
@@ -173,7 +185,9 @@ shortTitle: 仓库管理策略
{% data reusables.enterprise-accounts.access-enterprise %}
{% data reusables.enterprise-accounts.policies-tab %}
3. 在 **Repository policies仓库策略**选项卡中的“Repository issue deletion仓库议题删除”下审查有关更改设置的信息。 {% data reusables.enterprise-accounts.view-current-policy-config-orgs %}
4. 在“Repository issue deletion仓库议题删除”下使用下拉菜单并选择策略。 ![带有议题删除策略选项的下拉菜单](/assets/images/help/business-accounts/repository-issue-deletion-policy-drop-down.png)
4. 在“Repository issue deletion仓库议题删除”下使用下拉菜单并选择策略。
![带有议题删除策略选项的下拉菜单](/assets/images/help/business-accounts/repository-issue-deletion-policy-drop-down.png)
{% ifversion ghes or ghae %}

View File

@@ -18,6 +18,12 @@ topics:
- Licensing
---
{% ifversion ghec %}
{% data reusables.enterprise-accounts.dormant-user-release-phase %}
{% endif %}
## 关于休眠用户
{% data reusables.enterprise-accounts.dormant-user-activity %}
{% ifversion ghes or ghae%}
@@ -48,9 +54,6 @@ topics:
{% endif %}
{% ifversion ghec %}
{% data reusables.enterprise-accounts.dormant-user-release-phase %}
## 从企业帐户下载休眠用户报告
{% data reusables.enterprise-accounts.access-enterprise %}

View File

@@ -31,7 +31,7 @@ shortTitle: Export data from GitHub.com
{% data reusables.enterprise_migrations.fork-persistence %}
To export repository data from {% data variables.product.prodname_dotcom_the_website %}, use <a href="/rest/reference/migrations" class="dotcom-only">the Migrations API</a>.
To export repository data from {% data variables.product.prodname_dotcom_the_website %}, use [the Migrations API](/free-pro-team@latest/rest/reference/migrations).
The Migrations API is currently in a preview period, which means that the endpoints and parameters may change in the future.
## Generating a migration archive
@@ -40,9 +40,9 @@ The Migrations API is currently in a preview period, which means that the endpoi
1. Notify members of your organization that you'll be performing a migration. The export can take several minutes, depending on the number of repositories being exported. The full migration including import may take several hours so we recommend doing a trial run in order to determine how long the full process will take. For more information, see "[About Migrations](/enterprise/admin/migrations/about-migrations#types-of-migrations)."
2. Start a migration by sending a `POST` request to <a href="/rest/reference/migrations#start-an-organization-migration" class="dotcom-only">the migration endpoint</a>. You'll need:
2. Start a migration by sending a `POST` request to [the migration endpoint](/free-pro-team@latest/rest/reference/migrations#start-an-organization-migration). You'll need:
* Your access token for authentication.
* A [list of the repositories](/rest/reference/repos#list-organization-repositories) you want to migrate:
* A [list of the repositories](/free-pro-team@latest/rest/reference/repos#list-organization-repositories) you want to migrate:
```shell
curl -H "Authorization: token <em>GITHUB_ACCESS_TOKEN</em>" \
-X POST \
@@ -55,7 +55,7 @@ The Migrations API is currently in a preview period, which means that the endpoi
This request returns a unique `id` which represents your migration. You'll need it for subsequent calls to the Migrations API.
3. Send a `GET` request to <a href="/rest/reference/migrations#get-an-organization-migration-status" class="dotcom-only">the migration status endpoint</a> to fetch the status of a migration. You'll need:
3. Send a `GET` request to [the migration status endpoint](/free-pro-team@latest/rest/reference/migrations#get-an-organization-migration-status) to fetch the status of a migration. You'll need:
* Your access token for authentication.
* The unique `id` of the migration:
```shell
@@ -70,7 +70,7 @@ The Migrations API is currently in a preview period, which means that the endpoi
* `exported`, which means the migration finished successfully.
* `failed`, which means the migration failed.
4. After your migration has exported, download the migration archive by sending a `GET` request to <a href="/rest/reference/migrations#download-an-organization-migration-archive" class="dotcom-only">the migration download endpoint</a>. You'll need:
4. After your migration has exported, download the migration archive by sending a `GET` request to [the migration download endpoint](/free-pro-team@latest/rest/reference/migrations#download-an-organization-migration-archive). You'll need:
* Your access token for authentication.
* The unique `id` of the migration:
```shell
@@ -80,7 +80,7 @@ The Migrations API is currently in a preview period, which means that the endpoi
https://api.github.com/orgs/<em>orgname</em>/migrations/<em>id</em>/archive
```
5. The migration archive is automatically deleted after seven days. If you would prefer to delete it sooner, you can send a `DELETE` request to <a href="/rest/reference/migrations#delete-an-organization-migration-archive" class="dotcom-only">the migration archive delete endpoint</a>. You'll need:
5. The migration archive is automatically deleted after seven days. If you would prefer to delete it sooner, you can send a `DELETE` request to [the migration archive delete endpoint](/free-pro-team@latest/free-pro-team@latest/rest/reference/migrations#delete-an-organization-migration-archive). You'll need:
* Your access token for authentication.
* The unique `id` of the migration:
```shell

View File

@@ -129,7 +129,7 @@ $ ghe-migrator audit -s failed_import,failed_map,failed_rename,failed_merge -g <
### 从 {% data variables.product.prodname_dotcom_the_website %} 上的组织解锁仓库
要在 {% data variables.product.prodname_dotcom_the_website %} 组织中解锁仓库,您需要向<a href="/rest/reference/migrations#unlock-an-organization-repository" class="dotcom-only">迁移解锁端点</a>发送 `DELETE` 请求。 您需要:
要在 {% data variables.product.prodname_dotcom_the_website %} 组织中解锁仓库,您需要向[迁移解锁端点](/free-pro-team@latest/rest/reference/migrations#unlock-an-organization-repository)发送 `DELETE` 请求。 您需要:
* 身份验证的访问令牌
* 迁移的唯一 `id`
* 要解锁的仓库的名称

View File

@@ -67,7 +67,8 @@ When you want to use an {% data variables.product.prodname_oauth_app %} that int
| Organizations and teams | Organization and teams access allows apps to access and manage organization and team membership. |
| Personal user data | User data includes information found in your user profile, like your name, e-mail address, and location. |
| Repositories | Repository information includes the names of contributors, the branches you've created, and the actual files within your repository. Apps can request access for either public or private repositories on a user-wide level. |
| Repository delete | Apps can request to delete repositories that you administer, but they won't have access to your code. |
| Repository delete | Apps can request to delete repositories that you administer, but they won't have access to your code. |{% ifversion projects-oauth-scope %}
| Projects | Access to user and organization projects (beta). Apps can request either read/write or read only access. |{% endif %}
## Requesting updated permissions

View File

@@ -30,7 +30,7 @@ We strongly recommend using a time-based one-time password (TOTP) application to
{% ifversion fpt or ghec %}
If you're a member of an {% data variables.product.prodname_emu_enterprise %}, you cannot configure 2FA for your {% data variables.product.prodname_managed_user %} account. 2FA should be configured through your identity provider.
If you're a member of an {% data variables.product.prodname_emu_enterprise %}, you cannot configure 2FA for your {% data variables.product.prodname_managed_user %} account unless you're signed in as the setup user. For users other than the setup user, an administrator must configure 2FA on your identity provider (IdP).
{% endif %}

View File

@@ -48,6 +48,7 @@ children:
- /managing-billing-for-github-actions
- /managing-billing-for-github-codespaces
- /managing-billing-for-github-packages
- /managing-billing-for-github-copilot
- /managing-billing-for-github-advanced-security
- /managing-billing-for-github-sponsors
- /managing-billing-for-github-marketplace-apps

View File

@@ -0,0 +1,21 @@
---
title: 关于 GitHub Copilot 的计费
intro: '如果要使用 {% data variables.product.prodname_copilot %},则需要订阅 {% data variables.product.prodname_dotcom %} 帐户。'
versions:
feature: copilot
topics:
- Copilot
shortTitle: GitHub Copilot 的计费
---
## 关于 {% data variables.product.prodname_copilot %} 的计费
如果要使用 {% data variables.product.prodname_copilot %},则需要订阅 {% data variables.product.prodname_dotcom %} 个人帐户。 有关 {% data variables.product.prodname_copilot %} 的更多信息,请参阅“[关于 {% data variables.product.prodname_copilot %}](/en/copilot/overview-of-github-copilot/about-github-copilot)”。
在开始付费订阅之前,您可以设置一次性的 60 天试用版来评估 {% data variables.product.prodname_copilot %}。 要开始试用,您需要选择每月或每年的结算周期,并提供付款方式。 如果您在 60 天结束前未取消试用,则试用将自动转换为付费订阅。 您可以在 60 天内随时取消 {% data variables.product.prodname_copilot %} 试用,并且不会向您收取费用。 如果您在试用期结束前取消,您将可以继续访问 {% data variables.product.prodname_copilot %} ,直到 60 天试用期结束。 更多信息请参阅[管理 GitHub Copilot 订阅](/en/billing/managing-billing-for-github-copilot/managing-your-github-copilot-subscription)”。
## {% data variables.product.prodname_copilot %} 定价
{% data variables.product.prodname_copilot %} 订阅以月或年为周期提供。 如果您选择按月计费周期,则每个日历月将向您收取 $10 的费用。 如果您选择年度结算周期,则每年将向您收取 $100 的费用。 您可以随时修改结算周期,修改将从下一个结算周期开始时反映出来。
{% data variables.product.prodname_copilot %} 的免费订阅可供经过验证的学生以及 {% data variables.product.company_short %} 上常用开源存储库的维护者使用。 如果您符合开源维护者的条件,当您访问 {% data variables.product.prodname_copilot %} 订阅页面时,您将自动收到通知。 作为学生,如果您当前收到 {% data variables.product.prodname_student_pack %},则当您访问 {% data variables.product.prodname_copilot %} 订阅页面时,您还将获得免费订阅。 有关 {% data variables.product.prodname_student_pack %} 的详细信息,请参阅[申请学生开发包](/free-pro-team@latest/education/explore-the-benefits-of-teaching-and-learning-with-github-education/use-github-for-your-schoolwork/apply-for-a-student-developer-pack)”。

View File

@@ -0,0 +1,11 @@
---
title: Managing billing for GitHub Copilot
shortTitle: GitHub Copilot
intro: 'You can try {% data variables.product.prodname_copilot %} with a free trial before starting your subscription, and modify or cancel your subscription at any time.'
versions:
feature: copilot
children:
- /about-billing-for-github-copilot
- /managing-your-github-copilot-subscription
---

View File

@@ -0,0 +1,49 @@
---
title: Managing your GitHub Copilot subscription
intro: 'Set up your {% data variables.product.prodname_copilot %} trial and manage your subscription.'
versions:
feature: copilot
type: how_to
topics:
- Copilot
shortTitle: Your GitHub Copilot subscription
---
## Setting up a trial of {% data variables.product.prodname_copilot %}
{% data reusables.copilot.signup-procedure %}
## Modifying your {% data variables.product.prodname_copilot %} subscription
{% data reusables.user-settings.access_settings %}
{% data reusables.user-settings.billing_plans %}
1. In the "{% data variables.product.prodname_copilot %}" section, select the **Edit** dropdown.
- If you are on a monthly billing cycle, select **Change to yearly billing**.
- If you are on a yearly billing cycle, select **Change to monthly billing**. ![Screenshot of GitHub Copilot section on billing page with edit dropdown emphasized](/assets/images/help/copilot/copilot-settings-edit-dropdown.png)
## Canceling your {% data variables.product.prodname_copilot %} subscription
You can cancel your {% data variables.product.prodname_copilot %} subscription at any time. If you cancel during your 60 day trial, you won't be charged. If you do not cancel your {% data variables.product.prodname_copilot %} subscription before the end of the 60 day trial, you will be charged according to the billing cycle you selected when setting up the trial.
{% data reusables.user-settings.access_settings %}
{% data reusables.user-settings.billing_plans %}
1. In the "{% data variables.product.prodname_copilot %}" section, select the **Edit** dropdown.
- If you have a paid subscription, click **Cancel {% data variables.product.prodname_copilot %}**.
![Screenshot of GitHub Copilot section on billing page with cancel GitHub Copilot option emphasized](/assets/images/help/copilot/copilot-billing-edit-dropdown.png)
- If you are within your 60 day trial period, click **Cancel trial**. ![Screenshot of GitHub Copilot section on billing page with cancel trial option emphasized](/assets/images/help/copilot/copilot-cancel-trial.png)
2. In the "Cancel {% data variables.product.prodname_copilot %}" modal, click **I understand, cancel {% data variables.product.prodname_copilot %}**
![Screenshot of GitHub Copilot cancel modal with I understand, cancel GitHub Copilot button emphasized](/assets/images/help/copilot/copilot-cancel-modal.png)
- If you are within your 60 day trial period, click **I understand, cancel {% data variables.product.prodname_copilot %} trial**.
![Screenshot of GitHub Copilot cancel trial modal with I understand, cancel trial button emphasized](/assets/images/help/copilot/copilot-trial-cancel-modal.png)
## 延伸阅读
- [关于 {% data variables.product.prodname_copilot %}](/copilot/overview-of-github-copilot/about-github-copilot)
- [开始使用 {% data variables.product.prodname_copilot %}](/copilot/getting-started-with-github-copilot)

View File

@@ -74,7 +74,7 @@ By default, the {% data variables.product.prodname_codeql_workflow %} uses the `
If you scan on push, then the results appear in the **Security** tab for your repository. For more information, see "[Managing code scanning alerts for your repository](/code-security/secure-coding/managing-code-scanning-alerts-for-your-repository#viewing-the-alerts-for-a-repository)."
{% ifversion fpt or ghes > 3.2 or ghae or ghec %}
Additionally, when an `on:push` scan returns results that can be mapped to an open pull request, these alerts will automatically appear on the pull request in the same places as other pull request alerts. The alerts are identified by comparing the existing analysis of the head of the branch to the analysis for the target branch. For more information on {% data variables.product.prodname_code_scanning %} alerts in pull requests, see "[Triaging {% data variables.product.prodname_code_scanning %} alerts in pull requests](/code-security/secure-coding/triaging-code-scanning-alerts-in-pull-requests)."
Additionally, when an `on:push` scan returns results that can be mapped to an open pull request, these alerts will automatically appear on the pull request in the same places as other pull request alerts. The alerts are identified by comparing the existing analysis of the head of the branch to the analysis for the target branch. For more information on {% data variables.product.prodname_code_scanning %} alerts in pull requests, see "[Triaging {% data variables.product.prodname_code_scanning %} alerts in pull requests](/code-security/secure-coding/triaging-code-scanning-alerts-in-pull-requests)."
{% endif %}
### Scanning pull requests
@@ -97,7 +97,7 @@ By default, only alerts with the severity level of `Error`{% ifversion fpt or gh
{% data reusables.repositories.navigate-to-repo %}
{% data reusables.repositories.sidebar-settings %}
{% data reusables.repositories.navigate-to-code-security-and-analysis %}
1. Under "Code scanning", to the right of "Check Failure", use the drop-down menu to select the level of severity you would like to cause a pull request check failure.
1. Under "Code scanning", to the right of "Check Failure", use the drop-down menu to select the level of severity you would like to cause a pull request check failure.
{% ifversion fpt or ghes > 3.1 or ghae or ghec %}
![Check failure setting](/assets/images/help/repository/code-scanning-check-failure-setting.png)
{% else %}
@@ -280,7 +280,7 @@ jobs:
{% ifversion fpt or ghes > 3.1 or ghae or ghec %}
## Configuring a category for the analysis
Use `category` to distinguish between multiple analyses for the same tool and commit, but performed on different languages or different parts of the code. The category you specify in your workflow will be included in the SARIF results file.
Use `category` to distinguish between multiple analyses for the same tool and commit, but performed on different languages or different parts of the code. The category you specify in your workflow will be included in the SARIF results file.
This parameter is particularly useful if you work with monorepos and have multiple SARIF files for different components of the monorepo.
@@ -289,7 +289,7 @@ This parameter is particularly useful if you work with monorepos and have multip
uses: {% data reusables.actions.action-codeql-action-analyze %}
with:
# Optional. Specify a category to distinguish between multiple analyses
# for the same tool and ref. If you don't use `category` in your workflow,
# for the same tool and ref. If you don't use `category` in your workflow,
# GitHub will generate a default category name for you
category: "my_category"
```
@@ -298,7 +298,7 @@ If you don't specify a `category` parameter in your workflow, {% data variables.
- The `.github/workflows/codeql-analysis.yml` workflow and the `analyze` action will produce the category `.github/workflows/codeql.yml:analyze`.
- The `.github/workflows/codeql-analysis.yml` workflow, the `analyze` action, and the `{language: javascript, os: linux}` matrix variables will produce the category `.github/workflows/codeql-analysis.yml:analyze/language:javascript/os:linux`.
The `category` value will appear as the `<run>.automationDetails.id` property in SARIF v2.1.0. For more information, see "[SARIF support for {% data variables.product.prodname_code_scanning %}](/code-security/secure-coding/sarif-support-for-code-scanning#runautomationdetails-object)."
The `category` value will appear as the `<run>.automationDetails.id` property in SARIF v2.1.0. For more information, see "[SARIF support for {% data variables.product.prodname_code_scanning %}](/code-security/secure-coding/sarif-support-for-code-scanning#runautomationdetails-object)."
Your specified category will not overwrite the details of the `runAutomationDetails` object in the SARIF file, if included.
@@ -321,13 +321,17 @@ To add one or more {% data variables.product.prodname_codeql %} query packs (bet
{% endnote %}
In the example below, `scope` is the organization or personal account that published the package. When the workflow runs, the three {% data variables.product.prodname_codeql %} query packs are downloaded from {% data variables.product.product_name %} and the default queries or query suite for each pack run. The latest version of `pack1` is downloaded as no version is specified. Version 1.2.3 of `pack2` is downloaded, as well as the latest version of `pack3` that is compatible with version 1.2.3.
In the example below, `scope` is the organization or personal account that published the package. When the workflow runs, the four {% data variables.product.prodname_codeql %} query packs are downloaded from {% data variables.product.product_name %} and the default queries or query suite for each pack run:
- The latest version of `pack1` is downloaded and all default queries are run.
- Version 1.2.3 of `pack2` is downloaded and all default queries are run.
- The latest version of `pack3` that is compatible with version 3.2.1 is downloaded and all queries are run.
- Version 4.5.6 of `pack4` is downloaded and only the queries found in `path/to/queries` are run.
``` yaml
- uses: {% data reusables.actions.action-codeql-action-init %}
with:
# Comma-separated list of packs to download
packs: scope/pack1,scope/pack2@1.2.3,scope/pack3@~1.2.3
packs: scope/pack1,scope/pack2@1.2.3,scope/pack3@~3.2.1,scope/pack4@4.5.6:path/to/queries
```
### Using queries in QL packs
@@ -360,7 +364,7 @@ In the following example, the `+` symbol ensures that the specified additional {
config-file: ./.github/codeql/codeql-config.yml
queries: +security-and-quality,octo-org/python-qlpack/show_ifs.ql@main
{%- ifversion codeql-packs %}
packs: +scope/pack1,scope/pack2@v1.2.3
packs: +scope/pack1,scope/pack2@1.2.3,scope/pack3@4.5.6:path/to/queries
{%- endif %}
```
@@ -397,16 +401,24 @@ You specify {% data variables.product.prodname_codeql %} query packs in an array
{% raw %}
``` yaml
packs:
packs:
# Use the latest version of 'pack1' published by 'scope'
- scope/pack1
# Use version 1.23 of 'pack2'
- scope/pack2@v1.2.3
# Use the latest version of 'pack3' compatible with 1.23
- scope/pack3@~1.2.3
- scope/pack1
# Use version 1.2.3 of 'pack2'
- scope/pack2@1.2.3
# Use the latest version of 'pack3' compatible with 3.2.1
- scope/pack3@~3.2.1
# Use pack4 and restrict it to queries found in the 'path/to/queries' directory
- scope/pack4:path/to/queries
# Use pack5 and restrict it to the query 'path/to/single/query.ql'
- scope/pack5:path/to/single/query.ql
# Use pack6 and restrict it to the query suite 'path/to/suite.qls'
- scope/pack6:path/to/suite.qls
```
{% endraw %}
The full format for specifying a query pack is `scope/name[@version][:path]`. Both `version` and `path` are optional. `version` is semver version range. If it is missing, the latest version is used. For more information about semver ranges, see the [semver docs on npm](https://docs.npmjs.com/cli/v6/using-npm/semver#ranges).
If you have a workflow that generates more than one {% data variables.product.prodname_codeql %} database, you can specify any {% data variables.product.prodname_codeql %} query packs to run in a custom configuration file using a nested map of packs.
{% raw %}

View File

@@ -1,7 +1,7 @@
---
title: Browsing security advisories in the GitHub Advisory Database
intro: 'You can browse the {% data variables.product.prodname_advisory_database %} to find advisories for security risks in open source projects that are hosted on {% data variables.product.company_short %}.'
shortTitle: 浏览公告数据库
shortTitle: Browse Advisory Database
miniTocMaxHeadingLevel: 3
redirect_from:
- /github/managing-security-vulnerabilities/browsing-security-vulnerabilities-in-the-github-advisory-database
@@ -19,10 +19,9 @@ topics:
- Vulnerabilities
- CVEs
---
<!--Marketing-LINK: From /features/security/software-supply-chain page "Browsing security vulnerabilities in the GitHub Advisory Database".-->
## 关于 {% data variables.product.prodname_advisory_database %}
## About the {% data variables.product.prodname_advisory_database %}
The {% data variables.product.prodname_advisory_database %} contains a list of known security vulnerabilities and malware, grouped in two categories: {% data variables.product.company_short %}-reviewed advisories and unreviewed advisories.
@@ -32,7 +31,7 @@ The {% data variables.product.prodname_advisory_database %} contains a list of k
{% data reusables.advisory-database.beta-malware-advisories %}
Each advisory in the {% data variables.product.prodname_advisory_database %} is for a vulnerability in open source projects or for malicious open source software.
Each advisory in the {% data variables.product.prodname_advisory_database %} is for a vulnerability in open source projects or for malicious open source software.
{% data reusables.repositories.a-vulnerability-is %} Vulnerabilities in code are usually introduced by accident and fixed soon after they are discovered. You should update your code to use the fixed version of the dependency as soon as it is available.
@@ -45,6 +44,7 @@ In contrast, malicious software, or malware, is code that is intentionally desig
Generally, we name our supported ecosystems after the software programming language's associated package registry. We review advisories if they are for a vulnerability in a package that comes from a supported registry.
- Composer (registry: https://packagist.org/)
- Erlang (registry: https://hex.pm/)
- Go (registry: https://pkg.go.dev/)
- Maven (registry: https://repo1.maven.org/maven2/org/)
- npm (registry: https://www.npmjs.com/)
@@ -55,87 +55,90 @@ Generally, we name our supported ecosystems after the software programming langu
If you have a suggestion for a new ecosystem we should support, please open an [issue](https://github.com/github/advisory-database/issues) for discussion.
If you enable {% data variables.product.prodname_dependabot_alerts %} for your repositories, you are automatically notified when a new {% data variables.product.company_short %}-reviewed advisory reports a vulnerability or malware for a package you depend on. 更多信息请参阅“[关于 {% data variables.product.prodname_dependabot_alerts %} 警报](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies)”。
If you enable {% data variables.product.prodname_dependabot_alerts %} for your repositories, you are automatically notified when a new {% data variables.product.company_short %}-reviewed advisory reports a vulnerability or malware for a package you depend on. For more information, see "[About {% data variables.product.prodname_dependabot_alerts %}](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies)."
### Unreviewed advisories
未审核的公告是我们直接从国家漏洞数据库源自动发布到 {% data variables.product.prodname_advisory_database %} 的安全漏洞。
Unreviewed advisories are security vulnerabilites that we publish automatically into the {% data variables.product.prodname_advisory_database %}, directly from the National Vulnerability Database feed.
{% data variables.product.prodname_dependabot %} 不会为未审核的公告创建 {% data variables.product.prodname_dependabot_alerts %},因为不会检查此类公告的有效性或完成情况。
{% data variables.product.prodname_dependabot %} doesn't create {% data variables.product.prodname_dependabot_alerts %} for unreviewed advisories as this type of advisory isn't checked for validity or completion.
## About information in security advisories
Each security advisory contains information about the vulnerability or malware, which may include the description, severity, affected package, package ecosystem, affected versions and patched versions, impact, and optional information such as references, workarounds, and credits. 此外,国家漏洞数据库列表中的公告包含 CVE 记录链接,通过链接可以查看漏洞、其 CVSS 得分及其质化严重等级的更多详细信息。 更多信息请参阅国家标准和技术研究所 (National Institute of Standards and Technology) 的“[国家漏洞数据库](https://nvd.nist.gov/)”。
Each security advisory contains information about the vulnerability or malware, which may include the description, severity, affected package, package ecosystem, affected versions and patched versions, impact, and optional information such as references, workarounds, and credits. In addition, advisories from the National Vulnerability Database list contain a link to the CVE record, where you can read more details about the vulnerability, its CVSS scores, and its qualitative severity level. For more information, see the "[National Vulnerability Database](https://nvd.nist.gov/)" from the National Institute of Standards and Technology.
我们在[常见漏洞评分系统 (CVSS) 第 5 节](https://www.first.org/cvss/specification-document)中定义了以下四种可能的严重性等级。
-
-
-
- 关键
The severity level is one of four possible levels defined in the "[Common Vulnerability Scoring System (CVSS), Section 5](https://www.first.org/cvss/specification-document)."
- Low
- Medium/Moderate
- High
- Critical
{% data variables.product.prodname_advisory_database %} 使用上述 CVSS 级别。 如果 {% data variables.product.company_short %} 获取 CVE{% data variables.product.prodname_advisory_database %} 将使用 CVSS 版本 3.1。 如果 CVE 是导入的,则 {% data variables.product.prodname_advisory_database %} 支持 CVSS 版本 3.0 3.1
The {% data variables.product.prodname_advisory_database %} uses the CVSS levels described above. If {% data variables.product.company_short %} obtains a CVE, the {% data variables.product.prodname_advisory_database %} uses CVSS version 3.1. If the CVE is imported, the {% data variables.product.prodname_advisory_database %} supports both CVSS versions 3.0 and 3.1.
{% data reusables.repositories.github-security-lab %}
## 访问 {% data variables.product.prodname_advisory_database %} 中的通告
## Accessing an advisory in the {% data variables.product.prodname_advisory_database %}
1. 导航到 https://github.com/advisories
2. (可选)要过滤列表,请使用任意下拉菜单。 ![下拉过滤器](/assets/images/help/security/advisory-database-dropdown-filters.png)
1. Navigate to https://github.com/advisories.
2. Optionally, to filter the list, use any of the drop-down menus.
![Dropdown filters](/assets/images/help/security/advisory-database-dropdown-filters.png)
{% tip %}
**提示:**您可以使用左侧的边栏分别浏览 {% data variables.product.company_short %} 已审核和未审核的公告。
**Tip:** You can use the sidebar on the left to explore {% data variables.product.company_short %}-reviewed and unreviewed advisories separately.
{% endtip %}
3. 单击任何通告以查看详情。 By default, you will see {% data variables.product.company_short %}-reviewed advisories for security vulnerabilities. To show malware advisories, use `type:malware` in the search bar.
3. Click on any advisory to view details. By default, you will see {% data variables.product.company_short %}-reviewed advisories for security vulnerabilities. To show malware advisories, use `type:malware` in the search bar.
{% note %}
也可以使用 GraphQL API 访问数据库。 By default, queries will return {% data variables.product.company_short %}-reviewed advisories for security vulnerabilities unless you specify `type:malware`. 更多信息请参阅“[`security_advisory` web 挂钩事件](/webhooks/event-payloads/#security_advisory)”。
The database is also accessible using the GraphQL API. By default, queries will return {% data variables.product.company_short %}-reviewed advisories for security vulnerabilities unless you specify `type:malware`. For more information, see the "[`security_advisory` webhook event](/webhooks/event-payloads/#security_advisory)."
{% endnote %}
## {% data variables.product.prodname_advisory_database %} 中编辑公告
您可以对 {% data variables.product.prodname_advisory_database %} 中的任何公告提出改进建议。 更多信息请参阅“[编辑 {% data variables.product.prodname_advisory_database %} 中的安全通告](/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/editing-security-advisories-in-the-github-advisory-database)”。
## Editing an advisory in the {% data variables.product.prodname_advisory_database %}
You can suggest improvements to any advisory in the {% data variables.product.prodname_advisory_database %}. For more information, see "[Editing security advisories in the {% data variables.product.prodname_advisory_database %}](/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/editing-security-advisories-in-the-github-advisory-database)."
## 搜索 {% data variables.product.prodname_advisory_database %}
## Searching the {% data variables.product.prodname_advisory_database %}
您可以搜索数据库,并使用限定符缩小搜索范围。 例如,您可以搜索在特定日期、特定生态系统或特定库中创建的通告。
You can search the database, and use qualifiers to narrow your search. For example, you can search for advisories created on a certain date, in a specific ecosystem, or in a particular library.
{% data reusables.time_date.date_format %} {% data reusables.time_date.time_format %}
{% data reusables.search.date_gt_lt %}
| 限定符 | 示例 |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `type:reviewed` | [**type:reviewed**](https://github.com/advisories?query=type%3Areviewed) will show {% data variables.product.company_short %}-reviewed advisories for security vulnerabilities. |
| `type:malware` | [**type:malware**](https://github.com/advisories?query=type%3Amalware) will show {% data variables.product.company_short %}-reviewed advisories for malware. |
| `type:unreviewed` | [**type:unreviewed**](https://github.com/advisories?query=type%3Aunreviewed) 将显示未审核的公告。 |
| `GHSA-ID` | [**GHSA-49wp-qq6x-g2rf**](https://github.com/advisories?query=GHSA-49wp-qq6x-g2rf) 将显示使用此 {% data variables.product.prodname_advisory_database %} ID 的通告。 |
| `CVE-ID` | [**CVE-2020-28482**](https://github.com/advisories?query=CVE-2020-28482) 将显示使用此 CVE ID 号的通告。 |
| `ecosystem:ECOSYSTEM` | [**ecosystem:npm**](https://github.com/advisories?utf8=%E2%9C%93&query=ecosystem%3Anpm) 只显示影响 NPM 包的通告。 |
| `severity:LEVEL` | [**severity:high**](https://github.com/advisories?utf8=%E2%9C%93&query=severity%3Ahigh) 只显示严重程度高的公告。 |
| `affects:LIBRARY` | [**affects:lodash**](https://github.com/advisories?utf8=%E2%9C%93&query=affects%3Alodash) 只显示影响 lodash 库的通告。 |
| `cwe:ID` | [**cwe:352**](https://github.com/advisories?query=cwe%3A352) 将只显示使用此 CWE 编号的通告。 |
| `credit:USERNAME` | [**credit:octocat**](https://github.com/advisories?query=credit%3Aoctocat) 将只显示计入“octocat”用户帐户的通告。 |
| `sort:created-asc` | [**sort:created-asc**](https://github.com/advisories?utf8=%E2%9C%93&query=sort%3Acreated-asc) 按照时间顺序对通告排序,最早的通告排在最前面。 |
| `sort:created-desc` | [**sort:created-desc**](https://github.com/advisories?utf8=%E2%9C%93&query=sort%3Acreated-desc) 按照时间顺序对通告排序,最新的通告排在最前面。 |
| `sort:updated-asc` | [**sort:updated-asc**](https://github.com/advisories?utf8=%E2%9C%93&query=sort%3Aupdated-asc) 按照更新顺序排序,最早更新的排在最前面。 |
| `sort:updated-desc` | [**sort:updated-desc**](https://github.com/advisories?utf8=%E2%9C%93&query=sort%3Aupdated-desc) 按照更新顺序排序,最近更新的排在最前面。 |
| `is:withdrawn` | [**is:withdrawn**](https://github.com/advisories?utf8=%E2%9C%93&query=is%3Awithdrawn) 只显示已经撤销的通告。 |
| `created:YYYY-MM-DD` | [**created:2021-01-13**](https://github.com/advisories?utf8=%E2%9C%93&query=created%3A2021-01-13) 只显示此日期创建的通告。 |
| `updated:YYYY-MM-DD` | [**updated:2021-01-13**](https://github.com/advisories?utf8=%E2%9C%93&query=updated%3A2021-01-13) 只显示此日期更新的通告。 |
| Qualifier | Example |
| ------------- | ------------- |
| `type:reviewed`| [**type:reviewed**](https://github.com/advisories?query=type%3Areviewed) will show {% data variables.product.company_short %}-reviewed advisories for security vulnerabilities. |
| `type:malware` | [**type:malware**](https://github.com/advisories?query=type%3Amalware) will show {% data variables.product.company_short %}-reviewed advisories for malware. |
| `type:unreviewed`| [**type:unreviewed**](https://github.com/advisories?query=type%3Aunreviewed) will show unreviewed advisories. |
| `GHSA-ID`| [**GHSA-49wp-qq6x-g2rf**](https://github.com/advisories?query=GHSA-49wp-qq6x-g2rf) will show the advisory with this {% data variables.product.prodname_advisory_database %} ID. |
| `CVE-ID`| [**CVE-2020-28482**](https://github.com/advisories?query=CVE-2020-28482) will show the advisory with this CVE ID number. |
| `ecosystem:ECOSYSTEM`| [**ecosystem:npm**](https://github.com/advisories?utf8=%E2%9C%93&query=ecosystem%3Anpm) will show only advisories affecting NPM packages. |
| `severity:LEVEL`| [**severity:high**](https://github.com/advisories?utf8=%E2%9C%93&query=severity%3Ahigh) will show only advisories with a high severity level. |
| `affects:LIBRARY`| [**affects:lodash**](https://github.com/advisories?utf8=%E2%9C%93&query=affects%3Alodash) will show only advisories affecting the lodash library. |
| `cwe:ID`| [**cwe:352**](https://github.com/advisories?query=cwe%3A352) will show only advisories with this CWE number. |
| `credit:USERNAME`| [**credit:octocat**](https://github.com/advisories?query=credit%3Aoctocat) will show only advisories credited to the "octocat" user account. |
| `sort:created-asc`| [**sort:created-asc**](https://github.com/advisories?utf8=%E2%9C%93&query=sort%3Acreated-asc) will sort by the oldest advisories first. |
| `sort:created-desc`| [**sort:created-desc**](https://github.com/advisories?utf8=%E2%9C%93&query=sort%3Acreated-desc) will sort by the newest advisories first. |
| `sort:updated-asc`| [**sort:updated-asc**](https://github.com/advisories?utf8=%E2%9C%93&query=sort%3Aupdated-asc) will sort by the least recently updated first. |
| `sort:updated-desc`| [**sort:updated-desc**](https://github.com/advisories?utf8=%E2%9C%93&query=sort%3Aupdated-desc) will sort by the most recently updated first. |
| `is:withdrawn`| [**is:withdrawn**](https://github.com/advisories?utf8=%E2%9C%93&query=is%3Awithdrawn) will show only advisories that have been withdrawn. |
| `created:YYYY-MM-DD`| [**created:2021-01-13**](https://github.com/advisories?utf8=%E2%9C%93&query=created%3A2021-01-13) will show only advisories created on this date. |
| `updated:YYYY-MM-DD`| [**updated:2021-01-13**](https://github.com/advisories?utf8=%E2%9C%93&query=updated%3A2021-01-13) will show only advisories updated on this date. |
## 查看有漏洞的仓库
## Viewing your vulnerable repositories
For any {% data variables.product.company_short %}-reviewed advisory in the {% data variables.product.prodname_advisory_database %}, you can see which of your repositories are affected by that security vulnerability or malware. 要查看有漏洞的仓库,您必须有权访问该仓库的 {% data variables.product.prodname_dependabot_alerts %}。 更多信息请参阅“[关于 {% data variables.product.prodname_dependabot_alerts %} 警报](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies#access-to-dependabot-alerts)”。
For any {% data variables.product.company_short %}-reviewed advisory in the {% data variables.product.prodname_advisory_database %}, you can see which of your repositories are affected by that security vulnerability or malware. To see a vulnerable repository, you must have access to {% data variables.product.prodname_dependabot_alerts %} for that repository. For more information, see "[About {% data variables.product.prodname_dependabot_alerts %}](/code-security/supply-chain-security/about-alerts-for-vulnerable-dependencies#access-to-dependabot-alerts)."
1. 导航到 https://github.com/advisories
2. 单击通告。
3. 在通告页面的顶部,单击 **Dependabot alertsDependabot 警报)**。 ![Dependabot 警报](/assets/images/help/security/advisory-database-dependabot-alerts.png)
4. (可选)要过滤列表,请使用搜索栏或下拉菜单。 “Organization组织”下拉菜单用于按所有者组织或用户过滤 {% data variables.product.prodname_dependabot_alerts %}。 ![用于过滤警报的搜索栏和下拉菜单](/assets/images/help/security/advisory-database-dependabot-alerts-filters.png)
1. Navigate to https://github.com/advisories.
2. Click an advisory.
3. At the top of the advisory page, click **Dependabot alerts**.
![Dependabot alerts](/assets/images/help/security/advisory-database-dependabot-alerts.png)
4. Optionally, to filter the list, use the search bar or the drop-down menus. The "Organization" drop-down menu allows you to filter the {% data variables.product.prodname_dependabot_alerts %} per owner (organization or user).
![Search bar and drop-down menus to filter alerts](/assets/images/help/security/advisory-database-dependabot-alerts-filters.png)
5. For more details about the advisory, and for advice on how to fix the vulnerable repository, click the repository name.
## 延伸阅读
## Further reading
- MITRE 的[“漏洞”定义](https://www.cve.org/ResourcesSupport/Glossary#vulnerability)
- MITRE's [definition of "vulnerability"](https://www.cve.org/ResourcesSupport/Glossary#vulnerability)

View File

@@ -1,7 +1,7 @@
---
title: 配置 Dependabot 警报
title: Configuring Dependabot alerts
intro: 'Enable {% data variables.product.prodname_dependabot_alerts %} to be generated when a new vulnerable dependency {% ifversion GH-advisory-db-supports-malware %}or malware {% endif %}is found in one of your repositories.'
shortTitle: 配置 Dependabot 警报
shortTitle: Configure Dependabot alerts
versions:
fpt: '*'
ghes: '*'
@@ -19,87 +19,92 @@ topics:
## About {% data variables.product.prodname_dependabot_alerts %} for vulnerable dependencies{% ifversion GH-advisory-db-supports-malware %} and malware{% endif %}
{% data reusables.repositories.a-vulnerability-is %}
{% data reusables.repositories.a-vulnerability-is %}
{% data variables.product.prodname_dependabot %} scans code when a new advisory is added to the {% data variables.product.prodname_advisory_database %} or the dependency graph for a repository changes. When vulnerable dependencies{% ifversion GH-advisory-db-supports-malware %} or malware{% endif %} are detected, {% data variables.product.prodname_dependabot_alerts %} are generated. 更多信息请参阅“[关于 {% data variables.product.prodname_dependabot_alerts %} 警报](/code-security/dependabot/dependabot-alerts/about-dependabot-alerts)”。
{% data variables.product.prodname_dependabot %} scans code when a new advisory is added to the {% data variables.product.prodname_advisory_database %} or the dependency graph for a repository changes. When vulnerable dependencies{% ifversion GH-advisory-db-supports-malware %} or malware{% endif %} are detected, {% data variables.product.prodname_dependabot_alerts %} are generated. For more information, see "[About {% data variables.product.prodname_dependabot_alerts %}](/code-security/dependabot/dependabot-alerts/about-dependabot-alerts)."
您可以对以下项启用或禁用 {% data variables.product.prodname_dependabot_alerts %}
* 您的个人帐户
* 您的存储库
* 您的组织
You can enable or disable {% data variables.product.prodname_dependabot_alerts %} for:
* Your personal account
* Your repository
* Your organization
## 管理个人帐户的 {% data variables.product.prodname_dependabot_alerts %}
## Managing {% data variables.product.prodname_dependabot_alerts %} for your personal account
{% ifversion fpt or ghec %}
您可以为您的个人帐户所拥有的所有仓库启用或禁用 {% data variables.product.prodname_dependabot_alerts %}
You can enable or disable {% data variables.product.prodname_dependabot_alerts %} for all repositories owned by your personal account.
### 启用或禁用现有存储库的 {% data variables.product.prodname_dependabot_alerts %}
### Enabling or disabling {% data variables.product.prodname_dependabot_alerts %} for existing repositories
{% data reusables.user-settings.access_settings %}
{% data reusables.user-settings.security-analysis %}
3. 在“Code security and analysis(代码安全性和分析)”下,单击 {% data variables.product.prodname_dependabot_alerts %} 右侧的 **Disable all(禁用所有)**或 **Enable all(启用所有)**。 ![强调显示"启用所有"或"禁用所有"按钮的"配置安全性和分析"功能屏幕截图](/assets/images/help/dependabot/dependabot-alerts-disable-or-enable-all.png)
4. (可选)默认情况下为您创建的新存储库启用 {% data variables.product.prodname_dependabot_alerts %}。 ![强调显示"默认情况下为新的私有存储库启用"复选框的"启用 Dependabot 警报"屏幕截图](/assets/images/help/dependabot/dependabot-alerts-enable-by-default.png)
5. 单击**禁用 {% data variables.product.prodname_dependabot_alerts %}** 或**启用 {% data variables.product.prodname_dependabot_alerts %}** ,为拥有的所有存储库禁用或启用 {% data variables.product.prodname_dependabot_alerts %}。 ![强调显示"启用 Dependabot 警报"的"启用 Dependabot 警报"屏幕截图](/assets/images/help/dependabot/dependabot-alerts-enable-dependabot-alerts.png)
3. Under "Code security and analysis", to the right of {% data variables.product.prodname_dependabot_alerts %}, click **Disable all** or **Enable all**.
![Screenshot of "Configure security and analysis" features with "Enable all" or "Disable all" buttons emphasized](/assets/images/help/dependabot/dependabot-alerts-disable-or-enable-all.png)
4. Optionally, enable {% data variables.product.prodname_dependabot_alerts %} by default for new repositories that you create.
![Screenshot of "Enable Dependabot alerts" with "Enable by default for new private repositories" checkbox emphasized](/assets/images/help/dependabot/dependabot-alerts-enable-by-default.png)
5. Click **Disable {% data variables.product.prodname_dependabot_alerts %}** or **Enable {% data variables.product.prodname_dependabot_alerts %}** to disable or enable {% data variables.product.prodname_dependabot_alerts %} for all the repositories you own.
![Screenshot of "Enable Dependabot alerts" with "Enable Dependabot alerts" button emphasized](/assets/images/help/dependabot/dependabot-alerts-enable-dependabot-alerts.png)
当您为现有存储库启用 {% data variables.product.prodname_dependabot_alerts %} 时,您将在几分钟内看到 GitHub 上显示的任何结果。
When you enable {% data variables.product.prodname_dependabot_alerts %} for existing repositories, you will see any results displayed on GitHub within minutes.
### 启用或禁用新存储库的 {% data variables.product.prodname_dependabot_alerts %}
### Enabling or disabling {% data variables.product.prodname_dependabot_alerts %} for new repositories
{% data reusables.user-settings.access_settings %}
{% data reusables.user-settings.security-analysis %}
3. 在“Code security and analysis(代码安全性和分析)”下 {% data variables.product.prodname_dependabot_alerts %} 的右侧,默认为您创建的新存储库启用或禁用 {% data variables.product.prodname_dependabot_alerts %}。 ![强调显示"为所有新私有存储库启用"复选框的"配置安全性和分析"屏幕截图](/assets/images/help/dependabot/dependabot-alerts-enable-for-all-new-repositories.png)
3. Under "Code security and analysis", to the right of {% data variables.product.prodname_dependabot_alerts %}, enable or disable {% data variables.product.prodname_dependabot_alerts %} by default for new repositories that you create.
![Screenshot of "Configure security and analysis" with "Enable for all new private repositories" check emphasized](/assets/images/help/dependabot/dependabot-alerts-enable-for-all-new-repositories.png)
{% else %}
企业所有者可以启用或禁用存储库的 {% data variables.product.prodname_dependabot_alerts %}。 更多信息请参阅“[为企业启用 Dependabot](/admin/configuration/configuring-github-connect/enabling-dependabot-for-your-enterprise)”。
{% data variables.product.prodname_dependabot_alerts %} for your repositories can be enabled or disabled by your enterprise owner. For more information, see "[Enabling Dependabot for your enterprise](/admin/configuration/configuring-github-connect/enabling-dependabot-for-your-enterprise)."
{% endif %}
## 管理仓库的 {% data variables.product.prodname_dependabot_alerts %}
## Managing {% data variables.product.prodname_dependabot_alerts %} for your repository
{% ifversion fpt or ghec %}您可以管理公共、私有或内部存储库的 {% data variables.product.prodname_dependabot_alerts %}
{% ifversion fpt or ghec %}You can manage {% data variables.product.prodname_dependabot_alerts %} for your public, private or internal repository.
默认情况下,我们会向受影响仓库中具有管理员权限的人员通知有关新的 {% data variables.product.prodname_dependabot_alerts %} {% data variables.product.product_name %} never publicly discloses insecure dependencies for any repository. 您也可以将 {% data variables.product.prodname_dependabot_alerts %} 设为对操作您拥有或具有管理员权限的仓库的其他人或团队可见。
By default, we notify people with admin permissions in the affected repositories about new {% data variables.product.prodname_dependabot_alerts %}. {% data variables.product.product_name %} never publicly discloses insecure dependencies for any repository. You can also make {% data variables.product.prodname_dependabot_alerts %} visible to additional people or teams working repositories that you own or have admin permissions for.
{% data reusables.security.security-and-analysis-features-enable-read-only %}
### 为存储库启用或禁用 {% data variables.product.prodname_dependabot_alerts %}
### Enabling or disabling {% data variables.product.prodname_dependabot_alerts %} for a repository
{% data reusables.repositories.navigate-to-repo %}
{% data reusables.repositories.sidebar-settings %}
{% data reusables.repositories.navigate-to-code-security-and-analysis %}
1. 在“Code security and analysis(代码安全和分析)”下,在 {% data variables.product.prodname_dependabot_alerts %} 的右侧,单击 **Enable启用**以启用警报,或单击 **Disable禁用**禁用警报。 !["代码安全性和分析" “部分的屏幕截图,其中包含用于启用 {% data variables.product.prodname_dependabot_security_updates %}按钮](/assets/images/help/repository/security-and-analysis-disable-or-enable-fpt-private.png)
1. Under "Code security and analysis", to the right of {% data variables.product.prodname_dependabot_alerts %}, click **Enable** to enable alerts or **Disable** to disable alerts.
![Screenshot of "Code security and analysis" section with button to enable {% data variables.product.prodname_dependabot_security_updates %}](/assets/images/help/repository/security-and-analysis-disable-or-enable-fpt-private.png)
{% endif %}{% ifversion ghes or ghae %}
您的企业所有者可以启用或禁用存储库的 {% data variables.product.prodname_dependabot_alerts %}。 更多信息请参阅“[为企业启用 Dependabot](/admin/configuration/configuring-github-connect/enabling-dependabot-for-your-enterprise)”。
{% data variables.product.prodname_dependabot_alerts %} for your repository can be enabled or disabled by your enterprise owner. For more information, see "[Enabling Dependabot for your enterprise](/admin/configuration/configuring-github-connect/enabling-dependabot-for-your-enterprise)."
{% endif %}
## 管理组织的 {% data variables.product.prodname_dependabot_alerts %}
{% ifversion fpt or ghec %}您可以为组织拥有的所有仓库启用或禁用 {% data variables.product.prodname_dependabot_alerts %}。 您的更改会影响所有存储库。
## Managing {% data variables.product.prodname_dependabot_alerts %} for your organization
{% ifversion fpt or ghec %}You can enable or disable {% data variables.product.prodname_dependabot_alerts %} for all repositories owned by your organization. Your changes affect all repositories.
### 启用或禁用所有现有存储库的 {% data variables.product.prodname_dependabot_alerts %}
### Enabling or disabling {% data variables.product.prodname_dependabot_alerts %} for all existing repositories
{% data reusables.profile.access_org %}
{% data reusables.profile.org_settings %}
{% data reusables.organizations.security-and-analysis %}
2. 在“Code security and analysis(代码安全性和分析)”下,单击 {% data variables.product.prodname_dependabot_alerts %} 右侧的 **Disable all(禁用所有)**或 **Enable all(启用所有)**
2. Under "Code security and analysis", to the right of {% data variables.product.prodname_dependabot_alerts %}, click **Disable all** or **Enable all**.
{% ifversion fpt or ghec %}
![强调显示"启用所有"或"禁用所有"按钮的"配置安全性和分析"功能屏幕截图](/assets/images/help/dependabot/dependabot-alerts-disable-or-enable-fpt.png)
![Screenshot of "Configure security and analysis" features with the "Enable all" or "Disable all" button emphasized for Dependabot alerts](/assets/images/help/dependabot/dependabot-alerts-disable-or-enable-fpt.png)
{% endif %}
{% ifversion ghae %}
!["Configure security and analysis配置安全性和分析"功能的"Enable all全部启用"或"Disable all全部禁用"按钮](/assets/images/enterprise/github-ae/organizations/security-and-analysis-disable-or-enable-all-ghae.png)
!["Enable all" or "Disable all" button for "Configure security and analysis" features](/assets/images/enterprise/github-ae/organizations/security-and-analysis-disable-or-enable-all-ghae.png)
{% endif %}
{% ifversion fpt or ghec %}
3. (可选)默认为您的组织中新的仓库启用 {% data variables.product.prodname_dependabot_alerts %}
3. Optionally, enable {% data variables.product.prodname_dependabot_alerts %} by default for new repositories in your organization.
{% ifversion fpt or ghec %}
![新仓库的"Enable by default(默认启用)"选项屏幕截图](/assets/images/help/dependabot/dependabot-alerts-enable-by-default-organizations.png)
![Screenshot of "Enable by default" option for new repositories](/assets/images/help/dependabot/dependabot-alerts-enable-by-default-organizations.png)
{% endif %}
{% endif %}
{% ifversion fpt or ghec %}
4. 单击**禁用 {% data variables.product.prodname_dependabot_alerts %}** 或**启用 {% data variables.product.prodname_dependabot_alerts %}** ,为组织中的所有存储库禁用或启用 {% data variables.product.prodname_dependabot_alerts %}
4. Click **Disable {% data variables.product.prodname_dependabot_alerts %}** or **Enable {% data variables.product.prodname_dependabot_alerts %}** to disable or enable {% data variables.product.prodname_dependabot_alerts %} for all the repositories in your organization.
{% ifversion fpt or ghec %}
![强调显示禁用或启用功能按钮的"启用 Dependabot 警报"模式屏幕截图](/assets/images/help/dependabot/dependabot-alerts-enable-dependabot-alerts-organizations.png)
![Screenshot of "Enable Dependabot alerts" modal with button to disable or enable feature emphasized](/assets/images/help/dependabot/dependabot-alerts-enable-dependabot-alerts-organizations.png)
{% endif %}{% endif %}{% endif %}{% ifversion ghes or ghae %}
企业所有者可以启用或禁用组织的 {% data variables.product.prodname_dependabot_alerts %}。 更多信息请参阅“[关于 GitHub Enterprise Server 的 Dependabot](/admin/configuration/configuring-github-connect/enabling-dependabot-for-your-enterprise)”。
{% data variables.product.prodname_dependabot_alerts %} for your organization can be enabled or disabled by your enterprise owner. For more information, see "[About Dependabot for GitHub Enterprise Server](/admin/configuration/configuring-github-connect/enabling-dependabot-for-your-enterprise)."
{% endif %}

View File

@@ -21,12 +21,12 @@ topics:
- Repositories
---
## About notifications for {% data variables.product.prodname_dependabot_alerts %}
## 关于 {% data variables.product.prodname_dependabot_alerts %} 的通知
When {% data variables.product.prodname_dependabot %} detects vulnerable dependencies{% ifversion GH-advisory-db-supports-malware %} or malware{% endif %} in your repositories, we generate a {% data variables.product.prodname_dependabot %} alert and display it on the Security tab for the repository. {% data variables.product.product_name %} 根据通知首选项将新警报通知受影响仓库的维护员。{% ifversion fpt or ghec %} {% data variables.product.prodname_dependabot %} 在所有公共仓库上默认启用。 对于 {% data variables.product.prodname_dependabot_alerts %},默认情况下,您将通过电子邮件收到按特定漏洞分组的 {% data variables.product.prodname_dependabot_alerts %}。
{% data variables.product.prodname_dependabot %} 在您的仓库中检测到有漏洞依赖项{% ifversion GH-advisory-db-supports-malware %}或恶意软件{% endif %}时,我们将生成 {% data variables.product.prodname_dependabot %} 警报并将其显示在仓库的“Security安全”选项卡中。 {% data variables.product.product_name %} 根据通知首选项将新警报通知受影响仓库的维护员。{% ifversion fpt or ghec %} {% data variables.product.prodname_dependabot %} 在所有公共仓库上默认启用。 对于 {% data variables.product.prodname_dependabot_alerts %},默认情况下,您将通过电子邮件收到按特定漏洞分组的 {% data variables.product.prodname_dependabot_alerts %}。
{% endif %}
{% ifversion fpt or ghec %}如果您是组织所有者,您可以对组织中的所有仓库一键启用或禁用 {% data variables.product.prodname_dependabot_alerts %}。 You can also set whether {% data variables.product.prodname_dependabot_alerts %} will be enabled or disabled for newly-created repositories. 更多信息请参阅“[管理组织的安全和分析设置](/organizations/keeping-your-organization-secure/managing-security-and-analysis-settings-for-your-organization#enabling-or-disabling-a-feature-for-all-new-repositories-when-they-are-added)”。
{% ifversion fpt or ghec %}如果您是组织所有者,您可以对组织中的所有仓库一键启用或禁用 {% data variables.product.prodname_dependabot_alerts %}。 您也可以设置是否对新建的仓库启用或禁用 {% data variables.product.prodname_dependabot_alerts %} 更多信息请参阅“[管理组织的安全和分析设置](/organizations/keeping-your-organization-secure/managing-security-and-analysis-settings-for-your-organization#enabling-or-disabling-a-feature-for-all-new-repositories-when-they-are-added)”。
{% endif %}
{% ifversion ghes or ghae %}
@@ -56,9 +56,9 @@ When {% data variables.product.prodname_dependabot %} detects vulnerable depende
{% data reusables.repositories.security-alerts-x-github-severity %} 更多信息请参阅“[配置通知](/github/managing-subscriptions-and-notifications-on-github/configuring-notifications#filtering-email-notifications)”。
## How to reduce the noise from notifications for {% data variables.product.prodname_dependabot_alerts %}
## 如何减少 {% data variables.product.prodname_dependabot_alerts %} 通知的噪音
如果您想要收到太多 {% data variables.product.prodname_dependabot_alerts %} 的通知,我们建议您选择加入每周的电子邮件摘要,或者在保持 {% data variables.product.prodname_dependabot_alerts %} 启用时关闭通知。 您仍可导航到仓库的 Security安全性选项卡查看 {% data variables.product.prodname_dependabot_alerts %}。 For more information, see "[Viewing and updatng {% data variables.product.prodname_dependabot_alerts %}](/code-security/dependabot/dependabot-alerts/viewing-and-updating-dependabot-alerts)."
如果您想要收到太多 {% data variables.product.prodname_dependabot_alerts %} 的通知,我们建议您选择加入每周的电子邮件摘要,或者在保持 {% data variables.product.prodname_dependabot_alerts %} 启用时关闭通知。 您仍可导航到仓库的 Security安全性选项卡查看 {% data variables.product.prodname_dependabot_alerts %}。 更多信息请参阅“[查看和更新 {% data variables.product.prodname_dependabot_alerts %}](/code-security/dependabot/dependabot-alerts/viewing-and-updating-dependabot-alerts)”。
## 延伸阅读

View File

@@ -1,6 +1,6 @@
---
title: 查看和更新 Dependabot 警报
intro: 'If {% data variables.product.product_name %} discovers insecure dependencies in your project, you can view details on the Dependabot alerts tab of your repository. Then, you can update your project to resolve or dismiss the alert.'
intro: '如果 {% data variables.product.product_name %} 发现项目中存在不安全的依赖项,您可以在仓库的 Dependabot 警报选项卡中查看详细信息。 然后,您可以更新项目以解决或忽略警报。'
redirect_from:
- /articles/viewing-and-updating-vulnerable-dependencies-in-your-repository
- /github/managing-security-vulnerabilities/viewing-and-updating-vulnerable-dependencies-in-your-repository
@@ -35,11 +35,11 @@ topics:
{% ifversion fpt or ghec or ghes > 3.2 %}
## 关于仓库中有漏洞的依赖项的更新
{% data variables.product.product_name %} generates {% data variables.product.prodname_dependabot_alerts %} when we detect that your codebase is using dependencies with known security risks. 对于启用了 {% data variables.product.prodname_dependabot_security_updates %} 的仓库,当 {% data variables.product.product_name %} 在默认分支中检测到有漏洞的依赖项时,{% data variables.product.prodname_dependabot %} 会创建拉取请求来修复它。 拉取请求会将依赖项升级到避免漏洞所需的最低安全版本。
{% data variables.product.product_name %} 在检测到您的代码库正在使用具有已知安全风险的依赖项时会生成 {% data variables.product.prodname_dependabot_alerts %} 对于启用了 {% data variables.product.prodname_dependabot_security_updates %} 的仓库,当 {% data variables.product.product_name %} 在默认分支中检测到有漏洞的依赖项时,{% data variables.product.prodname_dependabot %} 会创建拉取请求来修复它。 拉取请求会将依赖项升级到避免漏洞所需的最低安全版本。
{% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-5638 %}您可以使用 {% data variables.product.prodname_dependabot_alerts %} 选项卡中的下拉菜单对 {% data variables.product.prodname_dependabot_alerts %} 进行排序和过滤,也可以在搜索栏中键入过滤条件作为`键:值`对。 可用的过滤器包括仓库(例如 `repo:my-repository`)、包(例如 `package:django`)、生态系统(例如 `ecosystem:npm`)、清单(例如 `manifest:webwolf/pom.xml`)、状态(例如 `is:open`)以及公告是否有补丁(例如 `has: patch`)。
Each {% data variables.product.prodname_dependabot %} alert has a unique numeric identifier and the {% data variables.product.prodname_dependabot_alerts %} tab lists an alert for every detected vulnerability{% ifversion GH-advisory-db-supports-malware %} or malware{% endif %}. 旧版 {% data variables.product.prodname_dependabot_alerts %} 按依赖项对漏洞进行分组,并为每个依赖项生成一个警报。 如果导航到旧版 {% data variables.product.prodname_dependabot %} 警报,则会将您重定向到为该包筛选的 {% data variables.product.prodname_dependabot_alerts %} 选项卡。 {% endif %}
每个 {% data variables.product.prodname_dependabot %} 警报都有一个唯一的数字标识符,{% data variables.product.prodname_dependabot_alerts %} 选项卡列出了每个检测到的漏洞{% ifversion GH-advisory-db-supports-malware %}或恶意软件{% endif %}的警报。 旧版 {% data variables.product.prodname_dependabot_alerts %} 按依赖项对漏洞进行分组,并为每个依赖项生成一个警报。 如果导航到旧版 {% data variables.product.prodname_dependabot %} 警报,则会将您重定向到为该包筛选的 {% data variables.product.prodname_dependabot_alerts %} 选项卡。 {% endif %}
{% endif %}
{% ifversion dependabot-alerts-vulnerable-calls %}

View File

@@ -33,7 +33,7 @@ shortTitle: 配置 dependabot.yml
下次安全警报触发安全更新的拉取请求时将使用所有同时影响安全更新的选项。 更多信息请参阅“[配置 {% data variables.product.prodname_dependabot_security_updates %}](/code-security/supply-chain-security/managing-vulnerabilities-in-your-projects-dependencies/configuring-dependabot-security-updates)。”
*dependabot.yml* 文件有两个必需的顶级密钥:`version``updates`。 您可以选择包括顶级 `registries` 密钥{% ifversion fpt or ghec or ghes > 3.4 %} 和/或 `enable-beta-ecosystems` 密钥{% endif %}。 该文件必须以 `version: 2` 开头。
*dependabot.yml* 文件有两个必需的顶级密钥:`version``updates`。 您可以选择包括顶级 `registries` 密钥{% ifversion ghes = 3.5 %} 和/或 `enable-beta-ecosystems` 密钥{% endif %}。 该文件必须以 `version: 2` 开头。
## *dependabot.yml* 文件的配置选项
@@ -975,8 +975,9 @@ registries:
version: 2
enable-beta-ecosystems: true
updates:
- package-ecosystem: "pub"
updates:{% ifversion fpt or ghec or ghes > 3.5 %}
- package-ecosystem: "beta-ecosystem"{% else %}
- package-ecosystem: "pub"{% endif %}
directory: "/"
schedule:
interval: "daily"

View File

@@ -23,8 +23,8 @@ shortTitle: 配置依赖关系图
更多信息请参阅“[关于依赖关系图](/code-security/supply-chain-security/understanding-your-software-supply-chain/about-the-dependency-graph)”。
{% ifversion fpt or ghec %}
## About configuring the dependency graph
To generate a dependency graph, {% data variables.product.product_name %} needs read-only access to the dependency manifest and lock files for a repository. 依赖关系图自动为所有公共仓库生成,您可以选择为私有仓库启用它。 有关查看依赖关系图的更多信息,请参阅“[探索存储库的依赖关系](/github/visualizing-repository-data-with-graphs/exploring-the-dependencies-of-a-repository)”。
## 关于配置依赖关系图
要生成依赖关系图,{% data variables.product.product_name %} 需要对仓库的依赖项清单和锁定文件的只读访问权限。 依赖关系图自动为所有公共仓库生成,您可以选择为私有仓库启用它。 有关查看依赖关系图的更多信息,请参阅“[探索存储库的依赖关系](/github/visualizing-repository-data-with-graphs/exploring-the-dependencies-of-a-repository)”。
{% data reusables.dependency-submission.dependency-submission-link %}
{% endif %}

View File

@@ -1,7 +1,7 @@
---
title: Using the Dependency submission API
intro: 'You can use the Dependency submission API to submit dependencies for projects, such as the dependencies resolved when a project is built or compiled.'
shortTitle: Dependency submission API
title: 使用依赖项提交 API
intro: 可以使用依赖项提交 API 提交项目的依赖项,例如在生成或编译项目时解析的依赖项。
shortTitle: 依赖项提交 API
topics:
- API
- Dependency graph
@@ -13,25 +13,25 @@ versions:
{% data reusables.dependency-submission.dependency-submission-api-beta %}
## About the Dependency submission API
## 关于依赖项提交 API
{% data reusables.dependency-submission.about-dependency-submission %}
Dependencies are submitted to the dependency submission API in the form of a snapshot. A snapshot is a set of dependencies associated with a commit SHA and other metadata, that reflects the current state of your repository for a commit. For more information about the Dependency submission API, see the [Dependency submission REST API documentation](/rest/dependency-graph/dependency-submission).
依赖项以快照的形式提交到依赖项提交 API。 快照是一组与提交 SHA 和其他元数据关联的依赖项,它反映了提交存储库的当前状态。 有关依赖项提交 API 的详细信息,请参阅[依赖项提交 REST API 文档](/rest/dependency-graph/dependency-submission)
## Submitting dependencies at build-time
## 在构建时提交依赖项
You can use the Dependency submission API in a {% data variables.product.prodname_actions %} workflow to submit dependencies for your project when your project is built.
可以在 {% data variables.product.prodname_actions %} 工作流程中使用依赖项提交 API以便在生成项目时提交项目的依赖项。
### Using pre-made actions
### 使用预制操作
The simplest way to use the Dependency submission API is by adding a pre-made action to your repository that will gather and convert the list of dependencies to the required snapshot format and submit the list to the API. Actions that complete these steps for various ecosystems are available on {% data variables.product.prodname_marketplace %} and more actions will be created during the course of the beta and beyond. You can find links to the currently available actions in the table below:
使用依赖项提交 API 的最简单方法是向存储库添加一个预制操作,该操作将收集依赖项列表并将其转换为所需的快照格式,并将列表提交到 API。 {% data variables.product.prodname_marketplace %} 上提供了针对各种生态系统完成这些步骤的操作,并且在测试期间及以后将创建更多操作。 您可以在下表中找到指向当前可用操作的链接:
| Ecosystem | 操作 |
| --------- | ------------------------------------------------------------------------------- |
| Go | [Go Dependency Submission](https://github.com/actions/go-dependency-submission) |
| 生态系统 | 操作 |
| ---- | --------------------------------------------------------------- |
| Go | [Go 依赖项提交](https://github.com/actions/go-dependency-submission) |
For example, the following [Go Dependency Submission](https://github.com/actions/go-dependency-submission) workflow calculates the dependencies for a Go build-target (a Go file with a `main` function) and submits the list to the Dependency Submission API.
例如,以下 [Go 依赖项提交](https://github.com/actions/go-dependency-submission)工作流程计算 Go 构建目标(具有 `main` 函数的 Go 文件)的依赖项,并将列表提交到依赖项提交 API
```yaml
@@ -75,12 +75,12 @@ jobs:
go-build-target: go-example/cmd/octocat.go
```
### Creating your own action
### 创建自己的操作
Alternatively, you can write your own action to submit dependencies for your project at build-time. Your workflow should:
或者,您可以编写自己的操作,以便在构建时提交项目的依赖项。 您的工作流程应该:
1. Generate a list of dependencies for your project.
2. Translate the list of dependencies into the snapshot format accepted by the Dependency submission API. For more information about the format, see the body parameters for the "Create a repository snapshot" API operation in the [Dependency submission REST API documentation](/rest/dependency-graph/dependency-submission).
3. Submit the formatted list of dependencies to the Dependency submission API.
1. 为项目生成依赖项列表。
2. 将依赖项列表转换为依赖项提交 API 接受的快照格式。 有关格式的详细信息,请参阅 [依赖项提交 REST API 文档](/rest/dependency-graph/dependency-submission)中的“创建存储库快照”API 操作正文参数。
3. 将格式化的依赖项列表提交到依赖项提交 API
{% data variables.product.product_name %} maintains the [Dependency Submission Toolkit](https://github.com/github/dependency-submission-toolkit), a TypeScript library to help you build your own GitHub Action for submitting dependencies to the Dependency submission API. For more information about writing an action, see "[Creating actions](/actions/creating-actions)".
{% data variables.product.product_name %} 维护 [Dependency Submit Toolkit](https://github.com/github/dependency-submission-toolkit),这是一个 TypeScript 库,可帮助您构建自己的 GitHub Action用于将依赖项提交到 Dependency 提交 API。 有关编写操作的详细信息,请参阅“[创建操作](/actions/creating-actions)”。

View File

@@ -10,6 +10,7 @@ redirect_from:
- /codespaces/developing-in-codespaces/changing-the-machine-type-for-your-codespace
topics:
- Codespaces
type: how_to
---
## About machine types

View File

@@ -0,0 +1,104 @@
---
title: Configuring automatic deletion of your codespaces
shortTitle: Configure automatic deletion
intro: 'Unused codespaces are automatically deleted. You can choose how long your stopped codespaces are retained, up to a maximum of 30 days.'
product: '{% data reusables.gated-features.codespaces %}'
versions:
fpt: '*'
ghec: '*'
topics:
- Codespaces
type: how_to
---
By default, {% data variables.product.prodname_codespaces %} are automatically deleted after they have been stopped and have remained inactive for 30 days.
However, because {% data variables.product.prodname_codespaces %} incur storage charges, you may prefer to reduce the retention period by changing your default period in your personal settings for {% data variables.product.prodname_github_codespaces %}. For more information about storage charges, see "[About billing for Codespaces](/billing/managing-billing-for-github-codespaces/about-billing-for-codespaces#codespaces-pricing)."
{% note %}
**Note**: Whether or not you have set a personal codespace retention period, it's a good idea to get into the habit of deleting codespaces that you no longer need. 更多信息请参阅“[删除代码空间](/codespaces/developing-in-codespaces/deleting-a-codespace)”。
{% endnote %}
Automatic deletion happens irrespective of whether a codespace contains unpushed changes. To prevent automatic deletion of a codespace, just open the codespace again. The retention period is reset every time you connect to a codespace, and the retention countdown restarts when the codespace is stopped.
If a repository belongs to an organization, the organization admin may have set a retention period for the whole organization. If this period is less than the default retention period in your personal settings then the organization retention period will apply to codespaces you create for this repository. For more information, see "[Restricting the retention period for codespaces](/codespaces/managing-codespaces-for-your-organization/restricting-the-retention-period-for-codespaces)."
Each codespace has its own retention period. You may, therefore, have codespaces with different rentention periods. For example, if:
* You created a codespace, changed your default retention period, then created another codespace.
* You created a codespace from an organization-owned repository that has a retention period configured for the organization.
{% note %}
**Note**: The retention period is specified in days. A day represents a 24-hour period, beginning at the time of day when you stop a codespace.
{% endnote %}
{% webui %}
## Setting a default retention period for your codespaces
{% data reusables.user-settings.access_settings %}
{% data reusables.user-settings.codespaces-tab %}
1. Under "Default retention period", enter the number of days for which you want your codespaces to be retained, by default, after they have been stopped.
![Selecting your retention period](/assets/images/help/codespaces/setting-default-retention.png)
You can set your default retention period between `0` and `30` days.
{% warning %}
**Warning**: Setting the period to `0` will result in your codespaces being immediately deleted when you stop them, or when they timeout due to inactivity. 更多信息请参阅“[设置代码空间的超时期限](/codespaces/customizing-your-codespace/setting-your-timeout-period-for-codespaces)”。
{% endwarning %}
1. 单击 **Save保存**
This default setting may be superseded by a shorter organization-level retention period.
If you set a retention period of more than a day, you'll be sent an email notification one day prior to its deletion.
## Checking the remaining time until autodeletion
You can check whether a codespace is due to be automatically deleted soon.
When an inactive codespace is approaching the end of its retention period, this is indicated in your list of codespaces on {% data variables.product.prodname_dotcom %} at [https://github.com/codespaces](https://github.com/codespaces).
![The pre-deletion message in the codespaces list on {% data variables.product.prodname_dotcom %}](/assets/images/help/codespaces/retention-deletion-message.png)
{% endwebui %}
{% cli %}
## Setting a retention period for a codespace
You can set your default retention period in your web browser, on {% data variables.product.prodname_dotcom_the_website %}. For more information, click the "Web browser" tab at the top of this article.
{% data reusables.cli.cli-learn-more %}
{% endcli %}
{% vscode %}
## Setting the retention period
You can set your default retention period in your web browser, on {% data variables.product.prodname_dotcom_the_website %}. For more information, click the "Web browser" tab at the top of this article.
## Checking whether codespaces will be autodeleted soon
You can check, in the {% data variables.product.prodname_vscode %} desktop application, whether a codespace is due to be automatically deleted soon.
{% data reusables.codespaces.click-remote-explorer-icon-vscode %}
1. Choose **{% data variables.product.prodname_github_codespaces %}** from the drop-down menu at the top right of the Remote Explorer, if it is not already selected.
1. Under "GITHUB CODESPACES," position the mouse pointer over the codespace that you're interested in. A pop-up box is displayed showing you information about the codespace.
If the codespace is nearing the end of its retention period, a line is included telling you when the codespace will be deleted.
![Codespace information showing the time until deletion](/assets/images/help/codespaces/vscode-deleting-in-5-days.png)
{% endvscode %}

View File

@@ -15,5 +15,6 @@ children:
- /setting-your-default-editor-for-codespaces
- /setting-your-default-region-for-codespaces
- /setting-your-timeout-period-for-codespaces
- /configuring-automatic-deletion-of-your-codespaces
---

View File

@@ -1,5 +1,6 @@
---
title: Personalizing Codespaces for your account
shortTitle: Personalize your codespaces
intro: 'You can personalize {% data variables.product.prodname_codespaces %} by using a `dotfiles` repository on {% data variables.product.product_name %} or by using Settings Sync.'
redirect_from:
- /github/developing-online-with-github-codespaces/personalizing-github-codespaces-for-your-account
@@ -14,7 +15,6 @@ topics:
- Set up
- Fundamentals
product: '{% data reusables.gated-features.codespaces %}'
shortTitle: Personalize your codespaces
---

View File

@@ -1,5 +1,6 @@
---
title: Setting your default editor for Codespaces
shortTitle: Set the default editor
intro: 'You can set your default editor for {% data variables.product.prodname_codespaces %} in your personal settings page.'
product: '{% data reusables.gated-features.codespaces %}'
versions:
@@ -9,7 +10,7 @@ redirect_from:
- /codespaces/managing-your-codespaces/setting-your-default-editor-for-codespaces
topics:
- Codespaces
shortTitle: Set the default editor
type: how_to
---
On the settings page, you can set your editor preference so that any newly created codespaces are opened automatically in either {% data variables.product.prodname_vscode %} for Web or the {% data variables.product.prodname_vscode %} desktop application.

View File

@@ -1,5 +1,6 @@
---
title: 设置 Codespaces 的默认区域
shortTitle: 设置默认区域
intro: '您可以在 {% data variables.product.prodname_github_codespaces %} 配置文件设置页面中设置默认地区,以个性化您的数据保存位置。'
product: '{% data reusables.gated-features.codespaces %}'
versions:
@@ -9,7 +10,7 @@ redirect_from:
- /codespaces/managing-your-codespaces/setting-your-default-region-for-codespaces
topics:
- Codespaces
shortTitle: 设置默认区域
type: how_to
---
您可以手动选择将在其中创建代码空间的区域,从而满足严格的安全性和合规性要求。 默认情况下,系统会根据您的位置自动设置您的区域。

View File

@@ -1,5 +1,6 @@
---
title: 设置 Codespaces 超时时间
shortTitle: 设置超时
intro: '您可以在个人设置页面中设置 {% data variables.product.prodname_codespaces %} 的默认超时。'
product: '{% data reusables.gated-features.codespaces %}'
versions:
@@ -7,7 +8,7 @@ versions:
ghec: '*'
topics:
- Codespaces
shortTitle: 设置超时
type: how_to
---
代码空间将在一段时间不活动后停止运行。 您可以指定此超时期限的长度。 更新后的设置将应用于任何新创建的代码空间。
@@ -22,7 +23,7 @@ shortTitle: 设置超时
{% webui %}
## 设置默认超时
## 设置默认超时
{% data reusables.user-settings.access_settings %}
{% data reusables.user-settings.codespaces-tab %}
@@ -32,7 +33,7 @@ shortTitle: 设置超时
{% cli %}
## 设置超时期限
## 设置代码空间的超时期限
{% data reusables.cli.cli-learn-more %}
@@ -45,3 +46,11 @@ gh codespace create --idle-timeout 90m
如果在创建代码空间时未指定超时期限,则将使用默认超时期限。 有关设置默认超时期限的信息请单击此页面上的“Web browserWeb 浏览器)”选项卡。 您当前无法通过 {% data variables.product.prodname_cli %} 指定默认超时期限。
{% endcli %}
{% vscode %}
## 设置超时期
您可以通过 Web 浏览器在 {% data variables.product.prodname_dotcom_the_website %} 上设置默认超时期限。 或者,如果使用 {% data variables.product.prodname_cli %} 创建代码空间,则可以为该特定代码空间设置超时期限。 有关详细信息,请单击上面的相应选项卡。
{% endvscode %}

View File

@@ -26,16 +26,26 @@ includeGuides:
- /codespaces/developing-in-codespaces/using-source-control-in-your-codespace
- /codespaces/developing-in-codespaces/using-codespaces-for-pull-requests
- /codespaces/developing-in-codespaces/changing-the-machine-type-for-your-codespace
- /codespaces/customizing-your-codespace/changing-the-machine-type-for-your-codespace
- /codespaces/customizing-your-codespace/configuring-automatic-deletion-of-your-codespaces
- /codespaces/customizing-your-codespace/personalizing-codespaces-for-your-account
- /codespaces/customizing-your-codespace/setting-your-default-editor-for-codespaces
- /codespaces/customizing-your-codespace/setting-your-default-region-for-codespaces
- /codespaces/customizing-your-codespace/setting-your-timeout-period-for-codespaces
- /codespaces/managing-your-codespaces/managing-encrypted-secrets-for-your-codespaces
- /codespaces/managing-your-codespaces/managing-repository-access-for-your-codespaces
- /codespaces/managing-your-codespaces/managing-gpg-verification-for-codespaces
- /codespaces/managing-your-codespaces/setting-your-default-editor-for-codespaces
- /codespaces/managing-your-codespaces/setting-your-default-region-for-codespaces
- /codespaces/managing-codespaces-for-your-organization/managing-repository-access-for-your-organizations-codespaces
- /codespaces/managing-codespaces-for-your-organization/enabling-codespaces-for-your-organization
- /codespaces/managing-codespaces-for-your-organization/reviewing-your-organizations-audit-logs-for-codespaces
- /codespaces/managing-codespaces-for-your-organization/managing-billing-for-codespaces-in-your-organization
- /codespaces/managing-codespaces-for-your-organization/managing-encrypted-secrets-for-your-repository-and-organization-for-codespaces
- /codespaces/managing-codespaces-for-your-organization/managing-repository-access-for-your-organizations-codespaces
- /codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types
- /codespaces/managing-codespaces-for-your-organization/retricting-the-idle-timeout-period
- /codespaces/managing-codespaces-for-your-organization/restricting-the-retention-period-for-codespaces
- /codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports
- /codespaces/managing-codespaces-for-your-organization/reviewing-your-organizations-audit-logs-for-codespaces
- /codespaces/codespaces-reference/understanding-billing-for-codespaces
- /codespaces/codespaces-reference/using-the-command-palette-in-codespaces
- /codespaces/codespaces-reference/disaster-recovery-for-codespaces

View File

@@ -16,6 +16,7 @@ children:
- /restricting-access-to-machine-types
- /restricting-the-visibility-of-forwarded-ports
- /restricting-the-idle-timeout-period
- /restricting-the-retention-period-for-codespaces
shortTitle: 管理组织
---

View File

@@ -57,8 +57,8 @@ topics:
![编辑计算机类型约束](/assets/images/help/codespaces/edit-machine-constraint.png)
{% data reusables.codespaces.codespaces-policy-targets %}
1. 如果要向策略添加其他约束,请单击 **Add constraint添加约束** ,然后选择另一个约束。 有关其他约束的信息,请参阅“[限制转发端口可见性](/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports)”“[限制空闲超时期限](/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period)”。
1. 向策略添加完约束后,单击 **Save(保存)**
1. 如果要向策略添加其他约束,请单击 **Add constraint添加约束** ,然后选择另一个约束。 有关其他约束的信息,请参阅“[限制转发端口可见性](/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports)”“[限制空闲超时期限](/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period)”和“[限制代码空间的保留期](/codespaces/managing-codespaces-for-your-organization/restricting-the-retention-period-for-codespaces)”
1. After you've finished adding constraints to your policy, click **Save**.
## 编辑策略
您可以编辑现有策略。 例如,您可能希望在策略中添加或删除约束。

View File

@@ -18,7 +18,7 @@ topics:
{% data variables.product.prodname_dotcom %} 用户的个人设置允许他们为其创建的代码空间定义自己的超时期限。 这可能比默认的 30 分钟长。 更多信息请参阅“[设置代码空间的超时期限](/codespaces/customizing-your-codespace/setting-your-timeout-period-for-codespaces)”。
作为组织所有者,您可能希望为组织拥有的代码空间配置最长空闲超时期限的约束。 这可以帮助您限制与代码空间相关的成本,这些代码空间在长时间处于非活动状态后会超时。 您可以为组织拥有的所有代码空间或特定存储库的代码空间设置最大超时。
作为组织所有者,您可能希望为组织拥有的存储库创建的代码空间的最大空闲超时期限配置限制。 这可以帮助您限制与代码空间相关的成本,这些代码空间在长时间处于非活动状态后会超时。 您可以为组织拥有的所有存储库的代码空间或特定存储库的代码空间设置最大超时。
{% note %}
@@ -55,11 +55,11 @@ topics:
1. 输入代码空间在超时之前可以保持非活动状态的最大分钟数,然后单击 **Save保存**
![选择端口可见性选项](/assets/images/help/codespaces/maximum-minutes-timeout.png)
![设置最大超时(以分钟为单位)](/assets/images/help/codespaces/maximum-minutes-timeout.png)
{% data reusables.codespaces.codespaces-policy-targets %}
1. 如果要向策略添加其他约束,请单击 **Add constraint添加约束** ,然后选择另一个约束。 有关其他约束的信息,请参阅“[限制对计算机类型的访问](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)”“[限制转发端口的可见性](/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports)”。
1. 向策略添加完约束后,单击 **Save(保存)**
1. 如果要向策略添加其他约束,请单击 **Add constraint添加约束** ,然后选择另一个约束。 有关其他约束的信息,请参阅“[限制对计算机类型的访问](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)”“[限制转发端口的可见性](/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports)”和“[限制代码空间的保留期](/codespaces/managing-codespaces-for-your-organization/restricting-the-retention-period-for-codespaces)”
1. After you've finished adding constraints to your policy, click **Save**.
该策略将应用于创建的所有新代码空间,在现有代码空间下次启动时也会应用于它们。

View File

@@ -0,0 +1,78 @@
---
title: Restricting the retention period for codespaces
shortTitle: Restrict the retention period
intro: You can set a maximum retention period for any codespaces owned by your organization.
product: '{% data reusables.gated-features.codespaces %}'
permissions: 'To manage retention constraints for an organization''s codespaces, you must be an owner of the organization.'
versions:
fpt: '*'
ghec: '*'
type: how_to
topics:
- Codespaces
---
## 概览
{% data variables.product.prodname_codespaces %} are automatically deleted after they have been stopped and have remained inactive for a defined number of days. The retention period for each codespace is set when the codespace is created and does not change.
Everyone who has access to {% data variables.product.prodname_github_codespaces %} can configure a retention period for the codespaces they create. The initial setting for this retention period is 30 days. Individual users can set this period within the range 0-30 days. For more information, see "[Configuring automatic deletion of your codespaces](/codespaces/customizing-your-codespace/configuring-automatic-deletion-of-your-codespaces)."
As an organization owner, you may want to configure constraints on the maximum retention period for codespaces created for the repositories owned by your organization. This can help you to limit the storage costs associated with codespaces that are stopped and then left unused until they are automatically deleted. For more information about storage charges, see "[About billing for Codespaces](/billing/managing-billing-for-github-codespaces/about-billing-for-codespaces#codespaces-pricing)." You can set a maximum retention period for all, or for specific, repositories owned by your organization.
### 设置组织范围和存储库特定的策略
创建策略时,您可以选择是将其应用于组织中的所有存储库,还是仅应用于指定的存储库。 If you create an organization-wide policy with a codespace retention constraint, then the retention constraints in any policies that are targeted at specific repositories should be shorter than the restriction configured for the entire organization, or they will have no effect. The shortest retention period - in an organization-wide policy, a policy targeted at specified repositories, or in someone's personal settings - is applied.
If you add an organization-wide policy with a retention constraint, you should set the retention period to the longest acceptable period. You can then add separate policies that set the maximum retention to a shorter period for specific repositories in your organization.
## Adding a policy to set a maximum codespace retention period
{% data reusables.profile.access_org %}
{% data reusables.profile.org_settings %}
{% data reusables.codespaces.codespaces-org-policies %}
1. Click **Add constraint** and choose **Retention period**.
![Add a constraint for retention periods](/assets/images/help/codespaces/add-constraint-dropdown-retention.png)
1. 单击 {% octicon "pencil" aria-label="The edit icon" %} 编辑约束。
![编辑超时约束](/assets/images/help/codespaces/edit-timeout-constraint.png)
1. Enter the maximum number of days codespaces can remain stopped before they are automatically deleted, then click **Save**.
![Set the retention period in days](/assets/images/help/codespaces/maximum-days-retention.png)
{% note %}
**注意**
* A day, in this context, is a 24-hour period, beginning at the time of day when the codespace was stopped.
* The valid range is 0-30 days.
* Setting the period to `0` will result in codespaces being immediately deleted when they are stopped, or when they timeout due to inactivity.
{% endnote %}
{% data reusables.codespaces.codespaces-policy-targets %}
1. 如果要向策略添加其他约束,请单击 **Add constraint添加约束** ,然后选择另一个约束。 For information about other constraints, see "[Restricting access to machine types](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)," "[Restricting the visibility of forwarded ports](/codespaces/managing-codespaces-for-your-organization/restricting-the-visibility-of-forwarded-ports)," and "[Restricting the idle timeout period](/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period)."
1. After you've finished adding constraints to your policy, click **Save**.
The policy will be applied to all new codespaces that are created.
## 编辑策略
您可以编辑现有策略。 例如,您可能希望在策略中添加或删除约束。
The retention period constraint is only applied to codespaces when they are created. Editing a policy has no effect on existing codespaces.
1. 显示“Codespace policies代码空间策略”页。 For more information, see "[Adding a policy to set a maximum codespace retention period](#adding-a-policy-to-set-a-maximum-codespace-retention-period)."
1. 单击要编辑的策略的名称。
1. 进行所需的更改,然后单击 **Save保存**
## 删除策略
You can delete a policy at any time. Deleting a policy has no effect on existing codespaces.
1. 显示“Codespace policies代码空间策略”页。 For more information, see "[Adding a policy to set a maximum codespace retention period](#adding-a-policy-to-set-a-maximum-codespace-retention-period)."
1. 单击要删除的策略右侧的删除按钮。
![策略的删除按钮](/assets/images/help/codespaces/policy-delete.png)

View File

@@ -54,8 +54,8 @@ topics:
![选择端口可见性选项](/assets/images/help/codespaces/choose-port-visibility-options.png)
{% data reusables.codespaces.codespaces-policy-targets %}
1. 如果要向策略添加其他约束,请单击 **Add constraint添加约束** ,然后选择另一个约束。 有关其他约束的信息,请参阅“[限制对计算机类型的访问](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)”“[限制空闲超时期限](/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period)”。
1. 向策略添加完约束后,单击 **Save(保存)**
1. 如果要向策略添加其他约束,请单击 **Add constraint添加约束** ,然后选择另一个约束。 有关其他约束的信息,请参阅“[限制对计算机类型的访问](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)”“[限制空闲超时期限](/codespaces/managing-codespaces-for-your-organization/restricting-the-idle-timeout-period)”和“[限制代码空间的保留期](/codespaces/managing-codespaces-for-your-organization/restricting-the-retention-period-for-codespaces)”
1. After you've finished adding constraints to your policy, click **Save**.
## 编辑策略
您可以编辑现有策略。 例如,您可能希望在策略中添加或删除约束。

View File

@@ -0,0 +1,81 @@
---
title: Configuring GitHub Copilot in a JetBrains IDE
intro: 'You can enable, configure, and disable {% data variables.product.prodname_copilot %} in a JetBrains IDE.'
product: '{% data reusables.gated-features.copilot %}'
topics:
- Copilot
versions:
feature: copilot
shortTitle: JetBrains
---
## About {% data variables.product.prodname_copilot %} in JetBrains IDEs
If you use a Jetbrains IDE, {% data variables.product.prodname_copilot %} can autocomplete code as you type. After installation, you can enable or disable {% data variables.product.prodname_copilot %}, and you can configure advanced settings within your IDE or on {% data variables.product.prodname_dotcom_the_website %}.
## 基本要求
To configure {% data variables.product.prodname_copilot %} in a JetBrains IDE, you must install the {% data variables.product.prodname_copilot %} plugin. For more information, see "[Getting started with {% data variables.product.prodname_copilot %} in a JetBrains IDE](/copilot/getting-started-with-github-copilot/getting-started-with-github-copilot-in-a-jetbrains-ide)."
## {% data variables.product.prodname_copilot %} 的键盘快捷键
You can use the default keyboard shortcuts for inline suggestions in your JetBrains IDE when using {% data variables.product.prodname_copilot %}. Alternatively, you can rebind the shortcuts to your preferred keyboard shortcuts for each specific command. For more information on rebinding keyboard shortcuts in your JetBrains IDE, see the JetBrains documentation. For example, you can view the [IntelliJ IDEA](https://www.jetbrains.com/help/idea/mastering-keyboard-shortcuts.html#choose-keymap) documentation.
{% mac %}
| 操作 | 快捷键 |
|:-------------------------------------------------------------- |:---------------------------------------------- |
| 接受内联建议 | <kbd>Tab</kbd> |
| 忽略内联建议 | <kbd>Esc</kbd> |
| 显示下一个内联建议 | <kbd>Option (⌥) or Alt</kbd>+<kbd>]</kbd> |
| 显示上一个内联建议 | <kbd>Option (⌥) or Alt</kbd>+<kbd>[</kbd> |
| 触发内联建议 | <kbd>Option (⌥)</kbd>+<kbd>\</kbd> |
| 打开 {% data variables.product.prodname_copilot %} (其他建议在单独的窗格中) | <kbd>Option (⌥) or Alt</kbd>+<kbd>Return</kbd> |
{% endmac %}
{% windows %}
| 操作 | 快捷键 |
|:-------------------------------------------------------------- |:------------------------------- |
| 接受内联建议 | <kbd>Tab</kbd> |
| 忽略内联建议 | <kbd>Esc</kbd> |
| 显示下一个内联建议 | <kbd>Alt</kbd>+<kbd>]</kbd> |
| 显示上一个内联建议 | <kbd>Alt</kbd>+<kbd>[</kbd> |
| 触发内联建议 | <kbd>Alt</kbd>+<kbd>\</kbd> |
| 打开 {% data variables.product.prodname_copilot %} (其他建议在单独的窗格中) | <kbd>Alt</kbd>+<kbd>Enter</kbd> |
{% endwindows %}
{% linux %}
| 操作 | 快捷键 |
|:-------------------------------------------------------------- |:------------------------------- |
| 接受内联建议 | <kbd>Tab</kbd> |
| 忽略内联建议 | <kbd>Esc</kbd> |
| 显示下一个内联建议 | <kbd>Alt</kbd>+<kbd>]</kbd> |
| 显示上一个内联建议 | <kbd>Alt</kbd>+<kbd>[</kbd> |
| 触发内联建议 | <kbd>Alt</kbd>+<kbd>\</kbd> |
| 打开 {% data variables.product.prodname_copilot %} (其他建议在单独的窗格中) | <kbd>Alt</kbd>+<kbd>Enter</kbd> |
{% endlinux %}
## 启用或禁用 {% data variables.product.prodname_copilot %}
You can enable or disable {% data variables.product.prodname_copilot %} from within your JetBrains IDE. The {% data variables.product.prodname_copilot %} status icon in the bottom panel of the JetBrains window indicates whether {% data variables.product.prodname_copilot %} is enabled or disabled. 启用后,该图标将突出显示。 禁用后,图标将灰显。
1. 要启用或禁用 {% data variables.product.prodname_copilot %},请单击 JetBrains 窗口底部面板中的状态图标。 ![Status icon in JetBrains](/assets/images/help/copilot/status-icon-jetbrains.png)
2. 如果要禁用 {% data variables.product.prodname_copilot %},系统将询问您是要全局禁用它,还是要禁用当前正在编辑的文件的语言。 To disable globally, click **Disable Completions**. Alternatively, click the language-specific button to disable {% data variables.product.prodname_copilot %} for the specified language. ![Disable {% data variables.product.prodname_copilot %} globally or for the current language](/assets/images/help/copilot/disable-copilot-global-or-langugage-jetbrains.png)
## Configuring advanced settings for {% data variables.product.prodname_copilot %}
You can manage advanced settings for {% data variables.product.prodname_copilot %} in your JetBrains IDE, such as how your IDE displays code completions, and which languages you want to enable or disable for {% data variables.product.prodname_copilot %}.
1. In your JetBrains IDE, click the **File** menu, then click **Settings**.
1. Under **Languages & Frameworks**, click **{% data variables.product.prodname_copilot %}**.
1. Edit the settings according to your personal preferences.
- To adjust the behaviour and appearance of code suggestions, and whether to automatically check for updates, select or deselect the corresponding checkboxes.
- If you have selected to receive automatic updates, you can choose whether to receive stable, but less frequent updates, or nightly updates, which may be less stable. Click the **Update channel** dropdown and select **Stable** for stable updates, or **Nightly** for nightly updates.
- Under "Disabled languages", use the checkboxes to select or deselect the languages you want to disable {% data variables.product.prodname_copilot %} for.
{% data reusables.copilot.dotcom-settings %}

View File

@@ -0,0 +1,18 @@
---
title: Configuring GitHub Copilot in Neovim
intro: 'You can enable, configure, and disable {% data variables.product.prodname_copilot %} in Neovim.'
product: '{% data reusables.gated-features.copilot %}'
versions:
feature: copilot
topics:
- Copilot
shortTitle: Neovim
---
## Configuring {% data variables.product.prodname_copilot %} in Neovim
For guidance on configuring {% data variables.product.prodname_copilot %} in Neovim, invoke the {% data variables.product.prodname_copilot %} documentation in Neovim by running the following command.
:help copilot
{% data reusables.copilot.dotcom-settings %}

View File

@@ -0,0 +1,113 @@
---
title: Configuring GitHub Copilot in Visual Studio Code
intro: 'You can enable, configure, and disable {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_vscode %}.'
product: '{% data reusables.gated-features.copilot %}'
versions:
feature: 'copilot'
shortTitle: Visual Studio Code
topics:
- Copilot
---
## About {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_vscode %}
If you use {% data variables.product.prodname_vscode %}, {% data variables.product.prodname_copilot %} can autocomplete code as you type. After installation, you can enable or disable {% data variables.product.prodname_copilot %}, and you can configure advanced settings within {% data variables.product.prodname_vscode %} or on {% data variables.product.prodname_dotcom_the_website %}.
## Prerequisites
To configure {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_vscode %}, you must install the {% data variables.product.prodname_copilot %} plugin. For more information, see "[Getting started with {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_vscode %}](/copilot/getting-started-with-github-copilot/getting-started-with-github-copilot-in-visual-studio-code)."
## Keyboard shortcuts for {% data variables.product.prodname_copilot %}
You can use the default keyboard shortcuts in {% data variables.product.prodname_vscode %} when using {% data variables.product.prodname_copilot %}. Alternatively, you can rebind the shortcuts in the Keyboard Shortcuts editor using your preferred keyboard shortcuts for each specific command. You can search for each keyboard shortcut by command name in the Keyboard Shortcuts editor.
{% mac %}
| Action | Shortcut | Command name |
|:---|:---|:---|
|Accept an inline suggestion|<kbd>Tab</kbd>|editor.action.inlineSuggest.commit|
|Dismiss an inline suggestion|<kbd>Esc</kbd>|editor.action.inlineSuggest.hide|
|Show next inline suggestion| <kbd>Option (⌥)</kbd>+<kbd>]</kbd><br> |editor.action.inlineSuggest.showNext|
|Show previous inline suggestion| <kbd>Option (⌥)</kbd>+<kbd>[</kbd><br> |editor.action.inlineSuggest.showPrevious|
|Trigger inline suggestion| <kbd>Option (⌥)</kbd>+<kbd>\</kbd><br> |editor.action.inlineSuggest.trigger|
|Open {% data variables.product.prodname_copilot %} (additional suggestions in separate pane)|<kbd>Ctrl</kbd>+<kbd>Return</kbd>|github.copilot.generate|
|Toggle {% data variables.product.prodname_copilot %} on/off|_No default shortcut_|github.copilot.toggleCopilot|
{% endmac %}
{% windows %}
| Action | Shortcut | Command name |
|:---|:---|:---|
|Accept an inline suggestion|<kbd>Tab</kbd>|editor.action.inlineSuggest.commit|
|Dismiss an inline suggestion|<kbd>Esc</kbd>|editor.action.inlineSuggest.hide|
|Show next inline suggestion|<kbd>Alt</kbd>+<kbd>]</kbd> |editor.action.inlineSuggest.showNext|
|Show previous inline suggestion|<kbd>Alt</kbd>+<kbd>[</kbd>|editor.action.inlineSuggest.showPrevious|
|Trigger inline suggestion|<kbd>Alt</kbd>+<kbd>\</kbd>|editor.action.inlineSuggest.trigger|
|Open {% data variables.product.prodname_copilot %} (additional suggestions in separate pane)|<kbd>Ctrl</kbd>+<kbd>Enter</kbd>|github.copilot.generate|
|Toggle {% data variables.product.prodname_copilot %} on/off|_No default shortcut_|github.copilot.toggleCopilot|
{% endwindows %}
{% linux %}
| Action | Shortcut | Command name |
|:---|:---|:---|
|Accept an inline suggestion|<kbd>Tab</kbd>|editor.action.inlineSuggest.commit|
|Dismiss an inline suggestion|<kbd>Esc</kbd>|editor.action.inlineSuggest.hide|
|Show next inline suggestion|<kbd>Alt</kbd>+<kbd>]</kbd> |editor.action.inlineSuggest.showNext|
|Show previous inline suggestion|<kbd>Alt</kbd>+<kbd>[</kbd>|editor.action.inlineSuggest.showPrevious|
|Trigger inline suggestion|<kbd>Alt</kbd>+<kbd>\</kbd>|editor.action.inlineSuggest.trigger|
|Open {% data variables.product.prodname_copilot %} (additional suggestions in separate pane)|<kbd>Ctrl</kbd>+<kbd>Enter</kbd>|github.copilot.generate|
|Toggle {% data variables.product.prodname_copilot %} on/off|_No default shortcut_|github.copilot.toggleCopilot|
{% endlinux %}
## Rebinding keyboard shortcuts
If you don't want to use the default keyboard shortcuts in {% data variables.product.prodname_vscode %} when using {% data variables.product.prodname_copilot %}, you can rebind the shortcuts in the Keyboard Shortcuts editor using your preferred keyboard shortcuts for each specific command.
1. Click the **File** menu, click **Preferences**, then click **Keyboard Shortcuts**.
![Screenshot of Visual Studio Code keyboard shortcuts](/assets/images/help/copilot/vsc-keyboard-shortcuts.png)
1. In the "Keyboard Shortcuts" editor, search for the command name of the keyboard shortcut you want to change.
![Screenshot of Keyboard shortcut search bar](/assets/images/help/copilot/vsc-shortcut-search-bar.png)
1. Next to the command you want to change, click the pencil icon.
![Screenshot of Keyboard shortcut editor](/assets/images/help/copilot/vsc-edit-shortcuts.png)
1. Type the keystrokes you want to use for the command, then press <kbd>Enter</kbd>/<kbd>Return</kbd>.
![Screenshot of Edit keyboard shortcut textbox](/assets/images/help/copilot/vsc-edit-shortcuts-textbox.png)
{% data reusables.copilot.enabling-or-disabling-in-vsc %}
## Enabling or disabling inline suggestions
You can choose to enable or disable inline suggestions for {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_vscode %}.
1. In the **File** menu, navigate to **Preferences** and click **Settings**.
![Screenshot of {% data variables.product.prodname_vscode %} settings](/assets/images/help/copilot/vsc-settings.png)
1. In the left-side panel of the settings tab, click **Extensions** and then select **Copilot**.
1. Under "Inline Suggest:Enable", select or deselect the checkbox to enable or disable inline suggestions.
## Enabling or disabling {% data variables.product.prodname_copilot %} for specific languages
You can specify which languages you want to enable or disable {% data variables.product.prodname_copilot %} for.
1. From the {% data variables.product.prodname_vscode %}, click the **Extensions** tab, then navigate to the **Copilot** section. For more information, see "[Enabling and disabling inline suggestions](#enabling-and-disabling-inline-suggestions)."
1. Under "Enable or disable Copilot for specified languages", click **Edit in settings.json**.
1. In the _settings.json_ file, add or remove the languages you want to enable or disable {% data variables.product.prodname_copilot %} for. For example, to enable Python in {% data variables.product.prodname_copilot %}, add `"python": true` to the list, ensuring there is a trailing comma after all but the last list item.
```json
{
"editor.inlineSuggest.enabled": true,
"github.copilot.enable": {
"*": true,
"yaml": false,
"plaintext": false,
"markdown": true,
"javascript": true,
"python": true
}
}
```
{% data reusables.copilot.dotcom-settings %}

View File

@@ -0,0 +1,55 @@
---
title: Configuring GitHub Copilot in Visual Studio
intro: 'You can enable, configure, and disable {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_vs %}.'
product: '{% data reusables.gated-features.copilot %}'
versions:
feature: 'copilot'
shortTitle: Visual Studio
topics:
- Copilot
---
## About {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_vs %}
If you use {% data variables.product.prodname_vs %}, {% data variables.product.prodname_copilot %} can autocomplete code as you type. After installation, you can enable or disable {% data variables.product.prodname_copilot %}, and you can configure advanced settings within {% data variables.product.prodname_vs %} or on {% data variables.product.prodname_dotcom_the_website %}.
## Prerequisites
To configure {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_vs %}, you must install the {% data variables.product.prodname_copilot %} plugin. For more information, see "[Getting started with {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_vs %}](/copilot/getting-started-with-github-copilot/getting-started-with-github-copilot-in-visual-studio)."
## Keyboard shortcuts for {% data variables.product.prodname_copilot %}
You can use the default keyboard shortcuts in {% data variables.product.prodname_vs %} when using {% data variables.product.prodname_copilot %}. Alternatively, you can rebind the shortcuts in the Tools settings for {% data variables.product.prodname_vs %} using your preferred keyboard shortcuts for each specific command. You can search for each keyboard shortcut by its command name in the Keyboard Shortcuts editor.
| Action | Shortcut | Command name |
|:---|:---|:---|
|Show next inline suggestion|<kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>]</kbd>|Tools.Nextsuggestion|
|Show previous inline suggestion|<kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>[</kbd>|Tools.Previoussuggestion|
|Trigger inline suggestion|<kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>\</kbd>|Edit.Copilot.TriggerInlineSuggestion|
## Rebinding keyboard shortcuts
If you don't want to use the default keyboard shortcuts in {% data variables.product.prodname_vs %} when using {% data variables.product.prodname_copilot %}, you can rebind the shortcuts in the Keyboard editor using your preferred keyboard shortcuts for each specific command.
1. In the {% data variables.product.prodname_vs %} toolbar, under **Tools**, click **Options**.
![Screenshot of the Options option in the {% data variables.product.prodname_vs %} toolbar](/assets/images/help/copilot/vs-toolbar-options.png)
1. In the "Options" dialog, under **Environment**, click **Keyboard**.
![Screenshot of the Keyboard option in the "Options" dialog](/assets/images/help/copilot/vs-options-dialogue.png)
1. Under "Show commands containing:", search for the command you want to rebind.
![Screenshot of the show commands containing searchbar](/assets/images/help/copilot/vs-show-commands-containing.png)
1. Under "Press shortcut keys", type the shorcut you want to assign to the command, then click **Assign**.
![Screenshot of the keyboard shortcut assignment](/assets/images/help/copilot/vs-rebind-shortcut.png)
{% data reusables.copilot.enabling-or-disabling-vs %}
## Configuring ReSharper for {% data variables.product.prodname_copilot %}
If you use ReSharper, {% data variables.product.prodname_copilot %} may work best when you configure ReSharper to use {% data variables.product.prodname_copilot %}'s native IntelliSense. For more information about ReSharper, see the [ReSharper documentation](https://www.jetbrains.com/resharper/documentation/documentation.html)
1. In the {% data variables.product.prodname_vs %} toolbar, under **Tools**, click **Options**.
![Screenshot of the Options option in the {% data variables.product.prodname_vs %} toolbar](/assets/images/help/copilot/vs-toolbar-options.png)
1. In the "Options" dialog, under **Environment**, click **IntelliSense** and then click **General**.
![Screenshot of the IntelliSense option in the "Options" dialog](/assets/images/help/copilot/vs-options-intellisense.png)
1. Under "General" select **Visual Studio** and then click **Save**.
{% data reusables.copilot.dotcom-settings %}

View File

@@ -0,0 +1,15 @@
---
title: Configuring GitHub Copilot
shortTitle: Configure GitHub Copilot
intro: 'You can enable, configure, or disable {% data variables.product.prodname_copilot %} in a supported IDE.'
versions:
feature: copilot
topics:
- Copilot
children:
- /configuring-github-copilot-in-visual-studio-code
- /configuring-github-copilot-in-visual-studio
- /configuring-github-copilot-in-a-jetbrains-ide
- /configuring-github-copilot-in-neovim
---

View File

@@ -0,0 +1,111 @@
---
title: 在 JetBrains IDE 中开始使用 GitHub Copilot
shortTitle: JetBrains IDE
intro: '了解如何在 JetBrains IDE 中安装 {% data variables.product.prodname_copilot %},并在编写注释和代码时开始查看建议。'
product: '{% data reusables.gated-features.copilot %}'
versions:
feature: copilot
topics:
- Copilot
---
## 关于 {% data variables.product.prodname_copilot %} 和JetBrains IDE
{% data reusables.copilot.procedural-intro %}
如果使用 JetBrains IDE则可以直接在编辑器中查看和合并来自 {% data variables.product.prodname_copilot %} 的建议。 本指南演示如何在适用于 macOS、Windows 或 Linux 的 JetBrains IDE 中使用 {% data variables.product.prodname_copilot %}。
## 基本要求
{% data reusables.copilot.jetbrains-ides %}
## 安装 JetBrains 扩展
要在 JetBrains IDE 中使用 {% data variables.product.prodname_copilot %},必须安装 {% data variables.product.prodname_copilot %} 扩展。 以下过程将指导您在 IntelliJ IDEA 中安装 {% data variables.product.prodname_copilot %} 插件。 在其他受支持的 IDE 中安装插件的步骤可能有所不同。
1. 在 JetBrains IDE 中,在 **File文件**菜单下,单击 **Settings设置**
1. 在“Settings设置”对话框的顶部单击 **Marketplace**。 在搜索栏中,搜索 **{% data variables.product.prodname_copilot %}**,然后单击 **Install安装**。 ![Marketplace 搜索的屏幕截图](/assets/images/help/copilot/jetbrains-marketplace.png)
1. 安装 {% data variables.product.prodname_copilot %} 后,单击 **Restart IDE重新启动 IDE**
1. 重新启动 JetBrains IDE 后,单击 **Tools工具**菜单。 单击 **{% data variables.product.prodname_copilot %}**,然后单击**登录 {% data variables.product.prodname_dotcom %}**。 ![JetBrains 工具菜单的屏幕截图](/assets/images/help/copilot/jetbrains-tools-menu.png)
1. 在“登录 {% data variables.product.prodname_dotcom %}”对话框中,若要复制设备代码并打开设备激活窗口,请单击 **Copy and Open复制并打开**。 ![设备代码复制和打开的屏幕截图](/assets/images/help/copilot/device-code-copy-and-open.png)
1. 将在浏览器中打开一个设备激活窗口。 粘贴设备代码,然后单击 **Continue继续**
- 要将代码粘贴到 Windows 或 Linux 中,请按 <kbd>Ctrl</kbd>+<kbd>v</kbd>。
- 要将代码粘贴到 macOS 中,请按 <kbd>command</kbd>+<kbd>v</kbd>。
1. {% data variables.product.prodname_dotcom %} 将请求 {% data variables.product.prodname_copilot %} 的必要权限。 要批准这些权限,请单击**授权 {% data variables.product.prodname_copilot %} 插件**。
1. 权限获得批准后,您的 JetBrains IDE 将显示确认。 要开始使用 {% data variables.product.prodname_copilot %},请单击 **OK确定**。 ![JetBrains IDE 权限确认的屏幕截图](/assets/images/help/copilot/jetbrains-ide-confirmation.png)
## 看到您的第一个建议
{% data reusables.copilot.supported-languages %} 以下示例使用 Java但其他语言的工作方式类似。
{% data reusables.copilot.create-java-file %}
1. 在 Java 文件中,键入 `class Test` 来创建类。
{% data variables.product.prodname_copilot %} 将自动以灰色文本建议类正文,如下所示。 确切的建议可能会有所不同。
![Java 类正文建议的屏幕截图](/assets/images/help/copilot/java-class-body-suggestion-jetbrains.png)
{% data reusables.copilot.accept-suggestion %}
1. 若要提示 {% data variables.product.prodname_copilot %} 建议函数体,请在 `main` 函数的括号下方键入以下行。 确切的建议可能会有所不同。
{% indented_data_reference reusables.copilot.java-int-snippet spaces=3 %}
![Java 函数体建议的屏幕截图](/assets/images/help/copilot/java-function-body-suggestion-jetbrains.png)
{% data reusables.copilot.accept-suggestion %}
{% data variables.product.prodname_copilot %} 将尝试匹配代码的上下文和样式。 您始终可以编辑建议的代码。
## 查看替代建议
{% data reusables.copilot.alternative-suggestions %}
{% data reusables.copilot.create-java-file %}
1. 要提示 {% data variables.product.prodname_copilot %} 向您显示建议,请在 Java 文件中键入以下行。
{% indented_data_reference reusables.copilot.java-int-snippet spaces=3 %}
{% data reusables.copilot.see-alternative-suggestions %}
| 操作系统 | 查看下一个建议 | 查看以前的建议 |
|:------- |:------------------------------ |:------------------------------ |
| macOS | <kbd>Option</kbd>+<kbd>]</kbd> | <kbd>Option</kbd>+<kbd>[</kbd> |
| Windows | <kbd>Alt</kbd>+<kbd>]</kbd> | <kbd>Alt</kbd>+<kbd>[</kbd> |
| Linux | <kbd>Alt</kbd>+<kbd>]</kbd> | <kbd>Alt</kbd>+<kbd>[</kbd> |
{% data reusables.copilot.accept-or-reject-suggestion %}
## 在新选项卡中查看多个建议
{% data reusables.copilot.suggestions-new-tab %}
{% data reusables.copilot.create-java-file %}
1. 要提示 {% data variables.product.prodname_copilot %} 向您显示建议,请在 Java 文件中键入以下行。
{% indented_data_reference reusables.copilot.java-int-snippet spaces=3 %}
1. 打开包含多个其他建议的新选项卡。
- 在 macOS 上,按 <kbd>Command</kbd>+<kbd>Shift</kbd>+<kbd>A</kbd>,然后单击 **Open GitHub Copilot打开 GitHub Copilot**,或按 <kbd>Command</kbd>+<kbd>Shift</kbd>+<kbd>\</kbd> 立即打开新选项卡。
- 在 Windows 或 Linux 上,按 <kbd>Ctrl</kbd>+<kbd>Enter</kbd>,然后按 **Open GitHub Copilot打开 GitHub Copilot**。 ![打开 Copilot 的对话屏幕截图](/assets/images/help/copilot/open-copilot-tab-jetbrains.png)
1. 若要接受建议,请在建议上方单击 **Accept Solution接受解决方案**。 若要拒绝所有建议,请关闭该选项卡。
## 从注释生成代码建议
{% data reusables.copilot.generating-suggestions-from-comments %}
{% data reusables.copilot.create-java-file %}
1. 要提示 {% data variables.product.prodname_copilot %} 建议 Java 文件中函数的实现,请键入以下行。
```java{:copy}
// find all images without alternate text
// and give them a red border
void process () {
```
![Java 函数体建议的屏幕截图](/assets/images/help/copilot/comment-suggestion-jetbrains.png)
## 启用和禁用 {% data variables.product.prodname_copilot %}
您可以为所有语言或单个语言启用或禁用 {% data variables.product.prodname_copilot %}。 JetBrains IDE 窗口底部面板中的 {% data variables.product.prodname_copilot %} 状态图标指示是启用还是禁用 {% data variables.product.prodname_copilot %}。 启用后,该图标将突出显示。 禁用后,图标将灰显。
1. 要启用或禁用 {% data variables.product.prodname_copilot %},请单击 JetBrains 窗口底部面板中的状态图标。 ![IntelliJ IDEA 中状态图标的屏幕截图](/assets/images/help/copilot/status-icon-jetbrains.png)
2. 如果要禁用 {% data variables.product.prodname_copilot %},系统将询问您是要全局禁用它,还是要禁用当前正在编辑的文件的语言。
- 要禁用来自全局 {% data variables.product.prodname_copilot %} 的建议,请单击 **Disable Completions禁用完成**
- 要禁用来自指定语言的 {% data variables.product.prodname_copilot %} 的建议,请单击 **Disable Completions for _LANGUAGE_禁用[语言]的完成)**。 ![全局禁用 {% data variables.product.prodname_copilot %} 或当前语言禁用选项的屏幕截图](/assets/images/help/copilot/disable-copilot-global-or-langugage-jetbrains.png)
## 延伸阅读
- [{% data variables.product.prodname_copilot %} 网站](https://copilot.github.com/)
- [{% data variables.product.prodname_copilot %} JetBrains 插件的许可信息](/copilot/overview-of-github-copilot/about-github-copilot#github-copilot-licensing-information-for-jetbrains-plugin)

View File

@@ -0,0 +1,83 @@
---
title: Getting started with GitHub Copilot in Neovim
shortTitle: Neovim
product: '{% data reusables.gated-features.copilot %}'
intro: 'Learn how to install {% data variables.product.prodname_copilot %} in Neovim, and start seeing suggestions as you write comments and code.'
versions:
feature: copilot
topics:
- Copilot
---
## About {% data variables.product.prodname_copilot %} and Neovim
{% data reusables.copilot.procedural-intro %}
If you use a Neovim, you can view and incorporate suggestions from {% data variables.product.prodname_copilot %} directly within the editor.
## 基本要求
To use {% data variables.product.prodname_copilot %} in Neovim you must have Neovim and Node.js version 17 or below installed. For more information, see the [Neovim documentation](https://neovim.io/doc/) and the [Node.js website](https://nodejs.org/en/).
## Installing the Neovim extension
{% mac %}
{% data reusables.copilot.install-copilot-in-neovim %}
- To install the {% data variables.product.prodname_copilot %} plugin directly, you must know where Neovim stores plugins. To install the plugin, enter the following command in Terminal.
```
git clone https://github.com/github/copilot.vim \
PATH/TO/NEOVIM/PLUGINS/copilot.vim
```
1. To configure {% data variables.product.prodname_copilot %}, open Neovim and enter the following command.
```
:Copilot setup
```
{% endmac %}
{% windows %}
{% data reusables.copilot.install-copilot-in-neovim %}
- To install the {% data variables.product.prodname_copilot %} plugin directly, you must know where Neovim stores plugins. To install the plugin, enter the following command in Git Bash.
```
git clone https://github.com/github/copilot.vim \
~/.config/PATH/TO/YOUR/NEOVIM/CONFIG/FILE/copilot.vim
1. To configure {% data variables.product.prodname_copilot %}, open Neovim and enter the following command.
```
:Copilot setup
```
{% endwindows %}
{% linux %}
{% data reusables.copilot.install-copilot-in-neovim %}
- To install the {% data variables.product.prodname_copilot %} plugin directly, you must know where Neovim stores plugins. To install the plugin, enter the following command in Git Bash.
```
git clone https://github.com/github/copilot.vim \
~/.config/PATH/TO/YOUR/NEOVIM/CONFIG/FILE/copilot.vim
```
1. To configure {% data variables.product.prodname_copilot %}, open Neovim and enter the following command.
```
:Copilot setup
```
{% endlinux %}
## Learning to use {% data variables.product.prodname_copilot %} in Neovim
For guidance on using {% data variables.product.prodname_copilot %} in Neovim, you can view the plugin documentation. To see the documentation, open Neovim and run the following command.
```
:help copilot ```
## 延伸阅读
- [{% data variables.product.prodname_copilot %}](https://copilot.github.com/)

View File

@@ -0,0 +1,109 @@
---
title: Getting started with GitHub Copilot in Visual Studio Code
shortTitle: Visual Studio Code
intro: 'Learn how to install {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_vscode %}, and start seeing suggestions as you write comments and code.'
product: '{% data reusables.gated-features.copilot %}'
versions:
feature: copilot
topics:
- Copilot
---
## 关于 {% data variables.product.prodname_copilot %} 与 {% data variables.product.prodname_vscode %}
{% data reusables.copilot.procedural-intro %}
If you use {% data variables.product.prodname_vscode %}, you can view and incorporate suggestions from {% data variables.product.prodname_copilot %} directly within the editor. This guide demonstrates how to use {% data variables.product.prodname_copilot %} within {% data variables.product.prodname_vscode %} for macOS, Windows, or Linux.
## 基本要求
To use {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_vscode %}, you must have {% data variables.product.prodname_vscode %} installed. For more information, see the [{% data variables.product.prodname_vscode %} download page](https://code.visualstudio.com/Download).
## Installing the {% data variables.product.prodname_vscode %} extension
To use {% data variables.product.prodname_copilot %}, you must first install the {% data variables.product.prodname_vscode %} extension.
1. In the {% data variables.product.prodname_vscode %} Marketplace, go to the [{% data variables.product.prodname_copilot %} extension](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot) page and click **Install**. ![Install {% data variables.product.prodname_copilot %} extension {% data variables.product.prodname_vscode %}](/assets/images/help/copilot/install-copilot-extension-visual-studio-code.png)
1. A popup will appear, asking to open {% data variables.product.prodname_vscode %}. Click **Open {% data variables.product.prodname_vscode %}**.
1. In the "Extension: {% data variables.product.prodname_copilot %}" tab in {% data variables.product.prodname_vscode %}, click **Install**. ![Install button in {% data variables.product.prodname_vscode %}](/assets/images/help/copilot/in-visual-studio-code-install-button.png)
1. If you have not previously authorized {% data variables.product.prodname_vscode %} in your {% data variables.product.prodname_dotcom %} account, you will be prompted to sign in to {% data variables.product.prodname_dotcom %} in {% data variables.product.prodname_vscode %}.
- If you have previously authorized {% data variables.product.prodname_vscode %} for your account on {% data variables.product.prodname_dotcom %}, {% data variables.product.prodname_copilot %} will be automatically authorized. ![Screen shot of {% data variables.product.prodname_vscode %} authorization screen](/assets/images/help/copilot/vsc-copilot-authorize.png)
1. In your browser, {% data variables.product.prodname_dotcom %} will request the necessary permissions for {% data variables.product.prodname_copilot %}. To approve these permissions, click **Authorize {% data variables.product.prodname_vscode %}**.
1. In {% data variables.product.prodname_vscode %}, in the "{% data variables.product.prodname_vscode %}" dialog box, to confirm the authentication, click **Open**.
## 看到您的第一个建议
{% data reusables.copilot.supported-languages %} The following samples are in JavaScript, but other languages will work similarly.
{% data reusables.copilot.create-js-file %}
1. In the JavaScript file, type the following function header. {% data variables.product.prodname_copilot %} 将自动以灰色文本建议整个函数体,如下所示。 确切的建议可能会有所不同。
```javascript{:copy}
function calculateDaysBetweenDates(begin, end) {
```
![Screenshot of a first suggestion {% data variables.product.prodname_vscode %}](/assets/images/help/copilot/first-suggestion-visual-studio-code.png)
{% data reusables.copilot.accept-suggestion %}
## 查看替代建议
{% data reusables.copilot.alternative-suggestions %}
{% data reusables.copilot.create-js-file %}
1. In the JavaScript file, type the following function header. {% data variables.product.prodname_copilot %} 会给你一个建议。
```javascript{:copy}
function calculateDaysBetweenDates(begin, end) {
```
{% data reusables.copilot.see-alternative-suggestions %}
| 操作系统 | 查看下一个建议 | 查看以前的建议 |
|:------- |:----------------------------------------- |:----------------------------------------- |
| macOS | <kbd>Option (⌥) or Alt</kbd>+<kbd>]</kbd> | <kbd>Option (⌥) or Alt</kbd>+<kbd>[</kbd> |
| Windows | <kbd>Alt</kbd>+<kbd>]</kbd> | <kbd>Alt</kbd>+<kbd>[</kbd> |
| Linux | <kbd>Alt</kbd>+<kbd>]</kbd> | <kbd>Alt</kbd>+<kbd>[</kbd> |
1. Alternatively, you can hover over the suggestion to see the {% data variables.product.prodname_copilot %} command palette for choosing suggestions.
{% data reusables.copilot.accept-or-reject-suggestion %}
## 在新选项卡中查看多个建议
{% data reusables.copilot.suggestions-new-tab %}
{% data reusables.copilot.create-js-file %}
1. In the JavaScript file, type the following function header. {% data variables.product.prodname_copilot %} 会给你一个建议。
```javascript{:copy}
function calculateDaysBetweenDates(begin, end) {
```
1. 要打开包含多个其他选项的新选项卡,请按 <kbd>Ctrl</kbd>+<kbd>Enter</kbd>。
1. 若要接受建议,请在建议上方单击 **Accept Solution接受解决方案**。 若要拒绝所有建议,请关闭该选项卡。
## 从注释生成代码建议
{% data reusables.copilot.generating-suggestions-from-comments %}
{% data reusables.copilot.create-js-file %}
1. 在 JavaScript 文件中,键入以下注释。 {% data variables.product.prodname_copilot %} 将建议该函数的实现。
```javascript{:copy}
// find all images without alternate text
// and give them a red border
function process() {
```
## 使用框架
您还可以使用 {% data variables.product.prodname_copilot %} 来生成 API 和框架的建议。 The following example uses {% data variables.product.prodname_copilot %} to create a simple Express server that returns the current time.
{% data reusables.copilot.create-js-file %}
1. In the JavaScript file, type the following comment and then press <kbd>Enter</kbd>. {% data variables.product.prodname_copilot %} will suggest an implementation of the Express app.
```javascript{:copy}
// Express server on port 3000
1. To accept each line, press <kbd>Tab</kbd>, then <kbd>Enter</kbd>.
1. Type the following comment and then press <kbd>Enter</kbd>. {% data variables.product.prodname_copilot %} will suggest an implementation for the default handler.
```javascript{:copy}
// Return the current time
```
1. To accept each line, press <kbd>Tab</kbd>.
{% data reusables.copilot.enabling-or-disabling-in-vsc %}
## 延伸阅读
- [{% data variables.product.prodname_copilot %}](https://copilot.github.com/)

View File

@@ -0,0 +1,92 @@
---
title: Getting started with GitHub Copilot in Visual Studio
shortTitle: Visual Studio
product: '{% data reusables.gated-features.copilot %}'
intro: 'Learn how to install {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_vs %}, and start seeing suggestions as you write comments and code.'
versions:
feature: 'copilot'
topics:
- Copilot
---
## About {% data variables.product.prodname_copilot %} and Visual Studio
{% data reusables.copilot.procedural-intro %}
If you use {% data variables.product.prodname_vs %}, you can view and incorporate suggestions from {% data variables.product.prodname_copilot %} directly within the editor. This guide demonstrates how to use {% data variables.product.prodname_copilot %} within {% data variables.product.prodname_vs %} for Windows.
## Prerequisites
To use {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_vs %}, you must have {% data variables.product.prodname_vs %} 2022 17.2 or later installed. For more information, see the [Visual Studio IDE](https://visualstudio.microsoft.com/vs/) documentation.
{% note %}
**Note**: {% data variables.product.prodname_copilot %} is not currently available for use with Visual Studio for Mac.
{% endnote %}
## Installing the {% data variables.product.prodname_vs %} extension
To use {% data variables.product.prodname_copilot %}, you must first install the {% data variables.product.prodname_vs %} extension.
1. In the Visual Studio toolbar, click **Extensions**, then click **Manage Extensions**.
![Screenshot of the Visual Studio toolbar](/assets/images/help/copilot/visual-studio-toolbar.png)
1. In the "Manage Extensions" window, click **Visual Studio Marketplace**, search for the {% data variables.product.prodname_copilot %} extension, then click **Download**.
![Screenshot of GitHub Copilot extension for Visual Studio with the download button emphasized](/assets/images/help/copilot/install-copilot-extension-visual-studio.png)
1. Close the "Manage Extensions" window, then exit and relaunch {% data variables.product.prodname_vs %}.
1. Optionally, to check that {% data variables.product.prodname_copilot %} is installed and enabled, go back to **Manage Extensions**, click **Installed** to view your currently installed extensions, then click **{% data variables.product.prodname_copilot %}** to see status information.
![Screenshot of installed extensions in Visual Studio with GitHub Copilot emphasized](/assets/images/help/copilot/installed-copilot-extension-visual-studio.png)
1. Open or create a new project in {% data variables.product.prodname_vs %}.
1. In the "Microsoft {% data variables.product.prodname_vs %}" dialog box, to copy your device activation code, click **OK**.
![Screenshot of the Microsoft {% data variables.product.prodname_vs %} dialogue box](/assets/images/help/copilot/vs-auth-dialogue.png)
1. A device activation window will open in your browser. Paste the device code, then click **Continue**.
- To paste the code in Windows or Linux, press <kbd>Ctrl</kbd>+<kbd>v</kbd>.
- To paste the code in macOS, press <kbd>command</kbd>+<kbd>v</kbd>.
1. {% data variables.product.prodname_dotcom %} will request the necessary permissions for {% data variables.product.prodname_copilot %}. To approve these permissions, click **Authorize {% data variables.product.prodname_copilot %} Plugin**.
1. After you approve the permissions, {% data variables.product.prodname_vs %} will show a confirmation.
![Screenshot of {% data variables.product.prodname_vs %} permissions confirmation](/assets/images/help/copilot/vs-confirmation.png)
## Seeing your first suggestion
{% data reusables.copilot.supported-languages %} The following samples are in C#, but other languages will work similarly.
{% data reusables.copilot.create-c-file %}
1. In the C# file, type the following function header. {% data variables.product.prodname_copilot %} will automatically suggest an entire function body in grayed text, as shown below. The exact suggestion may vary.
```csharp{:copy}
function calculateDaysBetweenDates(begin, end) {
```
![Screenshot of a first suggestion Visual Studio Code](/assets/images/help/copilot/first-suggestion-visual-studio.png)
{% data reusables.copilot.accept-suggestion %}
## Seeing alternative suggestions
{% data reusables.copilot.alternative-suggestions %}
{% data reusables.copilot.create-c-file %}
1. In the C# file, type the following function header. {% data variables.product.prodname_copilot %} will show you a suggestion.
```csharp{:copy}
function calculateDaysBetweenDates(begin, end) {
```
1. If alternative suggestions are available, you can see these alternatives by pressing <kbd>Alt</kbd>+<kbd>]</kbd> (or <kbd>Alt</kbd>+<kbd>[</kbd>).
1. Optionally, you can hover over the suggestion to see the {% data variables.product.prodname_copilot %} command palette for choosing suggestions.
{% data reusables.copilot.accept-or-reject-suggestion %}
## Generating code suggestions from comments
{% data reusables.copilot.generating-suggestions-from-comments %}
{% data reusables.copilot.create-c-file %}
1. In the C# file, type the following comment. {% data variables.product.prodname_copilot %} will suggest an implementation of the function.
```csharp{:copy}
using System.Xml.Linq;
var doc = XDocument.Load("index.xhml");
// find all images
```
{% data reusables.copilot.accept-suggestion %}
{% data reusables.copilot.enabling-or-disabling-vs %}
## Further reading
- [{% data variables.product.prodname_copilot %}](https://copilot.github.com/)

View File

@@ -0,0 +1,15 @@
---
title: Getting started with GitHub Copilot
shortTitle: Get started with GitHub Copilot
intro: 'You can start using {% data variables.product.prodname_copilot %} by installing the extension in your preferred environment.'
versions:
feature: copilot
topics:
- Copilot
children:
- /getting-started-with-github-copilot-in-visual-studio-code
- /getting-started-with-github-copilot-in-visual-studio
- /getting-started-with-github-copilot-in-a-jetbrains-ide
- /getting-started-with-github-copilot-in-neovim
---

View File

@@ -0,0 +1,34 @@
---
title: GitHub Copilot
shortTitle: GitHub Copilot
intro: 'You can use {% data variables.product.prodname_copilot %} to get autocomplete-style suggestions from an AI pair programmer as you code.'
redirect_from:
- /github/copilot
changelog:
label: copilot
introLinks:
overview: /copilot/overview-of-github-copilot/about-github-copilot
quickstart: /copilot/quickstart
featuredLinks:
guides:
- /copilot/getting-started-with-github-copilot/getting-started-with-github-copilot-in-visual-studio-code
- /copilot/getting-started-with-github-copilot/getting-started-with-github-copilot-in-a-jetbrains-ide
- /copilot/getting-started-with-github-copilot/getting-started-with-github-copilot-in-visual-studio
- /copilot/getting-started-with-github-copilot/getting-started-with-github-copilot-in-neovim
popular:
- /billing/managing-billing-for-github-copilot/about-billing-for-github-copilot
- /copilot/configuring-github-copilot/configuring-github-copilot-in-visual-studio-code
- /copilot/configuring-github-copilot/configuring-github-copilot-in-a-jetbrains-ide
- /copilot/configuring-github-copilot/configuring-github-copilot-in-visual-studio
layout: product-landing
versions:
feature: copilot
children:
- /quickstart
- /overview-of-github-copilot
- /getting-started-with-github-copilot
- /configuring-github-copilot
topics:
- Copilot
---

View File

@@ -0,0 +1,39 @@
---
title: 关于 GitHub Copilot
intro: '{% data variables.product.prodname_copilot %} 可以通过提供自动完成样式的建议来帮助您编写代码。 您可以了解使用 {% data variables.product.prodname_copilot %} 时要考虑的事项,以及 {% data variables.product.prodname_copilot %} 的工作原理。'
versions:
feature: copilot
topics:
- Copilot
shortTitle: 关于 GitHub Copilot
---
## 关于 {% data variables.product.prodname_copilot %}
{% data variables.product.prodname_copilot %} 是一个 AI 对编程工具,可在您编写代码时提供自动完成样式的建议。 您可以通过开始编写要使用的代码,或编写描述您希望代码执行的操作的自然语言注释,以接收来自 {% data variables.product.prodname_copilot %} 的建议。 {% data variables.product.prodname_copilot %} 分析您正在编辑的文件中的上下文以及相关文件,并从文本编辑器中提供建议。
{% data variables.product.prodname_copilot %} 经过优化,可帮助您编写 Python、JavaScript、TypeScript、Ruby、Go、C# 或 C++。 您还可以使用 {% data variables.product.prodname_copilot %} 以其他语言和各种框架生成建议。 {% data variables.product.prodname_copilot %} 由 OpenAI Codex 提供支持OpenAI Codex 是由 OpenAI 创建的新 AI 系统。
{% data variables.product.prodname_copilot %} 可作为 IDE 的 Visual Studio Code、Visual Studio、Neovim 和 JetBrains 套件的扩展。 更多信息请参阅“[开始使用 {% data variables.product.prodname_copilot %}](/copilot/getting-started-with-github-copilot)”。
## 使用 {% data variables.product.prodname_copilot %}
您可以看到实际 {% data variables.product.prodname_copilot %} 运作的示例。 更多信息请参阅 [{% data variables.product.prodname_copilot %}](https://copilot.github.com/) 网站。
GitHub Copilot 从 OpenAI 构建自数十亿行开源代码的模型提供建议。 因此,{% data variables.product.prodname_copilot %} 的训练集可能包含不安全的编码模式、错误或对过时 API 或习语的引用。 当 {% data variables.product.prodname_copilot %} 基于此训练数据生成建议时,这些建议也可能包含不需要的模式。
您有责任确保代码的安全性和质量。 我们建议您在使用由 {% data variables.product.prodname_copilot %} 生成的代码时采取与使用您自己未编写的任何代码时相同的预防措施。 这些预防措施包括严格的测试、IP 扫描和安全漏洞跟踪。 {% data variables.product.company_short %} 提供了许多功能来帮助您监控和提高代码质量,例如 {% data variables.product.prodname_actions %}、{% data variables.product.prodname_dependabot %}、{% data variables.product.prodname_codeql %} 和 {% data variables.product.prodname_code_scanning %}。 所有这些功能都可以在公共存储库中免费使用。 更多信息请参阅“[了解 {% data variables.product.prodname_actions %}](/actions/learn-github-actions/understanding-github-actions)”和“[{% data variables.product.company_short %} 安全功能](/code-security/getting-started/github-security-features)”。
{% data variables.product.prodname_copilot %} 使用过滤器来阻止提示中的冒犯性单词,并避免在敏感上下文中生成建议。 我们致力于不断改进过滤系统,以更智能地检测和删除由 {% data variables.product.prodname_copilot %} 产生的令人反感的建议,包括有偏见、歧视性或滥用性的输出。 如果您看到 {% data variables.product.prodname_copilot %} 生成的攻击性建议,请直接向 copilot-safety@github.com 报告该建议,以便我们改进保护措施。
## 关于 {% data variables.product.prodname_copilot %} 的计费
{% data variables.product.prodname_copilot %} 是一项付费功能,需要按月或按年订阅。 {% data variables.product.prodname_dotcom %} 上经过验证的常用开源项目的学生和维护者有资格免费使用 {% data variables.product.prodname_copilot %}。 如果您符合免费 {% data variables.product.prodname_copilot %} 订阅的条件,则当您访问 {% data variables.product.prodname_copilot %} 订阅页面时,系统会自动通知您。 如果您不符合免费 {% data variables.product.prodname_copilot %} 订阅的条件,您将获得 60 天免费试用,之后需要付费订阅才能继续使用。 更多信息请参阅“[关于 {% data variables.product.prodname_copilot %} 的计费](/billing/managing-billing-for-github-copilot/about-billing-for-github-copilot)”。
## {% data variables.product.prodname_copilot %} JetBrains 插件的许可信息
{% data variables.product.prodname_dotcom %}, Inc. 是 JetBrains 插件的许可方。 此插件的最终用户许可协议是[{% data variables.product.prodname_dotcom %} 附加产品和功能条款](/free-pro-team@latest/site-policy/github-terms/github-terms-for-additional-products-and-features#github-copilot),使用此插件受这些条款的约束。 JetBrains 对插件或此类协议不承担任何责任或义务。 使用插件即表示您同意上述条款。
## 延伸阅读
- “[{% data variables.product.company_short %} 附加产品和功能条款](/free-pro-team@latest/site-policy/github-terms/github-terms-for-additional-products-and-features#github-copilot)”

View File

@@ -0,0 +1,12 @@
---
title: Overview of GitHub Copilot
shortTitle: Overview of GitHub Copilot
intro: 'Learn about {% data variables.product.prodname_copilot %}, including use cases and terms that govern {% data variables.product.prodname_copilot %} data.'
versions:
feature: copilot
topics:
- Copilot
children:
- /about-github-copilot
---

View File

@@ -0,0 +1,62 @@
---
title: Quickstart for GitHub Copilot
intro: '{% data variables.product.prodname_copilot %} can help you work, by offering inline suggestions as you code.'
product: '{% data reusables.gated-features.copilot %}'
allowTitleToDifferFromFilename: true
versions:
feature: copilot
shortTitle: 快速入门
topics:
- Copilot
---
## 简介
{% data variables.product.prodname_copilot %} is an AI pair programmer. You can use {% data variables.product.prodname_copilot %} to get suggestions for whole lines or entire functions right inside your editor.
This guide will show you how to sign up for {% data variables.product.prodname_copilot %}, install the {% data variables.product.prodname_copilot %} extension in {% data variables.product.prodname_vscode %}, and get your first suggestion. For more information on {% data variables.product.prodname_copilot %}, see "[About {% data variables.product.prodname_copilot %}](/copilot/overview-of-github-copilot/about-github-copilot)." For more in-depth information on how to use {% data variables.product.prodname_copilot %} in a variety of environments, see "[Getting Started](/copilot/getting-started-with-github-copilot)."
## 基本要求
{% data reusables.copilot.copilot-prerequisites %}
- To use {% data variables.product.prodname_copilot %} in {% data variables.product.prodname_vscode %}, you must have {% data variables.product.prodname_vscode %} installed. For more information, see the [{% data variables.product.prodname_vscode %}](https://code.visualstudio.com/) documentation.
## 注册 {% data variables.product.prodname_copilot %}
{% data reusables.copilot.signup-procedure %}
## Installing the {% data variables.product.prodname_copilot %} extension for {% data variables.product.prodname_vscode %}
To use {% data variables.product.prodname_copilot %}, you must first install the {% data variables.product.prodname_vscode %} extension.
1. In the {% data variables.product.prodname_vscode %} Marketplace, go to the [{% data variables.product.prodname_copilot %} extension](https://marketplace.visualstudio.com/items?itemName=GitHub.copilot) page and click **Install**. ![Install {% data variables.product.prodname_copilot %} extension {% data variables.product.prodname_vscode %}](/assets/images/help/copilot/install-copilot-extension-visual-studio-code.png)
1. A popup will appear, asking to open {% data variables.product.prodname_vscode %}. Click **Open {% data variables.product.prodname_vscode %}**.
1. In the "Extension: {% data variables.product.prodname_copilot %}" tab in {% data variables.product.prodname_vscode %}, click **Install**. ![Install button in {% data variables.product.prodname_vscode %}](/assets/images/help/copilot/in-visual-studio-code-install-button.png)
1. If you have not previously authorized {% data variables.product.prodname_vscode %} in your {% data variables.product.prodname_dotcom %} account, you will be prompted to sign in to {% data variables.product.prodname_dotcom %} in {% data variables.product.prodname_vscode %}.
- If you have previously authorized {% data variables.product.prodname_vscode %} in your {% data variables.product.prodname_dotcom %} account, {% data variables.product.prodname_copilot %} will be automatically authorized. ![Screen shot of {% data variables.product.prodname_vscode %} authorization screen](/assets/images/help/copilot/vsc-copilot-authorize.png)
1. In your browser, {% data variables.product.prodname_dotcom %} will request the necessary permissions for {% data variables.product.prodname_copilot %}. To approve these permissions, click **Authorize {% data variables.product.prodname_vscode %}**.
1. In {% data variables.product.prodname_vscode %}, in the "{% data variables.product.prodname_vscode %}" dialogue box, to confirm the authentication, click **Open**.
## Getting your first suggestion
{% data reusables.copilot.supported-languages %} The following samples are in JavaScript, but other languages will work similarly.
1. Open {% data variables.product.prodname_vscode %}.
{% data reusables.copilot.create-js-file %}
{% data reusables.copilot.type-function-header %}
{% data variables.product.prodname_copilot %} 将自动以灰色文本建议整个函数体,如下所示。 确切的建议可能会有所不同。
![First suggestion {% data variables.product.prodname_vscode %}](/assets/images/help/copilot/first-suggestion-visual-studio-code.png)
{% data reusables.copilot.accept-suggestion %}
## 后续步骤
You successfully installed {% data variables.product.prodname_copilot %} and received your first suggestion, but that's just the beginning! 以下是一些帮助您对 {% data variables.product.prodname_copilot %} 执行后续操作的有用资源:
- [Getting Started](/copilot/getting-started-with-github-copilot): You've learned how to get your first suggestion in {% data variables.product.prodname_vscode %}. These guides show you how to set up and navigate the various functions of {% data variables.product.prodname_copilot %} across all of the supported environments.
- [{% data variables.product.prodname_copilot %}](https://copilot.github.com/): See practical examples of how {% data variables.product.prodname_copilot %} can help you work.
- [Configuring {% data variables.product.prodname_copilot %}](/copilot/configuring-github-copilot): These guides provide details on how to configure {% data variables.product.prodname_copilot %} to your personal preferences.
## 延伸阅读
- [关于 {% data variables.product.prodname_copilot %}](/copilot/overview-of-github-copilot/about-github-copilot)

View File

@@ -64,7 +64,9 @@ X-Accepted-OAuth-Scopes: user
| **`用户`** | 仅授予对个人资料的读取/写入权限。 请注意,此作用域包括 `user:email``user:follow`。 |
| &emsp;`read:user` | 授予读取用户个人资料数据的权限。 |
| &emsp;`user:email` | 授予对用户电子邮件地址的读取权限。 |
| &emsp;`user:follow` | 授予关注或取消关注其他用户的权限。 |
| &emsp;`user:follow` | 授予关注或取消关注其他用户的权限。{% ifversion projects-oauth-scope %}
| **`project`** | 授予对用户和组织项目(测试版)的读/写访问权限。 |
| &emsp;`read:project` | 授予对用户和组织项目(测试版)的只读访问权限。{% endif %}
| **`delete_repo`** | 授予删除可管理仓库的权限。 |
| **`write:discussion`** | 授予对团队讨论的读取和写入权限。 |
| &emsp;`read:discussion` | 允许对团队讨论进行读取访问。 |

View File

@@ -17,6 +17,12 @@ Setting {% data variables.product.prodname_codespaces %} as the preferred editor
For assignments with complex setup environments, teachers can customize the dev container configuration for a repository's codespaces. This ensures that when a student creates a codespace, it automatically opens with the development environment configured by the teacher. For more information on dev containers, see "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/introduction-to-dev-containers)."
{% note %}
**Note**: Individual codespaces are automatically deleted if they are stopped and left unused for a prolonged period. For more information, see "[Configuring automatic deletion of your codespaces](/codespaces/customizing-your-codespace/configuring-automatic-deletion-of-your-codespaces)."
{% endnote %}
## About the {% data variables.product.prodname_codespaces %} Education benefit for verified teachers
The {% data variables.product.prodname_codespaces %} Education benefit gives verified teachers a free monthly allowance of {% data variables.product.prodname_codespaces %} hours to use in {% data variables.product.prodname_classroom %}. The free allowance is estimated to be enough for a class of 50 with 5 assignments per month, on a 2 core machine with 1 codespace stored per student.

View File

@@ -47,6 +47,10 @@ In a wide browser window, the word "Enterprise" immediately follows the {% data
![Screenshot of address bar and {% data variables.product.prodname_ghe_server %} header in a browser](/assets/images/help/docs/header-ghes.png)
You can view the version of {% data variables.product.prodname_ghe_server %} that you're using in the footer of any page.
![Screenshot of the footer of {% data variables.product.prodname_ghe_server %}, with the version highlighted](/assets/images/help/docs/ghes-version-in-footer.png)
### {% data variables.product.prodname_ghe_managed %}
If you access {% data variables.product.prodname_dotcom %} at `https://*.githubenterprise.com`, `https://*.github.us`, or `https://*.ghe.com`, you're using {% data variables.product.prodname_ghe_managed %}.

View File

@@ -106,14 +106,14 @@ In addition to the features available with {% data variables.product.prodname_te
- {% data variables.contact.enterprise_support %}. For more information, see "<a href="/articles/github-enterprise-cloud-support" class="dotcom-only">{% data variables.product.prodname_ghe_cloud %} support</a>" and "<a href="/articles/github-enterprise-cloud-addendum" class="dotcom-only">{% data variables.product.prodname_ghe_cloud %} Addendum</a>."
- 50,000 {% data variables.product.prodname_actions %} minutes
- 50GB {% data variables.product.prodname_registry %} storage
- Access control for {% data variables.product.prodname_pages %} sites. For more information, see <a href="/pages/getting-started-with-github-pages/changing-the-visibility-of-your-github-pages-site" class="dotcom-only">Changing the visibility of your {% data variables.product.prodname_pages %} site</a>"
- Access control for {% data variables.product.prodname_pages %} sites. For more information, see "[Changing the visibility of your {% data variables.product.prodname_pages %} site](/enterprise-cloud@latest/pages/getting-started-with-github-pages/changing-the-visibility-of-your-github-pages-site)."
- A service level agreement for 99.9% monthly uptime
- The option to configure your enterprise for {% data variables.product.prodname_emus %}, so you can provision and manage members with your identity provider and restrict your member's contributions to just your enterprise. For more information, see "[About {% data variables.product.prodname_emus %}](/enterprise-cloud@latest/admin/authentication/managing-your-enterprise-users-with-your-identity-provider/about-enterprise-managed-users)."
- The option to centrally manage policy and billing for multiple {% data variables.product.prodname_dotcom_the_website %} organizations with an enterprise account. For more information, see "[About enterprise accounts](/enterprise-cloud@latest/admin/overview/about-enterprise-accounts)."
{% data variables.product.company_short %} bills for {% data variables.product.prodname_ghe_cloud %} on a per-user basis. For more information, see "[About per-user pricing]({% ifversion not ghec %}/enterprise-cloud@latest{% endif %}/billing/managing-billing-for-your-github-account/about-per-user-pricing){% ifversion ghec %}."{% else %}" in the {% data variables.product.prodname_ghe_cloud %} documentation.{% endif %}
You can set up a trial to evaluate {% data variables.product.prodname_ghe_cloud %}. For more information, see "<a href="/articles/setting-up-a-trial-of-github-enterprise-cloud" class="dotcom-only">Setting up a trial of {% data variables.product.prodname_ghe_cloud %}</a>."
You can set up a trial to evaluate {% data variables.product.prodname_ghe_cloud %}. For more information, see "[Setting up a trial of {% data variables.product.prodname_ghe_cloud %}](/enterprise-cloud@latest/articles/setting-up-a-trial-of-github-enterprise-cloud)."
For more information about hosting your own instance of {% data variables.product.prodname_ghe_server %}, including setting up a trial, see "[About {% data variables.product.prodname_ghe_server %}](/enterprise-server/admin/overview/about-github-enterprise-server)."

View File

@@ -22,7 +22,7 @@ topics:
{% ifversion fpt or ghec %}
您可以在 {% data variables.product.prodname_dotcom %} 仓库中存储各种项目,包括开源项目。 通过开源项目,您可以共享代码以开发更好、更可靠的软件。 您可以使用仓库与他人协作并跟踪您的工作。 更多信息请参阅“[关于仓库](/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-repositories)”。 要了解有关开源项目的更多信息,请访问 [OpenSource.org](http://opensource.org/about)。
您可以在 {% data variables.product.prodname_dotcom %} 仓库中存储各种项目,包括开源项目。 通过开源项目,您可以共享代码以开发更好、更可靠的软件。 您可以使用仓库与他人协作并跟踪您的工作。 更多信息请参阅“[关于仓库](/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-repositories)”。 要了解有关开源项目的更多信息,请访问 [OpenSource.org](https://opensource.org/about)。
{% elsif ghes or ghae %}

View File

@@ -33,7 +33,7 @@ Trials are also available for {% data variables.product.prodname_ghe_server %}.
## About trials of {% data variables.product.prodname_ghe_cloud %}
You can set up a 30-day trial to evaluate {% data variables.product.prodname_ghe_cloud %}. You do not need to provide a payment method during the trial unless you add {% data variables.product.prodname_marketplace %} apps to your organization that require a payment method. For more information, see "<a href="/articles/about-billing-for-github-marketplace/" class="dotcom-only">About billing for {% data variables.product.prodname_marketplace %}</a>."
You can set up a 30-day trial to evaluate {% data variables.product.prodname_ghe_cloud %}. You do not need to provide a payment method during the trial unless you add {% data variables.product.prodname_marketplace %} apps to your organization that require a payment method. For more information, see "[About billing for {% data variables.product.prodname_marketplace %}](/enterprise-cloud@latest/articles/about-billing-for-github-marketplace/)."
Your trial includes 50 seats. If you need more seats to evaluate {% data variables.product.prodname_ghe_cloud %}, contact {% data variables.contact.contact_enterprise_sales %}. At the end of the trial, you can choose a different number of seats.
@@ -45,7 +45,7 @@ For more information, see "[About identity and access management with SAML singl
## Setting up your trial of {% data variables.product.prodname_ghe_cloud %}
Before you can try {% data variables.product.prodname_ghe_cloud %}, you must be signed into a personal account. If you don't already have a personal account on {% data variables.product.prodname_dotcom_the_website %}, you must create one. For more information, see "<a href="/articles/signing-up-for-a-new-github-account" class="dotcom-only">Signing up for a new {% data variables.product.prodname_dotcom %} account</a>."
Before you can try {% data variables.product.prodname_ghe_cloud %}, you must be signed into a personal account. If you don't already have a personal account on {% data variables.product.prodname_dotcom_the_website %}, you must create one. For more information, see "[Signing up for a new {% data variables.product.prodname_dotcom %} account](/free-pro-team@latest/articles/signing-up-for-a-new-github-account)."
1. Navigate to [{% data variables.product.prodname_dotcom %} for enterprises](https://github.com/enterprise).
1. Click **Start a free trial**.

View File

@@ -32,19 +32,28 @@ $$\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \
![作为块渲染的数学表达式](/assets/images/help/writing/math-expression-as-a-block-rendering.png)
{% ifversion math-fenced-blocks %}
或者,可以使用 <code>\`\`\`math</code> 代码块语法将数学表达式显示为块。 使用此语法,无需使用 `$$` 分隔符。
````
**Here is some math!**
```math
\sqrt{3}
```
````
![围栏代码块中的数学表达式](/assets/images/help/writing/math-expression-as-a-fenced-code-block.png)
{% endif %}
## 联接数学表达式以及在数学表达式内编写美元符号
要将美元符号显示为与数学表达式相同的行中的字符,需要对非分隔符 `$` 进行转义,以确保该行正确呈现。
- 在数学表达式中,在显式 `$`之前添加 `\` 符号。
- 在数学表达式中,在显式 `$`之前添加 `\` 符号。
```
此表达式使用 `\$` 来显示美元符号:$\sqrt{\$4}$
```
![数学表达式中的美元符号](/assets/images/help/writing/dollar-sign-within-math-expression.png)
- 在数学表达式之外,但在同一行上,在显式 `$` 周围使用 span 标记。
![数学表达式中的美元符号](/assets/images/help/writing/dollar-sign-within-math-expression.png)
- 在数学表达式之外,但在同一行上,在显式 `$` 周围使用 span 标记。
```
要 <span>$</span>100 分成两半,我们计算 $100/2$

View File

@@ -1,28 +0,0 @@
---
title: 关于 GitHub Copilot 遥测
intro: '{% data variables.product.prodname_copilot %} 收集并依赖超出其他 {% data variables.product.company_short %} 产品和服务收集的额外遥测数据。'
redirect_from:
- /early-access/github/copilot/about-github-copilot-telemetry
versions:
fpt: '*'
---
## 哪些数据会被收集?
收集的数据在“[{% data variables.product.prodname_copilot %} 遥测术语](/github/copilot/github-copilot-telemetry-terms)”中进行了描述。 此外,{% data variables.product.prodname_copilot %} 扩展/插件从用户的集成开发环境 (IDE) 收集活动(绑定到时间戳)以及扩展/插件遥测包收集的元数据。 当与 {% data variables.product.prodname_vscode %}、IntelliJ、NeoVIM 或其他 IDE 一起使用时,{% data variables.product.prodname_copilot %} 会收集这些 IDE 提供的标准元数据。
## {% data variables.product.company_short %} 如何使用数据
{% data variables.product.company_short %} 会将这些数据用于:
- 直接改进产品,包括评估处理中的不同策略,并预测用户可能认为有用的建议
- 评估产品,例如通过衡量其对用户的积极影响
- 改进基础代码生成模型,例如通过提供正面和负面示例(但始终不会将您的私有代码用作输入来为 {% data variables.product.prodname_copilot %} 的其他用户建议代码)
- 引导密切相关的 {% data variables.product.company_short %} 产品
- 调查和发现可能滥用 {% data variables.product.prodname_copilot %} 服务的情况
- 与改进 {% data variables.product.prodname_copilot %} 服务相关的其他目的,包括下一节中所述的共享
## 如何共享数据
遥测数据安全地存储在 {% data variables.product.company_short %} 系统上,并进行了适当的加密。 我们知道用户编辑操作、源代码片段以及存储库和文件路径的 URL 都是敏感数据。 因此,访问受到严格控制。 数据访问仅限于 (1) {% data variables.product.company_short %} 团队或 {% data variables.product.prodname_copilot %} 平台健康团队中指定的 {% data variables.product.company_short %} 人员(员工和承包商),(2) 在 Azure 和/或 {% data variables.product.prodname_copilot %} 团队工作或与之合作的 Microsoft 人员(员工和承包商),以及 (3) 在 {% data variables.product.prodname_copilot %} 上工作的 OpenAI 员工。

View File

@@ -1,17 +0,0 @@
---
title: GitHub Copilot 遥测条款
intro: '接受下述附加遥测是加入 {% data variables.product.prodname_copilot %} 预览的等待列表并在技术预览期间使用 {% data variables.product.prodname_copilot %} 的条件。'
redirect_from:
- /early-access/github/copilot/telemetry-terms
- /github/copilot/telemetry-terms
versions:
fpt: '*'
effectiveDate: '2021-10-04'
---
## 附加遥测
如果使用 {% data variables.product.prodname_copilot %}{% data variables.product.prodname_copilot %} 扩展/插件将收集有关通过与集成开发环境 (IDE) 交互生成的事件的使用信息。 这些事件包括 {% data variables.product.prodname_copilot %} 性能、使用的功能以及接受、修改和接受或忽略的建议。 此信息可能包括 [GitHub 隐私声明](/github/site-policy/github-privacy-statement)中引用的个人数据,包括您的个人信息。
此使用信息供 {% data variables.product.company_short %} 使用,并与 Microsoft 及 OpenAI 共享,用于开发和改进扩展/插件及相关产品。 OpenAI 还使用此使用信息来执行与 {% data variables.product.prodname_copilot %} 相关的其他服务。 例如,当您在启用了 {% data variables.product.prodname_copilot %} 扩展/插件的情况下编辑文件时,文件内容片段、建议和对建议的任何修改将与 {% data variables.product.company_short %}、Microsoft 及 OpenAI 共享,并用于诊断目的以改进建议和相关产品。 {% data variables.product.prodname_copilot %} 依赖于文件内容的上下文,包括正在编辑的文件以及可能在同一 IDE 实例中打开的其他文件。 当您使用 {% data variables.product.prodname_copilot %} 时,它还可能收集存储库的 URL 或相关文件的文件路径。 {% data variables.product.prodname_copilot %} 不会将这些在遥测中收集的 URL、文件路径或代码段用作对 {% data variables.product.prodname_copilot %} 其他用户的建议。 此信息被视为机密信息,并在需要知道的基础上进行访问。 禁止从 {% data variables.product.prodname_copilot %} 扩展/插件收集有关 {% data variables.product.prodname_copilot %} 的其他用户的遥测数据。 有关 {% data variables.product.prodname_copilot %} 遥测的更多详细信息,请参阅“[关于 {% data variables.product.prodname_copilot %} 遥测](/github/copilot/about-github-copilot-telemetry)”。 您可以通过联系 GitHub 并请求从技术预览版中删除来撤销对本段所述遥测和个人数据处理操作的同意。

View File

@@ -1,10 +0,0 @@
---
title: GitHub Copilot
intro: '您可以使用 {% data variables.product.prodname_dotcom %} Copilot 帮助您在编辑器中的编程'
versions:
fpt: '*'
children:
- /about-github-copilot-telemetry
- /github-copilot-telemetry-terms
---

View File

@@ -1,17 +0,0 @@
---
title: GitHub
redirect_from:
- /articles
- /common-issues-and-questions
- /troubleshooting-common-issues
intro: 适用于软件开发者、设计师和项目经理的文档、指南和帮助主题。 涵盖 Git、拉取请求、问题、wiki、gist 和充分使用 GitHub 进行开发所需的一切。
versions:
fpt: '*'
ghec: '*'
ghes: '*'
ghae: '*'
children:
- /copilot
- /site-policy-deprecated
---

View File

@@ -12,6 +12,11 @@ featuredLinks:
- /get-started/importing-your-projects-to-github/importing-source-code-to-github/adding-locally-hosted-code-to-github
- /get-started/getting-started-with-git/managing-remote-repositories
- /pages
redirect_from:
- /github
- /articles
- /common-issues-and-questions
- /troubleshooting-common-issues
versions: '*'
children:
- get-started
@@ -118,3 +123,4 @@ externalProducts:
href: 'https://docs.npmjs.com/'
external: true
---

View File

@@ -15,7 +15,9 @@ topics:
- Pull requests
---
仅可删除个人帐户拥有的仓库中的议题。 无法删除其他个人帐户拥有仓库中的议题,即使是该帐户的协作者也一样。
删除议题的能力取决于存储库是由您的个人帐户还是由组织拥有:
- 仅可删除个人帐户拥有的仓库中的议题。
- 无法删除组织或其他个人帐户拥有的仓库中的议题,即使是该帐户的协作者也一样。
如需删除组织拥有仓库中的议题,组织所有者必须启用删除组织仓库的议题,并且您必须拥有该仓库的管理员或所有者权限。 更多信息请参阅“[允许人员删除组织中的议题](/articles/allowing-people-to-delete-issues-in-your-organization)”和“[组织的仓库角色](/organizations/managing-access-to-your-organizations-repositories/repository-roles-for-an-organization)”。

View File

@@ -15,6 +15,8 @@ topics:
{% data reusables.projects.projects-beta %}
{% data reusables.projects.graphql-deprecation %}
## 简介
您可以添加自动化来帮助管理项目。 项目(测试版)包括可通过 UI 配置的内置工作流程。 此外,您可以使用 GraphQL API 和 {% data variables.product.prodname_actions %} 编写自定义工作流程。
@@ -89,23 +91,32 @@ jobs:
gh api graphql -f query='
query($org: String!, $number: Int!) {
organization(login: $org){
projectNext(number: $number) {
projectV2(number: $number) {
id
fields(first:20) {
nodes {
id
name
settings
... on ProjectV2Field {
id
name
}
... on ProjectV2SingleSelectField {
id
name
options {
id
name
}
}
}
}
}
}
}' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > project_data.json
echo 'PROJECT_ID='$(jq '.data.organization.projectNext.id' project_data.json) >> $GITHUB_ENV
echo 'DATE_FIELD_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Date posted") | .id' project_data.json) >> $GITHUB_ENV
echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV
echo 'TODO_OPTION_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") |.settings | fromjson.options[] | select(.name=="Todo") |.id' project_data.json) >> $GITHUB_ENV
echo 'PROJECT_ID='$(jq '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV
echo 'DATE_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Date posted") | .id' project_data.json) >> $GITHUB_ENV
echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV
echo 'TODO_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="Todo") |.id' project_data.json) >> $GITHUB_ENV
- name: Add PR to project
env:
@@ -114,14 +125,14 @@ jobs:
run: |
item_id="$( gh api graphql -f query='
mutation($project:ID!, $pr:ID!) {
addProjectNextItem(input: {projectId: $project, contentId: $pr}) {
projectNextItem {
addProjectV2ItemById(input: {projectId: $project, contentId: $pr}) {
item {
id
}
}
}' -f project=$PROJECT_ID -f pr=$PR_ID --jq '.data.addProjectNextItem.projectNextItem.id')"
}' -f project=$PROJECT_ID -f pr=$PR_ID --jq '.data.addProjectV2ItemById.item.id')"
echo 'ITEM_ID='$item_id >> $GITHUB_ENV
echo 'ITEM_ID='$item_id >> $GITHUB_ENV
- name: Get date
run: echo "DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV
@@ -137,34 +148,39 @@ jobs:
$status_field: ID!
$status_value: String!
$date_field: ID!
$date_value: String!
$date_value: Date!
) {
set_status: updateProjectNextItemField(input: {
set_status: updateProjectV2ItemFieldValue(input: {
projectId: $project
itemId: $item
fieldId: $status_field
value: $status_value
value: {
singleSelectOptionId: $status_value
}
}) {
projectNextItem {
projectV2Item {
id
}
}
set_date_posted: updateProjectNextItemField(input: {
set_date_posted: updateProjectV2ItemFieldValue(input: {
projectId: $project
itemId: $item
fieldId: $date_field
value: $date_value
value: {
date: $date_value
}
}) {
projectNextItem {
projectV2Item {
id
}
}
}' -f project=$PROJECT_ID -f item=$ITEM_ID -f status_field=$STATUS_FIELD_ID -f status_value={% raw %}${{ env.TODO_OPTION_ID }}{% endraw %} -f date_field=$DATE_FIELD_ID -f date_value=$DATE --silent
```
### 使用个人访问令牌进行身份验证的示例工作流程
1. 使用 `org:write` 范围创建个人访问令牌。 更多信息请参阅“[创建个人访问令牌](/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token)”。
1. 创建具有 `project``repo` 作用域的个人访问令牌。 更多信息请参阅“[创建个人访问令牌](/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token)”。
2. 将个人访问令牌另存为存储库或组织中的机密。
3. 在以下工作流程中,将 `YOUR_TOKEN` 替换为密码名称。 将 `YOUR_ORGANIZATION` 替换为您的组织名称。 例如 `octo-org`。 将 `YOUR_PROJECT_NUMBER` 替换为您的项目编号。 要查找项目编号,请查看项目 URL。 例如,`https://github.com/orgs/octo-org/projects/5` 有一个编号为 5 的项目。
@@ -187,23 +203,32 @@ jobs:
gh api graphql -f query='
query($org: String!, $number: Int!) {
organization(login: $org){
projectNext(number: $number) {
projectV2(number: $number) {
id
fields(first:20) {
nodes {
id
name
settings
... on ProjectV2Field {
id
name
}
... on ProjectV2SingleSelectField {
id
name
options {
id
name
}
}
}
}
}
}
}' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > project_data.json
echo 'PROJECT_ID='$(jq '.data.organization.projectNext.id' project_data.json) >> $GITHUB_ENV
echo 'DATE_FIELD_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Date posted") | .id' project_data.json) >> $GITHUB_ENV
echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV
echo 'TODO_OPTION_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") |.settings | fromjson.options[] | select(.name=="Todo") |.id' project_data.json) >> $GITHUB_ENV
echo 'PROJECT_ID='$(jq '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV
echo 'DATE_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Date posted") | .id' project_data.json) >> $GITHUB_ENV
echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV
echo 'TODO_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="Todo") |.id' project_data.json) >> $GITHUB_ENV
- name: Add PR to project
env:
@@ -212,14 +237,14 @@ jobs:
run: |
item_id="$( gh api graphql -f query='
mutation($project:ID!, $pr:ID!) {
addProjectNextItem(input: {projectId: $project, contentId: $pr}) {
projectNextItem {
addProjectV2ItemById(input: {projectId: $project, contentId: $pr}) {
item {
id
}
}
}' -f project=$PROJECT_ID -f pr=$PR_ID --jq '.data.addProjectNextItem.projectNextItem.id')"
}' -f project=$PROJECT_ID -f pr=$PR_ID --jq '.data.addProjectV2ItemById.item.id')"
echo 'ITEM_ID='$item_id >> $GITHUB_ENV
echo 'ITEM_ID='$item_id >> $GITHUB_ENV
- name: Get date
run: echo "DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV
@@ -235,25 +260,29 @@ jobs:
$status_field: ID!
$status_value: String!
$date_field: ID!
$date_value: String!
$date_value: Date!
) {
set_status: updateProjectNextItemField(input: {
set_status: updateProjectV2ItemFieldValue(input: {
projectId: $project
itemId: $item
fieldId: $status_field
value: $status_value
value: {
singleSelectOptionId: $status_value
}
}) {
projectNextItem {
projectV2Item {
id
}
}
set_date_posted: updateProjectNextItemField(input: {
set_date_posted: updateProjectV2ItemFieldValue(input: {
projectId: $project
itemId: $item
fieldId: $date_field
value: $date_value
value: {
date: $date_value
}
}) {
projectNextItem {
projectV2Item {
id
}
}
@@ -352,23 +381,34 @@ env:
gh api graphql -f query='
query($org: String!, $number: Int!) {
organization(login: $org){
projectNext(number: $number) {
projectV2(number: $number) {
id
fields(first:20) {
nodes {
id
name
settings
... on ProjectV2Field {
id
name
}
... on ProjectV2SingleSelectField {
id
name
options {
id
name
}
}
}
}
}
}
}' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > project_data.json
}' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > project_data.json
```
</td>
<td>
使用 <a href="https://cli.github.com/manual/">{% data variables.product.prodname_cli %}</a> 查询项目 ID 的 API 以及项目前 20 个字段的 ID、名称和设置。 响应存储在一个名为 <code>project_data.json</code> 的文件中。
<p>使用 <a href="https://cli.github.com/manual/">{% data variables.product.prodname_cli %}</a> 查询项目 ID 的 API 以及项目前 20 个字段的名称和 ID。 <code>fields</code> 返回并集,查询使用内联分段 (<code>... on</code>) 返回有关任何 <code>ProjectV2Field</code> 和 <code>ProjectV2SingleSelectfield</code> 字段的信息。</p>
<p>响应存储在一个名为 <code>project_data.json</code> 的文件中。</p>
</td>
</tr>
@@ -376,18 +416,18 @@ gh api graphql -f query='
<td>
```yaml
echo 'PROJECT_ID='$(jq '.data.organization.projectNext.id' project_data.json) >> $GITHUB_ENV
echo 'DATE_FIELD_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Date posted") | .id' project_data.json) >> $GITHUB_ENV
echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV
echo 'TODO_OPTION_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Status") |.settings | fromjson.options[] | select(.name=="Todo") |.id' project_data.json) >> $GITHUB_ENV
echo 'PROJECT_ID='$(jq '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV
echo 'DATE_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Date posted") | .id' project_data.json) >> $GITHUB_ENV
echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV
echo 'TODO_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="Todo") |.id' project_data.json) >> $GITHUB_ENV
```
</td>
<td>
解析 API 查询的响应,并将相关 ID 存储为环境变量。 修改此选项以获取不同字段或选项的 ID。 例如:
<ul>
<li>要获取名为 <code>Team</code> 的字段的 ID请添加 <code>echo 'TEAM_FIELD_ID='$(jq 'data. rbodiation.projectNext.fields.nodes[] | select(.name== "Team") | .id' project_data.json) >> $GITHUB_ENV</code>。</li>
<li>要为 <code>Team</code> 字段获取名为 <code>Octoteam</code> 的选项的 ID请添加 <code>echo 'OCTOTEAM_OPTION_ID='$(jq '.data.organization.projectNext.fields.nodes[] | select(.name== "Team") |.settings | fromjson.options[] | select(.name=="Octoteam") |.id' project_data.json) >> $GITHUB_ENV</code></li>
<li>要获取名为 <code>Team</code> 的字段的 ID请添加 <code>echo 'TEAM_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Team") | .id' project_data.json) >> $GITHUB_ENV</code>。</li>
<li>要为 <code>Team</code> 单选字段获取名为 <code>Octoteam</code> 的选项的 ID请添加 <code>echo 'OCTOTEAM_OPTION_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Team") |.options[] | select(.name=="Octoteam") |.id' project_data.json) >> $GITHUB_ENV</code></li>
</ul>
<strong>注意:</strong>此工作流假定您有一个名为“状态”的单选字段,其中包括一个名为“待办”的选项和一个名为“发布日期”的日期字段。 您必须修改此部分以匹配表中存在的字段。
</td>
@@ -425,12 +465,12 @@ env:
```yaml
item_id="$( gh api graphql -f query='
mutation($project:ID!, $pr:ID!) {
addProjectNextItem(input: {projectId: $project, contentId: $pr}) {
projectNextItem {
addProjectV2ItemById(input: {projectId: $project, contentId: $pr}) {
item {
id
}
}
}' -f project=$PROJECT_ID -f pr=$PR_ID --jq '.data.addProjectNextItem.projectNextItem.id')"
}' -f project=$PROJECT_ID -f pr=$PR_ID --jq '.data.addProjectV2ItemById.item.id')"
```
</td>
@@ -500,25 +540,29 @@ gh api graphql -f query='
$status_field: ID!
$status_value: String!
$date_field: ID!
$date_value: String!
$date_value: Date!
) {
set_status: updateProjectNextItemField(input: {
set_status: updateProjectV2ItemFieldValue(input: {
projectId: $project
itemId: $item
fieldId: $status_field
value: $status_value
value: {
singleSelectOptionId: $status_value
}
}) {
projectNextItem {
projectV2Item {
id
}
}
set_date_posted: updateProjectNextItemField(input: {
set_date_posted: updateProjectV2ItemFieldValue(input: {
projectId: $project
itemId: $item
fieldId: $date_field
value: $date_value
value: {
date: $date_value
}
}) {
projectNextItem {
projectV2Item {
id
}
}

View File

@@ -1,6 +1,6 @@
---
title: Migrating your project to Projects (beta)
intro: You can migrate your projects from the old projects experience to Projects (beta).
title: 将项目迁移到项目(测试版)
intro: 您可以将项目从旧项目体验迁移到项目(测试版)。
allowTitleToDifferFromFilename: true
miniTocMaxHeadingLevel: 2
versions:
@@ -15,46 +15,46 @@ topics:
**注意:**
- Projects (beta) is currently in public beta and subject to change.
- If the project you are migrating contains more than 1200 items, open issues will be prioritized followed by open pull requests and then notes. Remaining space will be used for closed issues, merged pull requested, and closed pull requests. Items that cannot be migrated due to this limit will be moved to the archive. If the archive limit of 10,000 items is reached, additional items will not be migrated.
- Note cards are converted to draft issues, and the contents are saved to the body of the draft issue. If information appears to be missing, make any hidden fields visible. For more information, see "[Showing and hiding fields](/issues/trying-out-the-new-projects-experience/customizing-your-project-views#showing-and-hiding-fields)."
- Automation will not be migrated.
- Triage, archive, and activity will not be migrated.
- After migration, the new migrated project and old project will not be kept in sync.
- 项目(测试版)目前处于公开测试阶段,可能会有所变化。
- 如果要迁移的项目包含的项目超过 1200 个项目,则将优先处理未解决的问题,然后是打开的拉取请求,然后是注释。 剩余空间将用于已关闭的议题、合并的拉取请求和已关闭的拉取请求。 由于此限制而无法迁移的项目将被移动到存档中。 如果达到 10,000 个项目的存档限制,则不会迁移其他项目。
- 便笺卡将转换为草稿问题,内容将保存到草稿议题正文中。 如果信息似乎缺失,请使所有隐藏字段可见。 有关详细信息,请参阅“[显示和隐藏字段](/issues/trying-out-the-new-projects-experience/customizing-your-project-views#showing-and-hiding-fields)”。
- 不会迁移自动化。
- 不会迁移分类、存档和活动。
- 迁移后,新迁移的项目和旧项目将不会保持同步。
{% endnote %}
## About project migration
## 关于项目迁移
You can migrate your project boards to the all new projects (beta) experience and try out tables, multiple views, new automation options, and powerful field types. 更多信息请参阅“[关于项目(测试版)](/issues/trying-out-the-new-projects-experience/about-projects)”。
您可以将项目板迁移到所有新项目(测试版)体验,并试用表、多个视图、新的自动化选项和强大的字段类型。 更多信息请参阅“[关于项目(测试版)](/issues/trying-out-the-new-projects-experience/about-projects)”。
## Migrating an organization project board
## 迁移组织项目板
{% data reusables.projects.enable-migration %}
{% data reusables.profile.access_org %}
{% data reusables.user-settings.access_org %}
{% data reusables.organizations.organization-wide-project %}
1. On the left, click **Projects (classic)**. ![Screenshot showing Projects (classic) menu option}](/assets/images/help/issues/projects-classic-org.png)
1. 在左侧,单击 **Projects (classic)(项目[经典]** ![显示项目(经典)菜单选项的屏幕截图](/assets/images/help/issues/projects-classic-org.png)
{% data reusables.projects.migrate-project-steps %}
## Migrating a user project board
## 迁移用户项目板
{% data reusables.projects.enable-migration %}
{% data reusables.profile.access_profile %}
1. 在个人资料页面顶部的主导航栏中,单击 {% octicon "project" aria-label="The project board icon" %} **Projects项目**。 ![项目选项卡](/assets/images/help/projects/user-projects-tab.png)
1. Above the list of projects, click **Projects (classic)**. ![Screenshot showing Projects (classic) menu option}](/assets/images/help/issues/projects-classic-user.png)
1. 在项目列表上方,单击 **Projects (classic)(项目[经典]** ![显示项目(经典)菜单选项的屏幕截图](/assets/images/help/issues/projects-classic-user.png)
{% data reusables.projects.migrate-project-steps %}
## Migrating a repository project board
## 迁移存储库项目板
{% note %}
**Note:** Projects (beta) does not support repository level projects. When you migrate a repository project board, it will migrate to either the organization or personal account that owns the repository project, and the migrated project will be pinned to the original repository.
**注意:** 项目(测试版)不支持存储库级别的项目。 迁移存储库项目板时,它将迁移到拥有存储库项目的组织或个人帐户,并且迁移的项目将固定到原始存储库。
{% endnote %}
{% data reusables.projects.enable-migration %}
{% data reusables.repositories.navigate-to-repo %}
1. 在仓库名称下,单击 {% octicon "project" aria-label="The project board icon" %} **Projects项目**。 ![项目选项卡](/assets/images/help/projects/repo-tabs-projects.png)
1. Click **Projects (classic)**. ![Screenshot showing Projects (classic) menu option}](/assets/images/help/issues/projects-classic-org.png)
1. 单击 **Projects (classic)(项目[经典]** ![显示项目(经典)菜单选项的屏幕截图](/assets/images/help/issues/projects-classic-org.png)
{% data reusables.projects.migrate-project-steps %}

View File

@@ -11,6 +11,8 @@ topics:
- Projects
---
{% data reusables.projects.graphql-deprecation %}
本文演示如何使用 GraphQL API 来管理项目。 有关如何在 {% data variables.product.prodname_actions %} 工作流程中使用 API 的详细信息,请参阅“[自动化项目(测试版)](/issues/trying-out-the-new-projects-experience/automating-projects)”。 有关可用数据类型的完整列表,请参阅“[参考](/graphql/reference)”。
{% data reusables.projects.projects-beta %}
@@ -19,7 +21,7 @@ topics:
{% curl %}
在所有下面的 cURL 示例中, 将 `TOKENN` 替换为具有 `read:org` 范围(对于查询)或 `write:org` 范围(对于查询和突变)的令牌。 令牌可以是用户的个人访问令牌,也可以是 {% data variables.product.prodname_github_app %} 的安装访问令牌。 有关创建个人访问令牌的更多信息,请参阅“[创建个人访问令牌](/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token)”。 有关为 {% data variables.product.prodname_github_app %} 创建安装访问令牌的详细信息,请参阅“[使用 {% data variables.product.prodname_github_apps %} 进行身份验证](/developers/apps/building-github-apps/authenticating-with-github-apps#authenticating-as-a-github-app)”。
在所有下面的 cURL 示例中, 将 `TOKENN` 替换为具有 `read:project` 范围(对于查询)或 `project` 范围(对于查询和突变)的令牌。 令牌可以是用户的个人访问令牌,也可以是 {% data variables.product.prodname_github_app %} 的安装访问令牌。 有关创建个人访问令牌的更多信息,请参阅“[创建个人访问令牌](/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token)”。 有关为 {% data variables.product.prodname_github_app %} 创建安装访问令牌的详细信息,请参阅“[使用 {% data variables.product.prodname_github_apps %} 进行身份验证](/developers/apps/building-github-apps/authenticating-with-github-apps#authenticating-as-a-github-app)”。
{% endcurl %}
@@ -27,7 +29,7 @@ topics:
{% data reusables.cli.cli-learn-more %}
在运行 {% data variables.product.prodname_cli %} 命令之前,必须通过运行 `gh auth login --scopes "write:org"` 进行身份验证。 如果只需要读取项目,不需要编辑项目,则可以省略 `--scopes` 参数。 有关命令行身份验证的更多信息,请参阅 "[gh auth login](https://cli.github.com/manual/gh_auth_login)"。
在运行 {% data variables.product.prodname_cli %} 命令之前,必须通过运行 `gh auth login --scopes "project"` 进行身份验证。 如果只需要读取项目,不需要编辑项目,则可以提供 `read:project` 范围,而不是 `project`。 有关命令行身份验证的更多信息,请参阅 "[gh auth login](https://cli.github.com/manual/gh_auth_login)"。
{% endcli %}
@@ -43,7 +45,7 @@ my_num=5
gh api graphql -f query='
query($organization: String! $number: Int!){
organization(login: $organization){
projectNext(number: $number) {
projectV2(number: $number) {
id
}
}
@@ -69,7 +71,7 @@ gh api graphql -f query='
curl --request POST \
--url https://api.github.com/graphql \
--header 'Authorization: token <em>TOKEN</em>' \
--data '{"query":"query{organization(login: \"<em>ORGANIZATION</em>\") {projectNext(number: <em>NUMBER</em>){id}}}"}'
--data '{"query":"query{organization(login: \"<em>ORGANIZATION</em>\") {projectV2(number: <em>NUMBER</em>){id}}}"}'
```
{% endcurl %}
@@ -78,7 +80,7 @@ curl --request POST \
gh api graphql -f query='
query{
organization(login: "<em>ORGANIZATION</em>"){
projectNext(number: <em>NUMBER</em>) {
projectV2(number: <em>NUMBER</em>) {
id
}
}
@@ -93,7 +95,7 @@ gh api graphql -f query='
curl --request POST \
--url https://api.github.com/graphql \
--header 'Authorization: token <em>TOKEN</em>' \
--data '{"query":"{organization(login: \"<em>ORGANIZATION</em>\") {projectsNext(first: 20) {nodes {id title}}}}"}'
--data '{"query":"{organization(login: \"<em>ORGANIZATION</em>\") {projectsV2(first: 20) {nodes {id title}}}}"}'
```
{% endcurl %}
@@ -102,7 +104,7 @@ curl --request POST \
gh api graphql -f query='
query{
organization(login: "<em>ORGANIZATION</em>") {
projectsNext(first: 20) {
projectsV2(first: 20) {
nodes {
id
title
@@ -124,7 +126,7 @@ gh api graphql -f query='
curl --request POST \
--url https://api.github.com/graphql \
--header 'Authorization: token <em>TOKEN</em>' \
--data '{"query":"query{user(login: \"<em>USER</em>\") {projectNext(number: <em>NUMBER</em>){id}}}"}'
--data '{"query":"query{user(login: \"<em>USER</em>\") {projectV2(number: <em>NUMBER</em>){id}}}"}'
```
{% endcurl %}
@@ -133,7 +135,7 @@ curl --request POST \
gh api graphql -f query='
query{
user(login: "<em>USER</em>"){
projectNext(number: <em>NUMBER</em>) {
projectV2(number: <em>NUMBER</em>) {
id
}
}
@@ -148,7 +150,7 @@ gh api graphql -f query='
curl --request POST \
--url https://api.github.com/graphql \
--header 'Authorization: token <em>TOKEN</em>' \
--data '{"query":"{user(login: \"<em>USER</em>\") {projectsNext(first: 20) {nodes {id title}}}}"}'
--data '{"query":"{user(login: \"<em>USER</em>\") {projectsV2(first: 20) {nodes {id title}}}}"}'
```
{% endcurl %}
@@ -157,7 +159,7 @@ curl --request POST \
gh api graphql -f query='
query{
user(login: "<em>USER</em>") {
projectsNext(first: 20) {
projectsV2(first: 20) {
nodes {
id
title
@@ -172,14 +174,14 @@ gh api graphql -f query='
要更新字段的值,您需要知道字段的节点 ID。 此外,您还需要知道单个选择字段的选项 ID 和迭代字段的迭代 ID。
下面的示例将返回项目中前 20 个字段的 ID、名称和设置。 将 `PROJECT_ID` 替换为项目的节点 ID。
下面的示例将返回项目中前 20 个字段的 ID、名称、设置和配置。 将 `PROJECT_ID` 替换为项目的节点 ID。
{% curl %}
```shell
curl --request POST \
--url https://api.github.com/graphql \
--header 'Authorization: token <em>TOKEN</em>' \
--data '{"query":"query{node(id: \"<em>PROJECT_ID</em>\") {... on ProjectNext {fields(first: 20) {nodes {id name settings}}}}}"}'
--data '{"query":"query{ node(id: \"<em>PROJECT_ID</em>\") { ... on ProjectV2 { fields(first: 20) { nodes { ... on ProjectV2Field { id name } ... on ProjectV2IterationField { id name configuration { iterations { startDate id }}} ... on ProjectV2SingleSelectField { id name options { id name }}}}}}}"}'
```
{% endcurl %}
@@ -187,18 +189,37 @@ curl --request POST \
```shell
gh api graphql -f query='
query{
node(id: "<em>PROJECT_ID</em>") {
... on ProjectNext {
fields(first: 20) {
nodes {
node(id: "<em>PROJECT_ID</em>") {
... on ProjectV2 {
fields(first: 20) {
nodes {
... on ProjectV2Field {
id
name
settings
}
... on ProjectV2IterationField {
id
name
configuration {
iterations {
startDate
id
}
}
}
... on ProjectV2SingleSelectField {
id
name
options {
id
name
}
}
}
}
}
}'
}
}'
```
{% endcli %}
@@ -211,24 +232,42 @@ gh api graphql -f query='
"fields": {
"nodes": [
{
"id": "MDE2OlByb2plY3ROZXh0RmllbGQxMzE1OQ==",
"name": "Title",
"settings": "null"
"id": "PVTF_lADOANN5s84ACbL0zgBZrZY",
"name": "Title"
},
{
"id": "MDE2OlByb2plY3ROZXh0RmllbGQxMzE2MA==",
"name": "Assignees",
"settings": "null"
"id": "PVTF_lADOANN5s84ACbL0zgBZrZc",
"name": "Assignees"
},
{
"id": "MDE2OlByb2plY3ROZXh0RmllbGQxMzE2MQ==",
"id": "PVTSSF_lADOANN5s84ACbL0zgBZrZg",
"name": "Status",
"settings": "{\"options\":[{\"id\":\"f75ad846\",\"name\":\"Todo\",\"name_html\":\"Todo\"},{\"id\":\"47fc9ee4\",\"name\":\"In Progress\",\"name_html\":\"In Progress\"},{\"id\":\"98236657\",\"name\":\"Done\",\"name_html\":\"Done\"}]}"
"options": [
{
"id": "f75ad846",
"name": "Todo"
},
{
"id": "47fc9ee4",
"name": "In Progress"
},
{
"id": "98236657",
"name": "Done"
}
]
},
{
"id": "MDE2OlByb2plY3ROZXh0RmllbGQ3NTEwNw==",
"id": "PVTIF_lADOANN5s84ACbL0zgBah28",
"name": "Iteration",
"settings": "{\"configuration\":{\"duration\":7,\"start_day\":5,\"iterations\":[{\"id\":\"c4d8e84d\",\"title\":\"Iteration 2\",\"duration\":7,\"start_date\":\"2021-10-08\",\"title_html\":\"Iteration 2\"},{\"id\":\"fafa9c9f\",\"title\":\"Iteration 3\",\"duration\":7,\"start_date\":\"2021-10-15\",\"title_html\":\"Iteration 3\"}],\"completed_iterations\":[{\"id\":\"fa62c118\",\"title\":\"Iteration 1\",\"duration\":7,\"start_date\":\"2021-10-01\",\"title_html\":\"Iteration 1\"}]}}"
"configuration": {
"iterations": [
{
"startDate": "2022-05-29",
"id": "cfc16e4d"
}
]
}
}
]
}
@@ -237,26 +276,86 @@ gh api graphql -f query='
}
```
每个字段都有 ID。 此外,单个选择字段和迭代字段有`设置`值。 在单选设置中,您可以找到单选的每个选项的 ID。 迭代设置中,您可以找到迭代的持续时间、迭代的开始日期(从星期一的 1 到星期日的 7、未完成迭代的列表以及已完成迭代的列表。 对于迭代列表中的每个迭代,您可以找到迭代的 ID、标题、持续时间和开始日期
每个字段都有 ID 和名称。 单选字段作为 `ProjectV2SingleSelectField` 对象返回,并具有 `options` 字段,您可以在其中找到每个单选选项的 ID。 迭代字段作为 `ProjectV2IterationField` 对象返回,并具有`配置` 字段,其中包括一个包含 ID 和有关每次迭代信息的`迭代`字段
### 查找项目中各项的信息
您可以查询 API 来查找项目中各项的信息。
{% note %}
**注意**API 不会返回有关草稿议题的信息。
{% endnote %}
下面的示例将返回项目中前 20 个字段的名称和 ID。 对于每个项目,它还将返回项目前 8 个字段的值和名称。 如果项目是议题或拉取请求,它将返回前 10 个受理人的登录名。 将 `PROJECT_ID` 替换为项目的节点 ID。
如果只需要字段的名称和 ID而不需要有关迭代或单个选择字段选项的信息则可以使用 `ProjectV2FieldCommon` 对象。
{% curl %}
```shell
curl --request POST \
--url https://api.github.com/graphql \
--header 'Authorization: token <em>TOKEN</em>' \
--data '{"query":"query{node(id: \"<em>PROJECT_ID</em>\") {... on ProjectNext {items(first: 20) {nodes{title id fieldValues(first: 8) {nodes{value projectField{name}}} content{...on Issue {assignees(first: 10) {nodes{login}}} ...on PullRequest {assignees(first: 10) {nodes{login}}}}}}}}}"}'
--data '{"query":"query{ node(id: \"<em>PROJECT_ID</em>\") { ... on ProjectV2 { fields(first: 20) { nodes { ... on ProjectV2FieldCommon { id name }}}}}}"}'
```
{% endcurl %}
{% cli %}
```shell
gh api graphql -f query='
query{
node(id: "<em>PROJECT_ID</em>") {
... on ProjectV2 {
fields(first: 20) {
nodes {
... on ProjectV2FieldCommon {
id
name
}
}
}
}
}
}
```
{% endcli %}
使用 `ProjectV2FieldCommon` 对象时的响应将类似于以下示例:
```json
{
"data": {
"node": {
"fields": {
"nodes": [
{
"__typename": "ProjectV2Field",
"id": "PVTF_lADOANN5s84ACbL0zgBZrZY",
"name": "Title"
},
{
"__typename": "ProjectV2Field",
"id": "PVTF_lADOANN5s84ACbL0zgBZrZc",
"name": "Assignees"
},
{
"__typename": "ProjectV2SingleSelectField",
"id": "PVTSSF_lADOANN5s84ACbL0zgBZrZg",
"name": "Status"
},
{
"__typename": "ProjectV2IterationField",
"id": "PVTIF_lADOANN5s84ACbL0zgBah28",
"name": "Iteration"
}
]
}
}
}
}
```
### 查找项目中各项的信息
您可以查询 API 来查找项目中各项的信息。
下面的示例将返回项目中的前 20 个议题、拉取请求和草稿议题。 对于议题和拉取请求,它还将返回标题和前 10 个受理人。 对于草稿议题,它将返回标题和正文。 该示例还将返回项目前 8 个字段中任何文本、日期或单选字段的字段名称和值。 将 `PROJECT_ID` 替换为项目的节点 ID。
{% curl %}
```shell
curl --request POST \
--url https://api.github.com/graphql \
--header 'Authorization: token <em>TOKEN</em>' \
--data '{"query":"query{ node(id: \"<em>PROJECT_ID</em>\") { ... on ProjectV2 { items(first: 20) { nodes{ id fieldValues(first: 8) { nodes{ ... on ProjectV2ItemFieldTextValue { text field { ... on ProjectV2FieldCommon { name }}} ... on ProjectV2ItemFieldDateValue { date field { ... on ProjectV2FieldCommon { name } } } ... on ProjectV2ItemFieldSingleSelectValue { name field { ... on ProjectV2FieldCommon { name }}}}} content{ ... on DraftIssue { title body } ...on Issue { title assignees(first: 10) { nodes{ login }}} ...on PullRequest { title assignees(first: 10) { nodes{ login }}}}}}}}}"}'
```
{% endcurl %}
@@ -265,31 +364,57 @@ curl --request POST \
gh api graphql -f query='
query{
node(id: "<em>PROJECT_ID</em>") {
... on ProjectNext {
items(first: 20) {
nodes{
title
id
fieldValues(first: 8) {
nodes{
value
projectField{
name
}
... on ProjectV2 {
items(first: 20) {
nodes{
id
fieldValues(first: 8) {
nodes{
... on ProjectV2ItemFieldTextValue {
text
field {
... on ProjectV2FieldCommon {
name
}
}
}
... on ProjectV2ItemFieldDateValue {
date
field {
... on ProjectV2FieldCommon {
name
}
}
}
... on ProjectV2ItemFieldSingleSelectValue {
name
field {
... on ProjectV2FieldCommon {
name
}
}
}
}
}
}
content{
...on Issue {
assignees(first: 10) {
nodes{
login
content{
... on DraftIssue {
title
body
}
...on Issue {
title
assignees(first: 10) {
nodes{
login
}
}
}
}
...on PullRequest {
assignees(first: 10) {
nodes{
login
...on PullRequest {
title
assignees(first: 10) {
nodes{
login
}
}
}
}
@@ -297,21 +422,11 @@ gh api graphql -f query='
}
}
}
}
}'
}'
```
{% endcli %}
项目可能包含用户无权查看的项。 在这种情况下,响应将包括已编辑的项
```shell
{
"node": {
"title": "You can't see this item",
...
}
}
```
项目可能包含用户无权查看的项。 在这种情况下,项目类型将作为 `REDACTED` 返回
## 更新项目
@@ -319,7 +434,7 @@ gh api graphql -f query='
{% note %}
**注意:** 您不能在同一调用中添加和更新项。 您必须使用 `addProjectNextitem` 来添加项,然后使用 `updateProjectNextItemfield` 来更新
**注意:** 您不能在同一调用中添加和更新项。 您必须使用 `addProjectV2ItemById` 来添加项,然后使用 `updateProjectV2ItemFieldValue` 来更新该项目
{% endnote %}
@@ -332,7 +447,7 @@ gh api graphql -f query='
curl --request POST \
--url https://api.github.com/graphql \
--header 'Authorization: token <em>TOKEN</em>' \
--data '{"query":"mutation {addProjectNextItem(input: {projectId: \"<em>PROJECT_ID</em>\" contentId: \"<em>CONTENT_ID</em>\"}) {projectNextItem {id}}}"}'
--data '{"query":"mutation {addProjectV2ItemById(input: {projectId: \"<em>PROJECT_ID</em>\" contentId: \"<em>CONTENT_ID</em>\"}) {item {id}}}"}'
```
{% endcurl %}
@@ -340,8 +455,8 @@ curl --request POST \
```shell
gh api graphql -f query='
mutation {
addProjectNextItem(input: {projectId: "<em>PROJECT_ID</em>" contentId: "<em>CONTENT_ID</em>"}) {
projectNextItem {
addProjectV2ItemById(input: {projectId: "<em>PROJECT_ID</em>" contentId: "<em>CONTENT_ID</em>"}) {
item {
id
}
}
@@ -354,9 +469,9 @@ gh api graphql -f query='
```json
{
"data": {
"addProjectNextItem": {
"projectNextItem": {
"id": "MDE1OlByb2plY3ROZXh0SXRlbTM0MjEz"
"addProjectV2ItemById": {
"item": {
"id": "PVTI_lADOANN5s84ACbL0zgBVd94"
}
}
}
@@ -365,16 +480,16 @@ gh api graphql -f query='
如果您尝试添加已经存在的项,则返回现有项 ID。
### 更新项目的设置
### 向项目添加草稿议题
以下示例将更新项目的设置。 将 `PROJECT_ID` 替换为项目的节点 ID。 将 `public` 设置为 `true` ,以便在 {% data variables.product.product_name %} 上公开您的项目。 修改 `description` 以对项目的 README 进行更改
下面的示例将向项目添加草稿议题。 将 `PROJECT_ID` 替换为项目的节点 ID。 将 `TITLE``BODY` 替换为新草稿议题所需的内容
{% curl %}
```shell
curl --request POST \
--url https://api.github.com/graphql \
--header 'Authorization: token <em>TOKEN</em>' \
--data '{"query":"mutation { updateProjectNext(input: { projectId: \"<em>PROJECT_ID</em>\", title: \"Project title\", public: false, description: \"# Project README\n\nA long description\", shortDescription: \"A short description\"}) { projectNext { id, title, description, shortDescription }}}"}'
--url https://api.github.com/graphql \
--header 'Authorization: token <em>TOKEN</em>' \
--data '{"query":"mutation {addProjectV2DraftIssue(input: {projectId: "<em>PROJECT_ID</em>" title: "<em>TITLE</em>" body: "<em>BODY</em>"}) {item {id}}}"}'
```
{% endcurl %}
@@ -382,19 +497,59 @@ curl --request POST \
```shell
gh api graphql -f query='
mutation {
updateProjectNext(
addProjectV2DraftIssue(input: {projectId: "<em>PROJECT_ID</em>" title: "<em>TITLE</em>" body: "<em>BODY</em>"}) {
item {
id
}
}
}'
```
{% endcli %}
响应将包含新建草稿议题的节点 ID。
```json
{
"data": {
"addProjectV2ItemById": {
"item": {
"id": "PVTI_lADOANN5s84ACbL0zgBbxFc"
}
}
}
}
```
### 更新项目的设置
以下示例将更新项目的设置。 将 `PROJECT_ID` 替换为项目的节点 ID。 将 `public` 设置为 `true` ,以便在 {% data variables.product.product_name %} 上公开您的项目。 修改 `readme` 以对项目的 README 进行更改。
{% curl %}
```shell
curl --request POST \
--url https://api.github.com/graphql \
--header 'Authorization: token <em>TOKEN</em>' \
--data '{"query":"mutation { updateProjectV2(input: { projectId: \"<em>PROJECT_ID</em>\", title: \"Project title\", public: false, readme: \"# Project README\n\nA long description\", shortDescription: \"A short description\"}) { projectV2 { id, title, readme, shortDescription }}}"}'
```
{% endcurl %}
{% cli %}
```shell
gh api graphql -f query='
mutation {
updateProjectV2(
input: {
projectId: "<em>PROJECT_ID</em>",
title: "Project title",
public: false,
description: "# Project README\n\nA long description",
readme: "# Project README\n\nA long description",
shortDescription: "A short description"
}
) {
projectNext {
projectV2 {
id
title
description
readme
shortDescription
}
}
@@ -404,14 +559,14 @@ gh api graphql -f query='
### 更新自定义文本、数字或日期字段
下面的示例将更新项目的日期字段值。 将 `PROJECT_ID` 替换为项目的节点 ID。 将 `ITEM_ID` 替换为您想要更新的项的节点 ID。 将 `FIELD_ID` 替换为您想要更新的字段的 ID。
下面的示例将更新项目的文本字段值。 将 `PROJECT_ID` 替换为项目的节点 ID。 将 `ITEM_ID` 替换为您想要更新的项的节点 ID。 将 `FIELD_ID` 替换为您想要更新的字段的 ID。
{% curl %}
```shell
curl --request POST \
--url https://api.github.com/graphql \
--header 'Authorization: token <em>TOKEN</em>' \
--data '{"query":"mutation {updateProjectNextItemField(input: {projectId: \"<em>PROJECT_ID</em>\" itemId: \"<em>ITEM_ID</em>\" fieldId: \"<em>FIELD_ID</em>\" value: \"2021-5-11\"}) {projectNextItem {id}}}"}'
--data '{"query":"mutation {updateProjectV2ItemFieldValue( input: { projectId: "<em>PROJECT_ID</em>" itemId: "<em>ITEM_ID</em>" fieldId: "<em>FIELD_ID</em>" value: { text: "Updated text" }}) { projectV2Item { id }}}"}'
```
{% endcurl %}
@@ -419,15 +574,17 @@ curl --request POST \
```shell
gh api graphql -f query='
mutation {
updateProjectNextItemField(
updateProjectV2ItemFieldValue(
input: {
projectId: "<em>PROJECT_ID</em>"
itemId: "<em>ITEM_ID</em>"
fieldId: "<em>FIELD_ID</em>"
value: "2021-5-11"
value: {
text: "Updated text"
}
}
) {
projectNextItem {
projectV2Item {
id
}
}
@@ -437,7 +594,7 @@ gh api graphql -f query='
{% note %}
**注意:** 您不能使用 `updateProjectNextItemField` 更改 `Assignees``Labels``Milestone``Repository`,因为这些字段是拉取请求和议题,而不是项目项的属性。 相反,您必须使用 [addAssigneesToAssignable]({% ifversion ghec%}/free-pro-team@latest{% endif %}/graphql/reference/mutations#addassigneestoassignable)、[removeAssigneesFromAssignable]({% ifversion ghec%}/free-pro-team@latest{% endif %}/graphql/reference/mutations#removeassigneesfromassignable)、[addLabelsToLabelable]({% ifversion ghec%}/free-pro-team@latest{% endif %}/graphql/reference/mutations#addlabelstolabelable)、[removeLabelsFromLabelable]({% ifversion ghec%}/free-pro-team@latest{% endif %}/graphql/reference/mutations#removelabelsfromlabelable)、[updateIssue]({% ifversion ghec%}/free-pro-team@latest{% endif %}/graphql/reference/mutations#updateissue)、[updatePullRequest]({% ifversion ghec%}/free-pro-team@latest{% endif %}/graphql/reference/mutations#updatepullrequest) 或 [transferIssue]({% ifversion ghec%}/free-pro-team@latest{% endif %}/graphql/reference/mutations#transferissue) 突变。
**注意:** 您不能使用 `updateProjectV2ItemFieldValue` 更改 `Assignees``Labels``Milestone``Repository`,因为这些字段是拉取请求和议题,而不是项目项的属性。 相反,您必须使用 [addAssigneesToAssignable]({% ifversion ghec%}/free-pro-team@latest{% endif %}/graphql/reference/mutations#addassigneestoassignable)、[removeAssigneesFromAssignable]({% ifversion ghec%}/free-pro-team@latest{% endif %}/graphql/reference/mutations#removeassigneesfromassignable)、[addLabelsToLabelable]({% ifversion ghec%}/free-pro-team@latest{% endif %}/graphql/reference/mutations#addlabelstolabelable)、[removeLabelsFromLabelable]({% ifversion ghec%}/free-pro-team@latest{% endif %}/graphql/reference/mutations#removelabelsfromlabelable)、[updateIssue]({% ifversion ghec%}/free-pro-team@latest{% endif %}/graphql/reference/mutations#updateissue)、[updatePullRequest]({% ifversion ghec%}/free-pro-team@latest{% endif %}/graphql/reference/mutations#updatepullrequest) 或 [transferIssue]({% ifversion ghec%}/free-pro-team@latest{% endif %}/graphql/reference/mutations#transferissue) 突变。
{% endnote %}
@@ -455,7 +612,7 @@ gh api graphql -f query='
curl --request POST \
--url https://api.github.com/graphql \
--header 'Authorization: token <em>TOKEN</em>' \
--data '{"query":"mutation {updateProjectNextItemField(input: {projectId: \"<em>PROJECT_ID</em>\" itemId: \"<em>ITEM_ID</em>\" fieldId: \"<em>FIELD_ID</em>\" value: \"<em>OPTION_ID</em>\"}) {projectNextItem {id}}}"}'
--data '{"query":"mutation {updateProjectV2ItemFieldValue( input: { projectId: "<em>PROJECT_ID</em>" itemId: "<em>ITEM_ID</em>" fieldId: "<em>FIELD_ID</em>" value: { singleSelectOptionId: "<em>OPTION_ID</em>" }}) { projectV2Item { id }}}"}'
```
{% endcurl %}
@@ -463,15 +620,17 @@ curl --request POST \
```shell
gh api graphql -f query='
mutation {
updateProjectNextItemField(
updateProjectV2ItemFieldValue(
input: {
projectId: "<em>PROJECT_ID</em>"
itemId: "<em>ITEM_ID</em>"
fieldId: "<em>FIELD_ID</em>"
value: "<em>OPTION_ID</em>"
value: {
singleSelectOptionId: "<em>OPTION_ID</em>"
}
}
) {
projectNextItem {
projectV2Item {
id
}
}
@@ -486,14 +645,14 @@ gh api graphql -f query='
- `PROJECT_ID` - 用项目节点 ID 替换。
- `ITEM_ID` - 替换为您想要更新的项的节点 ID。
- `FIELD_ID` - 替换为您想要更新的迭代字段的 ID。
- `ITERATION_ID` - 替换为所需迭代的 ID。 这可以是活动迭代(来自 `iterations` 数组)或已完成迭代(来自 `completed_iterations` 数组)
- `ITERATION_ID` - 替换为所需迭代的 ID。 这可以是活动迭代,也可以是已完成迭代。
{% curl %}
```shell
curl --request POST \
--url https://api.github.com/graphql \
--header 'Authorization: token <em>TOKEN</em>' \
--data '{"query":"mutation {updateProjectNextItemField(input: {projectId: \"<em>PROJECT_ID</em>\" itemId: \"<em>ITEM_ID</em>\" fieldId: \"<em>FIELD_ID</em>\" value: \"<em>ITERATION_ID</em>\"}) {projectNextItem {id}}}"}'
--data '{"query":"mutation {updateProjectV2ItemFieldValue( input: { projectId: "<em>PROJECT_ID</em>" itemId: "<em>ITEM_ID</em>" fieldId: "<em>FIELD_ID</em>" value: { singleSelectOptionId: "<em>OPTION_ID</em>" }}) { projectV2Item { id }}}"}'
```
{% endcurl %}
@@ -501,15 +660,17 @@ curl --request POST \
```shell
gh api graphql -f query='
mutation {
updateProjectNextItemField(
updateProjectV2ItemFieldValue(
input: {
projectId: "<em>PROJECT_ID</em>"
itemId: "<em>ITEM_ID</em>"
fieldId: "<em>FIELD_ID</em>"
value: "<em>ITERATION_ID</em>"
value: {
iterationId: "<em>ITERATION_ID</em>"
}
}
) {
projectNextItem {
projectV2Item {
id
}
}
@@ -526,7 +687,7 @@ gh api graphql -f query='
curl --request POST \
--url https://api.github.com/graphql \
--header 'Authorization: token <em>TOKEN</em>' \
--data '{"query":"mutation {deleteProjectNextItem(input: {projectId: \"<em>PROJECT_ID</em>\" itemId: \"<em>ITEM_ID</em>\"}) {deletedItemId}}"}'
--data '{"query":"mutation {deleteProjectV2Item(input: {projectId: \"<em>PROJECT_ID</em>\" itemId: \"<em>ITEM_ID</em>\"}) {deletedItemId}}"}'
```
{% endcurl %}
@@ -534,7 +695,7 @@ curl --request POST \
```shell
gh api graphql -f query='
mutation {
deleteProjectNextItem(
deleteProjectV2Item(
input: {
projectId: "<em>PROJECT_ID</em>"
itemId: "<em>ITEM_ID</em>"

View File

@@ -16,7 +16,6 @@ children:
- /about-forks
- /configuring-a-remote-for-a-fork
- /syncing-a-fork
- /merging-an-upstream-repository-into-your-fork
- /allowing-changes-to-a-pull-request-branch-created-from-a-fork
- /what-happens-to-forks-when-a-repository-is-deleted-or-changes-visibility
---

View File

@@ -1,35 +0,0 @@
---
title: 将上游仓库合并到复刻
intro: 如果您对上游仓库没有推送(写入)权限,便可将提交从该仓库拉入您自己的复刻。
redirect_from:
- /github/collaborating-with-issues-and-pull-requests/working-with-forks/merging-an-upstream-repository-into-your-fork
- /articles/merging-an-upstream-repository-into-your-fork
- /github/collaborating-with-issues-and-pull-requests/merging-an-upstream-repository-into-your-fork
- /github/collaborating-with-pull-requests/working-with-forks/merging-an-upstream-repository-into-your-fork
versions:
fpt: '*'
ghes: '*'
ghae: '*'
ghec: '*'
topics:
- Pull requests
shortTitle: 合并上游仓库
---
{% data reusables.command_line.open_the_multi_os_terminal %}
2. 将当前工作目录更改为您的本地仓库。
3. 检出要合并到其中的分支。 通常,您会合并到默认分支中。
```shell
$ git checkout <em>DEFAULT_BRANCH_NAME</em>
```
4. 从上游仓库拉取所需的分支。 此方法将保留提交历史记录而不做修改。
```shell
$ git pull https://{% data variables.command_line.codeblock %}/<em>ORIGINAL_OWNER</em>/<em>ORIGINAL_REPOSITORY</em>.git <em>BRANCH_NAME</em>
```
5. 如有冲突,请解决。 更多信息请参阅“[解决合并冲突](/github/collaborating-with-pull-requests/addressing-merge-conflicts)”。
6. 提交合并。
7. 检查更改,确认对更改满意。
8. 将合并推送到 GitHub 仓库。
```shell
$ git push origin <em>DEFAULT_BRANCH_NAME</em>
```

View File

@@ -6,6 +6,11 @@ redirect_from:
- /articles/syncing-a-fork
- /github/collaborating-with-issues-and-pull-requests/syncing-a-fork
- /github/collaborating-with-pull-requests/working-with-forks/syncing-a-fork
- /pull-requests/collaborating-with-pull-requests/working-with-forks/merging-an-upstream-repository-into-your-fork
- /github/collaborating-with-issues-and-pull-requests/working-with-forks/merging-an-upstream-repository-into-your-fork
- /articles/merging-an-upstream-repository-into-your-fork
- /github/collaborating-with-issues-and-pull-requests/merging-an-upstream-repository-into-your-fork
- /github/collaborating-with-pull-requests/working-with-forks/merging-an-upstream-repository-into-your-fork
versions:
fpt: '*'
ghes: '*'
@@ -18,7 +23,7 @@ permissions: People with write access for a forked repository can sync the fork
{% ifversion fpt or ghes > 3.1 or ghae or ghec %}
## 从 web UI 同步复刻
## 从 web UI 同步复刻分支
1. 在 {% data variables.product.product_name %} 上,导航到您想要与上游版本库同步的复刻仓库主页。
2. 选择 **Fetch upstream提取上游**下拉菜单。 !["Fetch upstream提取上游"下拉菜单](/assets/images/help/repository/fetch-upstream-drop-down.png)
@@ -26,19 +31,19 @@ permissions: People with write access for a forked repository can sync the fork
如果上游仓库的更改导致冲突,{% data variables.product.company_short %} 将提示您创建拉取请求以解决冲突。
## 使用 {% data variables.product.prodname_cli %} 同步复刻
## 使用 {% data variables.product.prodname_cli %} 同步复刻分支
{% data reusables.cli.about-cli %} 要了解 {% data variables.product.prodname_cli %} 的更多信息,请参阅“[关于 {% data variables.product.prodname_cli %}](/github-cli/github-cli/about-github-cli)”。
要从其父级更新远程复刻,请使用 `gh repo sync` 子命令,并提供复刻名称作为参数。
要从其父级更新远程复刻,请使用 `gh repo sync -b BRANCHNAME` 子命令,并提供复刻和分支名称作为参数。
```shell
$ gh repo sync owner/cli-fork
$ gh repo sync owner/cli-fork -b BRANCHNAME
```
如果来自上游存储库的更改导致冲突,则 {% data variables.product.prodname_cli %} 无法同步。 您可以设置 `-force` 标志以覆盖目标分支。
## 从命令行同步复刻
## 从命令行同步复刻分支
{% endif %}
必须在 Git 中[配置指向上游仓库的远程仓库](/pull-requests/collaborating-with-pull-requests/working-with-forks/configuring-a-remote-for-a-fork),然后才能将您的复刻与上游仓库同步。
@@ -77,6 +82,15 @@ $ gh repo sync owner/cli-fork
> create mode 100644 README.md
```
如果您的本地分支没有任何唯一的提交Git 将执行快进。 更多信息请参阅 Git 文档中的“[基本分支与合并](https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging)”。
```shell
$ git merge upstream/main
> Updating 34e91da..16c56ad
> Fast-forward
> README.md | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
```
如果本地分支具有唯一的提交,则可能需要解决冲突。 更多信息请参阅“[解决合并冲突](/github/collaborating-with-pull-requests/addressing-merge-conflicts)”。
{% tip %}

View File

@@ -38,7 +38,7 @@ shortTitle: 链接到错误的用户
1. 通过单击提交消息链接导航到提交。 ![提交消息链接](/assets/images/help/commits/commit-msg-link.png)
2. 要阅读有关提交未链接原因的消息,请将鼠标悬停在用户名右侧的蓝色 {% octicon "question" aria-label="Question mark" %} 上。 ![提交悬停消息](/assets/images/help/commits/commit-hover-msg.png)
- **无法识别的作者(含电子邮件地址)**如果您看到此消息包含电子邮件地址,则表示用于创作提交的地址未连接到您在 {% data variables.product.product_name %} 上的帐户。 {% ifversion not ghae %}要链接提交,请[将电子邮件地址添加到 GitHub 电子邮件设置](/articles/adding-an-email-address-to-your-github-account)。{% endif %}如果电子邮件地址关联了 Gravatar提交旁边将显示该 Gravatar而不是默认的灰色 Octocat。
- **无法识别的作者(含电子邮件地址)**如果您看到此消息包含电子邮件地址,则表示用于创作提交的地址未连接到您在 {% data variables.product.product_name %} 上的帐户。 {% ifversion not ghae %}要链接提交,请[将电子邮件地址添加到 GitHub 电子邮件设置](/articles/adding-an-email-address-to-your-github-account)。{% endif %}{% ifversion not ghae %}如果电子邮件地址关联了 Gravatar提交旁边将显示该 Gravatar而不是默认的灰色 Octocat。{% endif %}
- **无法识别的作者(无电子邮件地址)**如果您看到此消息没有电子邮件地址,则表示您使用了无法连接到您在 {% data variables.product.product_name %} 上的帐户的通用电子邮件地址。{% ifversion not ghae %} 您需要[在 Git 中设置提交电子邮件地址](/articles/setting-your-commit-email-address),然后[将新地址添加到 GitHub 电子邮件设置](/articles/adding-an-email-address-to-your-github-account)以链接您未来的提交。 旧提交不会链接。{% endif %}
- **无效的电子邮件地址**本地 Git 配置设置中的电子邮件地址为空白或未格式化为电子邮件地址。{% ifversion not ghae %} 您需要[在 Git 中设置提交电子邮件地址](/articles/setting-your-commit-email-address),然后[将新地址添加到 GitHub 电子邮件设置](/articles/adding-an-email-address-to-your-github-account)以链接您未来的提交。 旧提交不会链接。{% endif %}

View File

@@ -125,7 +125,9 @@ $ ssh -T git@{% data variables.command_line.codeblock %}
> provide shell access.
```
如果仓库属于组织,并且您使用的是 OAuth App 生成的 SSH 密钥,则 OAuth App 访问权限可能已被组织所有者限制。 更多信息请参阅“<a href="/organizations/restricting-access-to-your-organizations-data/about-oauth-app-access-restrictions" class="dotcom-only">关于 OAuth App 访问限制</a>”。
{% ifversion fpt or ghec %}
如果仓库属于组织,并且您使用的是 OAuth App 生成的 SSH 密钥,则 OAuth App 访问权限可能已被组织所有者限制。 更多信息请参阅“[关于 OAuth App 访问限制](/organizations/restricting-access-to-your-organizations-data/about-oauth-app-access-restrictions)”。
{% endif %}
更多信息请参阅[添加 SSH 密钥到 GitHub 帐户](/articles/adding-a-new-ssh-key-to-your-github-account)。

View File

@@ -26,7 +26,7 @@ shortTitle: 管理版本
您可以使用发行说明、@提及贡献者和指向二进制文件的链接来创建新版本,也可以编辑或删除现有版本。
{% ifversion fpt or ghec %}
您也可以在 {% data variables.product.prodname_marketplace %} 中从特定的发行版发布操作。 更多信息请参阅“<a href="/actions/creating-actions/publishing-actions-in-github-marketplace" class="dotcom-only">在 {% data variables.product.prodname_marketplace %} 中发布操作</a>”。
您也可以在 {% data variables.product.prodname_marketplace %} 中从特定的发行版发布操作。 更多信息请参阅“[在 {% data variables.product.prodname_marketplace %} 中发布操作](/actions/creating-actions/publishing-actions-in-github-marketplace)”。
您可以选择是否将 {% data variables.large_files.product_name_long %} ({% data variables.large_files.product_name_short %}) 对象包含在 {% data variables.product.product_name %} 为每个发行版创建的 ZIP 文件和 tarball 中。 更多信息请参阅“[管理仓库存档中的 {% data variables.large_files.product_name_short %} 对象](/github/administering-a-repository/managing-git-lfs-objects-in-archives-of-your-repository)”。
{% endif %}

View File

@@ -77,4 +77,10 @@ shortTitle: 查看文件和跟踪文件更改
git blame --ignore-revs-file .git-blame-ignore-revs
```
您还可以配置本地 git使其始终忽略该文件中的 revs
```shell
git config blame.ignoreRevsFile .git-blame-ignore-revs
```
{% endif %}

View File

@@ -245,6 +245,7 @@ GitHub 支持呈现 PDF 文档。
{% data variables.product.product_name %} 上的地图使用 [Leaflet.js](http://leafletjs.com),并且支持 [geoJSON 规格](http://www.geojson.org/geojson-spec.html)中列出的所有几何类型Point、LineString、Polygon、MultiPoint、MultiLineString、MultiPolygon 和 GeometryCollection。 TopoJSON 文件类型应为 "Topology"(拓扑),并且遵守 [topoJSON 规格](https://github.com/mbostock/topojson/wiki/Specification)。
{% ifversion geoJSON-with-MapBox %}
### 样式功能
您可以传递 geoJSON 对象属性中的其他元数据,自定义功能显示的方式,例如指定特定的颜色或添加描述性图标。 选项包括:
@@ -259,6 +260,7 @@ GitHub 支持呈现 PDF 文档。
* `fill-opacity` - 多边形内部的不透明度 (0.0-1.0)
更多信息请参阅[开放简单样式规格 1.1.0 版](https://github.com/mapbox/simplestyle-spec/tree/master/1.1.0)。
{% endif %}
### 在其他位置嵌入您的地图
@@ -308,8 +310,12 @@ GitHub 支持呈现 PDF 文档。
### 延伸阅读
{% ifversion geoJSON-with-MapBox %}
* [Leaflet.js 文档](https://leafletjs.com/)
* [MapBox marker-styling 文档](http://www.mapbox.com/developers/simplestyle/)
{%- else %}
* [Azure Maps 文档](https://docs.microsoft.com/en-us/azure/azure-maps/)
{%- endif %}
* [TopoJSON Wiki](https://github.com/mbostock/topojson/wiki)
## 在 {% data variables.product.prodname_dotcom %} 上使用 Jupyter Notebook 文件

View File

@@ -15,6 +15,7 @@ miniTocMaxHeadingLevel: 3
children:
- /artifacts
- /cache
- /oidc
- /permissions
- /secrets
- /self-hosted-runner-groups

View File

@@ -0,0 +1,12 @@
---
title: GitHub Actions OIDC
allowTitleToDifferFromFilename: true
shortTitle: OIDC
intro: 'The {% data variables.product.prodname_actions %} OIDC API allows you to customize the JWT token claims.'
topics:
- API
versions:
ghec: '*'
fpt: '*'
---

View File

@@ -9,8 +9,6 @@ topics:
miniTocMaxHeadingLevel: 3
---
{% data reusables.codespaces.codespaces-api-beta-note %}
## 关于代码空间 API
{% data variables.product.prodname_codespaces %} API 允许您使用 REST API 来管理 {% data variables.product.prodname_codespaces %}。 此 API 适用于经过身份验证的用户和 OAuth 应用,但不适用于 GitHub 应用。 更多信息请参阅“[{% data variables.product.prodname_codespaces %}](/codespaces)”。

View File

@@ -10,6 +10,7 @@ topics:
miniTocMaxHeadingLevel: 3
children:
- /codespaces
- /organizations
- /machines
- /repository-secrets
- /secrets

View File

@@ -0,0 +1,18 @@
---
title: Codespaces organizations
allowTitleToDifferFromFilename: true
shortTitle: 组织
intro: The Codespaces organizations API enables you to manage your organization members codespaces using the REST API.
versions:
fpt: '*'
ghec: '*'
topics:
- API
miniTocMaxHeadingLevel: 3
---
{% data reusables.codespaces.codespaces-api-beta-note %}
## About the Codespaces organizations API
The {% data variables.product.prodname_codespaces %} organizations API enables you to manage {% data variables.product.prodname_codespaces %} billed to your organization using the REST API. This API is available for authenticated organization admins and OAuth Apps, but not GitHub Apps. For more information, see "[{% data variables.product.prodname_codespaces %}](/codespaces)."

View File

@@ -1,17 +1,17 @@
---
title: Dependency submission
intro: 'The Dependency submission API allows you to submit dependencies for projects, such as the dependencies resolved when a project is built or compiled.'
title: 依赖项提交
intro: 依赖项提交 API 允许您提交项目的依赖项,例如在构建或编译项目时解析的依赖项。
versions:
feature: dependency-submission-api
miniTocMaxHeadingLevel: 3
---
## About the Dependency submission API
## 关于依赖项提交 API
{% data reusables.dependency-submission.dependency-submission-api-beta %}
{% data reusables.dependency-submission.about-dependency-submission %}
Dependencies are submitted to the dependency submission API in the form of a snapshot. A snapshot is a set of dependencies associated with a commit SHA and other metadata, that reflects the current state of your repository for a commit. You can choose to use pre-made actions or create your own actions to submit your dependencies to the dependency submission API in the required format each time your project is built. For more information about using the Dependency submission API, see "[Using the Dependency submission API](/code-security/supply-chain-security/understanding-your-software-supply-chain/using-the-dependency-submission-api)."
依赖项以快照的形式提交到依赖项提交 API。 快照是一组与提交 SHA 和其他元数据关联的依赖项,它反映了提交存储库的当前状态。 可以选择使用预制操作或创建自己的操作,以便在每次生成项目时以所需的格式将依赖项提交到依赖项提交 API。 有关使用依赖项提交 API 的详细信息,请参阅“[使用依赖项提交 API](/code-security/supply-chain-security/understanding-your-software-supply-chain/using-the-dependency-submission-api)”。
You can submit multiple sets of dependencies to the Dependency submission API to be included in your dependency graph. The API uses the `job.correlator` property and the `detector.name` category of the snapshot to ensure the latest submissions for each workflow get shown. The `correlator` property itself is the primary field you will use to keep independent submissions distinct. An example `correlator` could be a simple combination of two variables available in actions runs: `<GITHUB_WORKFLOW> <GITHUB_JOB>`.
可以将多组依赖项提交到依赖项提交 API以包含在依赖关系图中。 该 API 使用 `job.correlator` 属性和快照的 `detector.name` 类别来确保显示每个工作流程的最新提交。 `correlator` 属性本身是将用于使独立提交保持不同的主字段。 示例 `correlator` 可以是操作运行中可用的两个变量的简单组合: `<GITHUB_WORKFLOW> <GITHUB_JOB>`

View File

@@ -17,46 +17,22 @@ topics:
所有 {% data variables.product.product_name %} 媒体类型如下所示:
application/vnd.github[.version].param[+json]
application/vnd.github.param[+json]
API 支持的最基本媒体类型是:
application/json
application/vnd.github+json
这两者都没有指定[版本][versions],因此您总是会获取资源的当前默认 JSON 表示形式。
application/json
{% note %}
**重要提示:**API 的默认版本将来可能会更改。 如果您要构建应用程序,但担心 API 的稳定性,请务必在 `Accept` 标头中请求特定的版本,如以下示例所示
**注意:** 过去,我们建议在 `Accept` 标头中包含 `v3` 。 这不再是必需的,不会影响您的 API 请求
{% endnote %}
您可以这样指定一个版本
如果你要指定一个属性(例如下面定义的 full/raw/etc 将其放在 `github` 之后
application/vnd.github.v3+json
如果要指定属性(例如下面定义的 full/raw/等等),请将版本放在属性之前:
application/vnd.github.v3.raw+json
您可以通过每个响应的标头检查当前版本。 查看 `X-GitHub-Media-Type` 标头:
```shell
$ curl {% data variables.product.api_url_pre %}/users/technoweenie -I
> HTTP/2 200
> X-GitHub-Media-Type: github.v3
$ curl {% data variables.product.api_url_pre %}/users/technoweenie -I \
$ -H "Accept: application/vnd.github.full+json"
> HTTP/2 200
> X-GitHub-Media-Type: github.v3; param=full; format=json
$ curl {% data variables.product.api_url_pre %}/users/technoweenie -I \
$ -H "Accept: application/vnd.github.v3.full+json"
> HTTP/2 200
> X-GitHub-Media-Type: github.v3; param=full; format=json
```
application/vnd.github.raw+json
## 注释正文属性
@@ -64,25 +40,25 @@ $ -H "Accept: application/vnd.github.v3.full+json"
### Raw
application/vnd.github.VERSION.raw+json
application/vnd.github.raw+json
返回原始 Markdown 正文。 响应将包含 `body`。 这是在不传递任何特定媒体类型时的默认值。
### Text
application/vnd.github.VERSION.text+json
application/vnd.github.text+json
返回 Markdown 正文的纯文本表示形式。 响应将包含 `body_text`
### HTML
application/vnd.github.VERSION.html+json
application/vnd.github.html+json
返回从正文的 Markdown 中渲染的 HTML。 响应将包含 `body_html`
### Full
application/vnd.github.VERSION.full+json
application/vnd.github.full+json
返回 raw、text 和 HTML 表示形式。 响应将包含 `body``body_text``body_html`
@@ -92,14 +68,14 @@ $ -H "Accept: application/vnd.github.v3.full+json"
### JSON
application/vnd.github.VERSION+json
application/vnd.github+json
application/json
返回 blob 的 JSON 表示形式,`content` 为 base64 编码的字符串。 这是在未传递任何参数时的默认值。
### Raw
application/vnd.github.VERSION.raw
application/vnd.github.raw
返回原始 blob 数据。
@@ -109,27 +85,27 @@ $ -H "Accept: application/vnd.github.v3.full+json"
### 差异
application/vnd.github.VERSION.diff
application/vnd.github.diff
### patch
application/vnd.github.VERSION.patch
application/vnd.github.patch
### sha
application/vnd.github.VERSION.sha
application/vnd.github.sha
## 仓库内容
### Raw
application/vnd.github.VERSION.raw
application/vnd.github.raw
返回文件的原始内容。 这是在不传递任何特定媒体类型时的默认值。
### HTML
application/vnd.github.VERSION.html
application/vnd.github.html
对于 Markdown 或 AsciiDoc 等标记文件,您可以使用 `.html` 媒体类型检索渲染的 HTML。 使用我们的开源[标记库](https://github.com/github/markup)将标记语言渲染为 HTML。
@@ -137,17 +113,16 @@ $ -H "Accept: application/vnd.github.v3.full+json"
### Raw
application/vnd.github.VERSION.raw
application/vnd.github.raw
返回 gist 的原始内容。 这是在不传递任何特定媒体类型时的默认值。
### base64
application/vnd.github.VERSION.base64
application/vnd.github.base64
Gist 内容在发送前经过 base64 编码。 这在 gist 包含任何无效的 UTF-8 序列时非常有用。
[gfm]: http://github.github.com/github-flavored-markdown/
[git-diff]: http://git-scm.com/docs/git-diff
[git-patch]: http://git-scm.com/docs/git-format-patch
[versions]: /developers/overview/about-githubs-apis

View File

@@ -20,7 +20,7 @@ miniTocMaxHeadingLevel: 3
{% ifversion fpt or ghes or ghec %}
{% note %}
**注:**当您为具有组织身份提供程序 (IdP) 的团队设置了团队同步时,如果尝试使用 API 更改团队的成员身份,则会看到错误。 如果您有权访问 IdP 中的组成员身份,可以通过身份提供程序管理 GitHub 团队成员身份,该提供程序会自动添加和删除组织的成员。 更多信息请参阅“<a href="/organizations/managing-saml-single-sign-on-for-your-organization/managing-team-synchronization-for-your-organization" class="dotcom-only">在身份提供程序与 GitHub 之间同步团队</a>”。
**注:**当您为具有组织身份提供程序 (IdP) 的团队设置了团队同步时,如果尝试使用 API 更改团队的成员身份,则会看到错误。 如果您有权访问 IdP 中的组成员身份,可以通过身份提供程序管理 GitHub 团队成员身份,该提供程序会自动添加和删除组织的成员。 更多信息请参阅“[在身份提供程序与 GitHub 之间同步团队](/enterprise-cloud@latest/organizations/managing-saml-single-sign-on-for-your-organization/managing-team-synchronization-for-your-organization)”。
{% endnote %}

View File

@@ -12,9 +12,9 @@ allowTitleToDifferFromFilename: true
## 关于团队同步 API
要使用此 API经过身份验证的用户必须是团队维护员或与团队关联的组织的所有者。 用于身份验证的令牌还需要获得授权才能与 IdP (SSO) 提供程序一起使用。 更多信息请参阅“<a href="/github/authenticating-to-github/authorizing-a-personal-access-token-for-use-with-saml-single-sign-on" class="dotcom-only">授权个人访问令牌用于 SAML 单点登录组织</a>”。
要使用此 API经过身份验证的用户必须是团队维护员或与团队关联的组织的所有者。 用于身份验证的令牌还需要获得授权才能与 IdP (SSO) 提供程序一起使用。 更多信息请参阅“[授权个人访问令牌用于 SAML 单点登录组织](/enterprise-cloud@latest/authentication/authenticating-with-saml-single-sign-on/authorizing-a-personal-access-token-for-use-with-saml-single-sign-on)”。
您可以通过 IdP 通过团队同步管理 GitHub 团队成员。 必须启用团队同步才能使用团队同步 API。 更多信息请参阅“<a href="/organizations/managing-saml-single-sign-on-for-your-organization/managing-team-synchronization-for-your-organization" class="dotcom-only">在身份提供程序与 GitHub 之间同步团队</a>”。
您可以通过 IdP 通过团队同步管理 GitHub 团队成员。 必须启用团队同步才能使用团队同步 API。 更多信息请参阅“[在身份提供程序与 GitHub 之间同步团队](/enterprise-cloud@latest/organizations/managing-saml-single-sign-on-for-your-organization/managing-team-synchronization-for-your-organization)”。
{% note %}

Some files were not shown because too many files have changed in this diff Show More