1
0
mirror of synced 2026-01-05 12:07:35 -05:00

New translation batch for cn (#26569)

* Add crowdin translations

* Run script/i18n/homogenize-frontmatter.js

* Run script/i18n/lint-translation-files.js --check rendering

* run script/i18n/reset-files-with-broken-liquid-tags.js --language=cn

* run script/i18n/reset-known-broken-translation-files.js

* Check in cn CSV report

Co-authored-by: Grace Park <gracepark@github.com>
This commit is contained in:
docubot
2022-03-30 16:32:58 -07:00
committed by GitHub
parent 63585d4f1f
commit 33a548bfea
174 changed files with 1476 additions and 1263 deletions

View File

@@ -21,6 +21,7 @@ translations/zh-CN/content/actions/managing-workflow-runs/removing-workflow-arti
translations/zh-CN/content/actions/managing-workflow-runs/reviewing-deployments.md,Listed in localization-support#489
translations/zh-CN/content/actions/security-guides/security-hardening-for-github-actions.md,broken liquid tags
translations/zh-CN/content/actions/using-github-hosted-runners/about-github-hosted-runners.md,broken liquid tags
translations/zh-CN/content/actions/using-workflows/reusing-workflows.md,rendering error
translations/zh-CN/content/actions/using-workflows/storing-workflow-data-as-artifacts.md,broken liquid tags
translations/zh-CN/content/admin/code-security/managing-github-advanced-security-for-your-enterprise/configuring-code-scanning-for-your-appliance.md,broken liquid tags
translations/zh-CN/content/admin/code-security/managing-github-advanced-security-for-your-enterprise/configuring-secret-scanning-for-your-appliance.md,broken liquid tags
@@ -29,11 +30,11 @@ translations/zh-CN/content/admin/configuration/configuring-network-settings/netw
translations/zh-CN/content/admin/configuration/configuring-your-enterprise/accessing-the-management-console.md,broken liquid tags
translations/zh-CN/content/admin/configuration/configuring-your-enterprise/command-line-utilities.md,broken liquid tags
translations/zh-CN/content/admin/configuration/configuring-your-enterprise/configuring-backups-on-your-appliance.md,broken liquid tags
translations/zh-CN/content/admin/configuration/configuring-your-enterprise/configuring-custom-footers.md,broken liquid tags
translations/zh-CN/content/admin/configuration/configuring-your-enterprise/configuring-email-for-notifications.md,broken liquid tags
translations/zh-CN/content/admin/configuration/configuring-your-enterprise/configuring-github-pages-for-your-enterprise.md,broken liquid tags
translations/zh-CN/content/admin/configuration/configuring-your-enterprise/configuring-rate-limits.md,broken liquid tags
translations/zh-CN/content/admin/configuration/configuring-your-enterprise/configuring-the-referrer-policy-for-your-enterprise.md,broken liquid tags
translations/zh-CN/content/admin/configuration/configuring-your-enterprise/managing-github-mobile-for-your-enterprise.md,broken liquid tags
translations/zh-CN/content/admin/configuration/configuring-your-enterprise/site-admin-dashboard.md,broken liquid tags
translations/zh-CN/content/admin/enterprise-management/updating-the-virtual-machine-and-physical-resources/increasing-cpu-or-memory-resources.md,broken liquid tags
translations/zh-CN/content/admin/enterprise-management/updating-the-virtual-machine-and-physical-resources/upgrade-requirements.md,broken liquid tags
@@ -49,6 +50,7 @@ translations/zh-CN/content/admin/github-actions/getting-started-with-github-acti
translations/zh-CN/content/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/getting-started-with-github-actions-for-github-ae.md,broken liquid tags
translations/zh-CN/content/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/getting-started-with-github-actions-for-github-enterprise-cloud.md,broken liquid tags
translations/zh-CN/content/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/getting-started-with-github-actions-for-github-enterprise-server.md,broken liquid tags
translations/zh-CN/content/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/introducing-github-actions-to-your-enterprise.md,broken liquid tags
translations/zh-CN/content/admin/github-actions/index.md,broken liquid tags
translations/zh-CN/content/admin/github-actions/managing-access-to-actions-from-githubcom/about-using-actions-in-your-enterprise.md,broken liquid tags
translations/zh-CN/content/admin/github-actions/managing-access-to-actions-from-githubcom/enabling-automatic-access-to-githubcom-actions-using-github-connect.md,broken liquid tags
@@ -59,6 +61,7 @@ translations/zh-CN/content/admin/github-actions/using-github-actions-in-github-a
translations/zh-CN/content/admin/identity-and-access-management/managing-iam-for-your-enterprise/configuring-saml-single-sign-on-for-your-enterprise.md,broken liquid tags
translations/zh-CN/content/admin/identity-and-access-management/managing-iam-for-your-enterprise/configuring-user-provisioning-for-your-enterprise.md,broken liquid tags
translations/zh-CN/content/admin/identity-and-access-management/managing-iam-for-your-enterprise/index.md,broken liquid tags
translations/zh-CN/content/admin/identity-and-access-management/managing-iam-with-enterprise-managed-users/configuring-scim-provisioning-for-enterprise-managed-users-with-okta.md,broken liquid tags
translations/zh-CN/content/admin/index.md,broken liquid tags
translations/zh-CN/content/admin/installation/setting-up-a-github-enterprise-server-instance/installing-github-enterprise-server-on-aws.md,broken liquid tags
translations/zh-CN/content/admin/overview/about-enterprise-accounts.md,Listed in localization-support#489
@@ -99,6 +102,7 @@ translations/zh-CN/content/billing/managing-billing-for-your-github-account/inde
translations/zh-CN/content/billing/managing-billing-for-your-github-account/upgrading-your-github-subscription.md,rendering error
translations/zh-CN/content/billing/managing-billing-for-your-github-account/viewing-the-subscription-and-usage-for-your-enterprise-account.md,rendering error
translations/zh-CN/content/billing/managing-licenses-for-visual-studio-subscriptions-with-github-enterprise/about-visual-studio-subscriptions-with-github-enterprise.md,broken liquid tags
translations/zh-CN/content/billing/managing-licenses-for-visual-studio-subscriptions-with-github-enterprise/setting-up-visual-studio-subscriptions-with-github-enterprise.md,broken liquid tags
translations/zh-CN/content/billing/managing-your-license-for-github-enterprise/about-licenses-for-github-enterprise.md,broken liquid tags
translations/zh-CN/content/billing/managing-your-license-for-github-enterprise/downloading-your-license-for-github-enterprise.md,rendering error
translations/zh-CN/content/billing/managing-your-license-for-github-enterprise/syncing-license-usage-between-github-enterprise-server-and-github-enterprise-cloud.md,rendering error
@@ -110,6 +114,7 @@ translations/zh-CN/content/code-security/code-scanning/automatically-scanning-yo
translations/zh-CN/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages.md,broken liquid tags
translations/zh-CN/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/index.md,broken liquid tags
translations/zh-CN/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/managing-code-scanning-alerts-for-your-repository.md,broken liquid tags
translations/zh-CN/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/recommended-hardware-resources-for-running-codeql.md,broken liquid tags
translations/zh-CN/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/setting-up-code-scanning-for-a-repository.md,broken liquid tags
translations/zh-CN/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/troubleshooting-the-codeql-workflow.md,Listed in localization-support#489
translations/zh-CN/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/viewing-code-scanning-logs.md,broken liquid tags
@@ -135,7 +140,9 @@ translations/zh-CN/content/code-security/supply-chain-security/understanding-you
translations/zh-CN/content/code-security/supply-chain-security/understanding-your-software-supply-chain/about-the-dependency-graph.md,Listed in localization-support#489
translations/zh-CN/content/code-security/supply-chain-security/understanding-your-software-supply-chain/troubleshooting-the-dependency-graph.md,broken liquid tags
translations/zh-CN/content/codespaces/codespaces-reference/using-github-copilot-in-codespaces.md,broken liquid tags
translations/zh-CN/content/codespaces/customizing-your-codespace/changing-the-machine-type-for-your-codespace.md,broken liquid tags
translations/zh-CN/content/codespaces/customizing-your-codespace/personalizing-codespaces-for-your-account.md,broken liquid tags
translations/zh-CN/content/codespaces/customizing-your-codespace/setting-your-default-editor-for-codespaces.md,broken liquid tags
translations/zh-CN/content/codespaces/developing-in-codespaces/developing-in-a-codespace.md,broken liquid tags
translations/zh-CN/content/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace.md,broken liquid tags
translations/zh-CN/content/codespaces/developing-in-codespaces/using-codespaces-in-visual-studio-code.md,broken liquid tags
@@ -171,6 +178,7 @@ translations/zh-CN/content/get-started/customizing-your-github-workflow/explorin
translations/zh-CN/content/get-started/getting-started-with-git/about-remote-repositories.md,broken liquid tags
translations/zh-CN/content/get-started/getting-started-with-git/updating-credentials-from-the-macos-keychain.md,broken liquid tags
translations/zh-CN/content/get-started/learning-about-github/about-github-advanced-security.md,broken liquid tags
translations/zh-CN/content/get-started/learning-about-github/about-versions-of-github-docs.md,broken liquid tags
translations/zh-CN/content/get-started/learning-about-github/githubs-products.md,rendering error
translations/zh-CN/content/get-started/learning-about-github/types-of-github-accounts.md,broken liquid tags
translations/zh-CN/content/get-started/onboarding/getting-started-with-github-ae.md,broken liquid tags
@@ -215,6 +223,7 @@ translations/zh-CN/content/pages/setting-up-a-github-pages-site-with-jekyll/abou
translations/zh-CN/content/pages/setting-up-a-github-pages-site-with-jekyll/setting-a-markdown-processor-for-your-github-pages-site-using-jekyll.md,broken liquid tags
translations/zh-CN/content/pages/setting-up-a-github-pages-site-with-jekyll/troubleshooting-jekyll-build-errors-for-github-pages-sites.md,broken liquid tags
translations/zh-CN/content/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches.md,broken liquid tags
translations/zh-CN/content/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks.md,broken liquid tags
translations/zh-CN/content/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/displaying-a-sponsor-button-in-your-repository.md,broken liquid tags
translations/zh-CN/content/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-security-and-analysis-settings-for-your-repository.md,broken liquid tags
translations/zh-CN/content/repositories/viewing-activity-and-data-for-your-repository/viewing-deployment-activity-for-your-repository.md,broken liquid tags
@@ -254,7 +263,6 @@ translations/zh-CN/data/reusables/code-scanning/enterprise-enable-code-scanning-
translations/zh-CN/data/reusables/code-scanning/enterprise-enable-code-scanning.md,broken liquid tags
translations/zh-CN/data/reusables/code-scanning/upload-sarif-ghas.md,broken liquid tags
translations/zh-CN/data/reusables/dotcom_billing/downgrade-org-to-free.md,broken liquid tags
translations/zh-CN/data/reusables/enterprise-accounts/actions-packages-report-download-enterprise-accounts.md,broken liquid tags
translations/zh-CN/data/reusables/enterprise_installation/download-appliance.md,broken liquid tags
translations/zh-CN/data/reusables/enterprise_installation/hardware-considerations-all-platforms.md,broken liquid tags
translations/zh-CN/data/reusables/enterprise_installation/upgrade-hardware-requirements.md,broken liquid tags
1 file reason
21 translations/zh-CN/content/actions/managing-workflow-runs/reviewing-deployments.md Listed in localization-support#489
22 translations/zh-CN/content/actions/security-guides/security-hardening-for-github-actions.md broken liquid tags
23 translations/zh-CN/content/actions/using-github-hosted-runners/about-github-hosted-runners.md broken liquid tags
24 translations/zh-CN/content/actions/using-workflows/reusing-workflows.md rendering error
25 translations/zh-CN/content/actions/using-workflows/storing-workflow-data-as-artifacts.md broken liquid tags
26 translations/zh-CN/content/admin/code-security/managing-github-advanced-security-for-your-enterprise/configuring-code-scanning-for-your-appliance.md broken liquid tags
27 translations/zh-CN/content/admin/code-security/managing-github-advanced-security-for-your-enterprise/configuring-secret-scanning-for-your-appliance.md broken liquid tags
30 translations/zh-CN/content/admin/configuration/configuring-your-enterprise/accessing-the-management-console.md broken liquid tags
31 translations/zh-CN/content/admin/configuration/configuring-your-enterprise/command-line-utilities.md broken liquid tags
32 translations/zh-CN/content/admin/configuration/configuring-your-enterprise/configuring-backups-on-your-appliance.md broken liquid tags
33 translations/zh-CN/content/admin/configuration/configuring-your-enterprise/configuring-custom-footers.md broken liquid tags
34 translations/zh-CN/content/admin/configuration/configuring-your-enterprise/configuring-email-for-notifications.md broken liquid tags
35 translations/zh-CN/content/admin/configuration/configuring-your-enterprise/configuring-github-pages-for-your-enterprise.md broken liquid tags
36 translations/zh-CN/content/admin/configuration/configuring-your-enterprise/configuring-rate-limits.md broken liquid tags
37 translations/zh-CN/content/admin/configuration/configuring-your-enterprise/configuring-the-referrer-policy-for-your-enterprise.md broken liquid tags
translations/zh-CN/content/admin/configuration/configuring-your-enterprise/managing-github-mobile-for-your-enterprise.md broken liquid tags
38 translations/zh-CN/content/admin/configuration/configuring-your-enterprise/site-admin-dashboard.md broken liquid tags
39 translations/zh-CN/content/admin/enterprise-management/updating-the-virtual-machine-and-physical-resources/increasing-cpu-or-memory-resources.md broken liquid tags
40 translations/zh-CN/content/admin/enterprise-management/updating-the-virtual-machine-and-physical-resources/upgrade-requirements.md broken liquid tags
50 translations/zh-CN/content/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/getting-started-with-github-actions-for-github-ae.md broken liquid tags
51 translations/zh-CN/content/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/getting-started-with-github-actions-for-github-enterprise-cloud.md broken liquid tags
52 translations/zh-CN/content/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/getting-started-with-github-actions-for-github-enterprise-server.md broken liquid tags
53 translations/zh-CN/content/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/introducing-github-actions-to-your-enterprise.md broken liquid tags
54 translations/zh-CN/content/admin/github-actions/index.md broken liquid tags
55 translations/zh-CN/content/admin/github-actions/managing-access-to-actions-from-githubcom/about-using-actions-in-your-enterprise.md broken liquid tags
56 translations/zh-CN/content/admin/github-actions/managing-access-to-actions-from-githubcom/enabling-automatic-access-to-githubcom-actions-using-github-connect.md broken liquid tags
61 translations/zh-CN/content/admin/identity-and-access-management/managing-iam-for-your-enterprise/configuring-saml-single-sign-on-for-your-enterprise.md broken liquid tags
62 translations/zh-CN/content/admin/identity-and-access-management/managing-iam-for-your-enterprise/configuring-user-provisioning-for-your-enterprise.md broken liquid tags
63 translations/zh-CN/content/admin/identity-and-access-management/managing-iam-for-your-enterprise/index.md broken liquid tags
64 translations/zh-CN/content/admin/identity-and-access-management/managing-iam-with-enterprise-managed-users/configuring-scim-provisioning-for-enterprise-managed-users-with-okta.md broken liquid tags
65 translations/zh-CN/content/admin/index.md broken liquid tags
66 translations/zh-CN/content/admin/installation/setting-up-a-github-enterprise-server-instance/installing-github-enterprise-server-on-aws.md broken liquid tags
67 translations/zh-CN/content/admin/overview/about-enterprise-accounts.md Listed in localization-support#489
102 translations/zh-CN/content/billing/managing-billing-for-your-github-account/upgrading-your-github-subscription.md rendering error
103 translations/zh-CN/content/billing/managing-billing-for-your-github-account/viewing-the-subscription-and-usage-for-your-enterprise-account.md rendering error
104 translations/zh-CN/content/billing/managing-licenses-for-visual-studio-subscriptions-with-github-enterprise/about-visual-studio-subscriptions-with-github-enterprise.md broken liquid tags
105 translations/zh-CN/content/billing/managing-licenses-for-visual-studio-subscriptions-with-github-enterprise/setting-up-visual-studio-subscriptions-with-github-enterprise.md broken liquid tags
106 translations/zh-CN/content/billing/managing-your-license-for-github-enterprise/about-licenses-for-github-enterprise.md broken liquid tags
107 translations/zh-CN/content/billing/managing-your-license-for-github-enterprise/downloading-your-license-for-github-enterprise.md rendering error
108 translations/zh-CN/content/billing/managing-your-license-for-github-enterprise/syncing-license-usage-between-github-enterprise-server-and-github-enterprise-cloud.md rendering error
114 translations/zh-CN/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages.md broken liquid tags
115 translations/zh-CN/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/index.md broken liquid tags
116 translations/zh-CN/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/managing-code-scanning-alerts-for-your-repository.md broken liquid tags
117 translations/zh-CN/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/recommended-hardware-resources-for-running-codeql.md broken liquid tags
118 translations/zh-CN/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/setting-up-code-scanning-for-a-repository.md broken liquid tags
119 translations/zh-CN/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/troubleshooting-the-codeql-workflow.md Listed in localization-support#489
120 translations/zh-CN/content/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/viewing-code-scanning-logs.md broken liquid tags
140 translations/zh-CN/content/code-security/supply-chain-security/understanding-your-software-supply-chain/about-the-dependency-graph.md Listed in localization-support#489
141 translations/zh-CN/content/code-security/supply-chain-security/understanding-your-software-supply-chain/troubleshooting-the-dependency-graph.md broken liquid tags
142 translations/zh-CN/content/codespaces/codespaces-reference/using-github-copilot-in-codespaces.md broken liquid tags
143 translations/zh-CN/content/codespaces/customizing-your-codespace/changing-the-machine-type-for-your-codespace.md broken liquid tags
144 translations/zh-CN/content/codespaces/customizing-your-codespace/personalizing-codespaces-for-your-account.md broken liquid tags
145 translations/zh-CN/content/codespaces/customizing-your-codespace/setting-your-default-editor-for-codespaces.md broken liquid tags
146 translations/zh-CN/content/codespaces/developing-in-codespaces/developing-in-a-codespace.md broken liquid tags
147 translations/zh-CN/content/codespaces/developing-in-codespaces/forwarding-ports-in-your-codespace.md broken liquid tags
148 translations/zh-CN/content/codespaces/developing-in-codespaces/using-codespaces-in-visual-studio-code.md broken liquid tags
178 translations/zh-CN/content/get-started/getting-started-with-git/about-remote-repositories.md broken liquid tags
179 translations/zh-CN/content/get-started/getting-started-with-git/updating-credentials-from-the-macos-keychain.md broken liquid tags
180 translations/zh-CN/content/get-started/learning-about-github/about-github-advanced-security.md broken liquid tags
181 translations/zh-CN/content/get-started/learning-about-github/about-versions-of-github-docs.md broken liquid tags
182 translations/zh-CN/content/get-started/learning-about-github/githubs-products.md rendering error
183 translations/zh-CN/content/get-started/learning-about-github/types-of-github-accounts.md broken liquid tags
184 translations/zh-CN/content/get-started/onboarding/getting-started-with-github-ae.md broken liquid tags
223 translations/zh-CN/content/pages/setting-up-a-github-pages-site-with-jekyll/setting-a-markdown-processor-for-your-github-pages-site-using-jekyll.md broken liquid tags
224 translations/zh-CN/content/pages/setting-up-a-github-pages-site-with-jekyll/troubleshooting-jekyll-build-errors-for-github-pages-sites.md broken liquid tags
225 translations/zh-CN/content/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-branches.md broken liquid tags
226 translations/zh-CN/content/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks.md broken liquid tags
227 translations/zh-CN/content/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/displaying-a-sponsor-button-in-your-repository.md broken liquid tags
228 translations/zh-CN/content/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-security-and-analysis-settings-for-your-repository.md broken liquid tags
229 translations/zh-CN/content/repositories/viewing-activity-and-data-for-your-repository/viewing-deployment-activity-for-your-repository.md broken liquid tags
263 translations/zh-CN/data/reusables/code-scanning/enterprise-enable-code-scanning.md broken liquid tags
264 translations/zh-CN/data/reusables/code-scanning/upload-sarif-ghas.md broken liquid tags
265 translations/zh-CN/data/reusables/dotcom_billing/downgrade-org-to-free.md broken liquid tags
translations/zh-CN/data/reusables/enterprise-accounts/actions-packages-report-download-enterprise-accounts.md broken liquid tags
266 translations/zh-CN/data/reusables/enterprise_installation/download-appliance.md broken liquid tags
267 translations/zh-CN/data/reusables/enterprise_installation/hardware-considerations-all-platforms.md broken liquid tags
268 translations/zh-CN/data/reusables/enterprise_installation/upgrade-hardware-requirements.md broken liquid tags

View File

@@ -16,10 +16,6 @@ topics:
- Notifications
---
{% ifversion ghes %}
{% data reusables.mobile.ghes-release-phase %}
{% endif %}
## 通知和订阅
您可以选择通过订阅接收有关 {% data variables.product.product_location %} 上特定活动的持续更新。 通知是您收到的已订阅特定活动的更新。

View File

@@ -23,9 +23,6 @@ versions:
topics:
- Notifications
---
{% ifversion ghes %}
{% data reusables.mobile.ghes-release-phase %}
{% endif %}
## Notification delivery options

View File

@@ -16,10 +16,6 @@ topics:
shortTitle: 从收件箱管理
---
{% ifversion ghes %}
{% data reusables.mobile.ghes-release-phase %}
{% endif %}
## 关于收件箱
{% ifversion fpt or ghes or ghec %}

View File

@@ -1,19 +1,19 @@
---
title: Managing accessibility settings
intro: 'You can disable character key shortcuts on {% data variables.product.prodname_dotcom %} in your accessibility settings.'
title: 管理辅助功能设置
intro: '您可以在 {% data variables.product.prodname_dotcom %} 上的辅助功能设置中禁用字符键快捷方式。'
versions:
feature: keyboard-shortcut-accessibility-setting
---
## About accessibility settings
## 关于辅助功能设置
{% data variables.product.product_name %} includes a variety of keyboard shortcuts so that you can perform actions across the site without using your mouse to navigate. While shortcuts are useful to save time, they can sometimes make {% data variables.product.prodname_dotcom %} harder to use and less accessible.
{% data variables.product.product_name %} 包括各种键盘快捷键,便于您在整个站点中执行操作,而无需使用鼠标进行导航。 虽然快捷方式有助于节省时间,但它们有时会使 {% data variables.product.prodname_dotcom %} 更难使用且更难以访问。
All keyboard shortcuts are enabled by default on {% data variables.product.product_name %}, but you can choose to disable character key shortcuts in your accessibility settings. This setting does not affect keyboard shortcuts provided by your web browser or {% data variables.product.prodname_dotcom %} shortcuts that use a modifier key such as <kbd>Control</kbd> or <kbd>Command</kbd>.
默认情况下,所有键盘快捷键都在 {% data variables.product.product_name %} 上启用,但您可以选择在辅助功能设置中禁用字符键快捷键。 此设置不影响 Web 浏览器提供的键盘快捷键,或者使用修饰键(如 <kbd>Control</kbd> 或 <kbd>Command</kbd>)的 {% data variables.product.prodname_dotcom %} 快捷键。
## Managing character key shortcuts
## 管理字符键快捷方式
{% data reusables.user-settings.access_settings %}
{% data reusables.user-settings.accessibility_settings %}
1. Select or deselect the **Enable character key shortcuts** checkbox. ![Screenshot of the 'Enable character key shortcuts' checkbox](/assets/images/help/settings/disable-character-key-shortcuts.png)
1. 选中或取消选中 **Enable character key shortcuts(启用字符键快捷键)**复选框。 ![“启用字符键快捷方式”复选框的屏幕截图](/assets/images/help/settings/disable-character-key-shortcuts.png)
2. 单击 **Save保存**

View File

@@ -20,11 +20,13 @@ shortTitle: 管理主题设置
{% ifversion fpt or ghes > 3.2 or ghae-issue-4618 or ghec %}如果您视力不佳,则可以从前景和背景元素之间对比度更高的高对比度主题中受益。{% endif %}{% ifversion fpt or ghae-issue-4619 or ghec %} 如果您有色盲,可能会从我们的浅色盲和深色盲主题中受益。
{% ifversion fpt or ghec %}
{% note %}
**注意:**色盲主题目前处于公开测试阶段。 有关在公开测试版中启用功能的更多信息,请参阅“[使用功能预览版探索抢先体验版本](/get-started/using-github/exploring-early-access-releases-with-feature-preview)”。
{% endnote %}
{% endif %}
{% endif %}
@@ -41,7 +43,7 @@ shortTitle: 管理主题设置
- 如果您选择遵循系统设置,请单击白天主题和夜间主题。
{% ifversion fpt or ghes > 3.2 or ghae-issue-4618 or ghec %}![Buttons for the choice of a theme to sync with the system setting](/assets/images/help/settings/theme-choose-a-day-and-night-theme-to-sync-highcontrast.png){% else %}![Buttons for the choice of a theme to sync with the system setting](/assets/images/help/settings/theme-choose-a-day-and-night-theme-to-sync.png){% endif %}
{% ifversion fpt or ghae-issue-4619 or ghec %}
{% ifversion fpt or ghec %}
- 如果您想选择当前处于公开测试阶段的主题,则首先需要通过功能预览启用它。 更多信息请参阅“[通过功能预览了解早期访问版本](/get-started/using-github/exploring-early-access-releases-with-feature-preview)”。{% endif %}
{% if command-palette %}

View File

@@ -31,7 +31,9 @@ shortTitle: 合并多个用户帐户
{% warning %}
**警告:** 组织和存储库访问权限不可在帐户之间转移。 如果要删除的帐户具有现有访问权限,则组织所有者或存储库管理员将需要邀请您要保留的帐户。
**警告:**
- Organization and repository access permissions aren't transferable between accounts. 如果要删除的帐户具有现有访问权限,则组织所有者或存储库管理员将需要邀请您要保留的帐户。
- Any commits authored with a GitHub-provided `noreply` email address cannot be transferred from one account to another. If the account you want to delete used the **Keep my email address private** option, it won't be possible to transfer the commits authored by the account you are deleting to the account you want to keep.
{% endwarning %}

View File

@@ -43,11 +43,11 @@ shortTitle: 查看组织中的人员
{% endnote %}
| **企业角色** | **组织角色** | **组织访问或影响** |
| -------- | ------------------ | ------------------------------ |
| 企业所有者 | 非附属或无官方组织角色 | 无法访问组织内容或存储库,但可管理影响组织的企业设置和策略。 |
| 企业所有者 | Organization owner | 能够配置组织设置并通过团队等管理对组织资源的访问。 |
| 企业所有者 | 组织成员 | 能够访问组织资源和内容(如存储库),而无需访问组织的设置。 |
| **企业角色** | **组织角色** | **组织访问或影响** |
| -------- | ----------- | ------------------------------ |
| 企业所有者 | 非附属或无官方组织角色 | 无法访问组织内容或存储库,但可管理影响组织的企业设置和策略。 |
| 企业所有者 | 组织所有者 | 能够配置组织设置并通过团队等管理对组织资源的访问。 |
| 企业所有者 | 组织成员 | 能够访问组织资源和内容(如存储库),而无需访问组织的设置。 |
要查看组织中的所有角色,请参阅“[组织中的角色](/organizations/managing-peoples-access-to-your-organization-with-roles/roles-in-an-organization)”。 {% ifversion ghec %} 组织成员还可以具有特定存储库的自定义角色。 更多信息请参阅“[管理组织的自定义仓库角色](/organizations/managing-peoples-access-to-your-organization-with-roles/managing-custom-repository-roles-for-an-organization)”。{% endif %}

View File

@@ -96,7 +96,7 @@ runs:
```
{% endraw %}
此元数据定义一个 `who-to-greet` 输入和一个 `time` 输出参数。 要将输入传递给 Docker 容器,您必须使用 `inputs` 声明输入并以 `args` 关键词传递输入。
此元数据定义一个 `who-to-greet` 输入和一个 `time` 输出参数。 To pass inputs to the Docker container, you should declare the input using `inputs` and pass the input in the `args` keyword. Everything you include in `args` is passed to the container, but for better discoverability for users of your action, we recommended using inputs.
{% data variables.product.prodname_dotcom %} 将从 `Dockerfile` 构建映像,然后使用此映像在新容器中运行命令。

View File

@@ -1,6 +1,6 @@
---
title: Deploying Docker to Azure App Service
intro: You can deploy a Docker container to Azure App Service as part of your continuous deployment (CD) workflows.
title: Docker 部署到 Azure App Service
intro: 作为持续部署 (CD) 工作流程的一部分,您可以将 Docker 容器部署到 Azure App Service。
versions:
fpt: '*'
ghes: '*'
@@ -19,13 +19,13 @@ topics:
## 简介
This guide explains how to use {% data variables.product.prodname_actions %} to build and deploy a Docker container to [Azure App Service](https://azure.microsoft.com/services/app-service/).
本指南说明如何使用 {% data variables.product.prodname_actions %} 构建并部署 Docker 容器到 [Azure App Service](https://azure.microsoft.com/services/app-service/)
{% ifversion fpt or ghec or ghae-issue-4856 %}
{% note %}
**Note**: {% data reusables.actions.about-oidc-short-overview %} and "[Configuring OpenID Connect in Azure](/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-azure)."
**注意**{% data reusables.actions.about-oidc-short-overview %} 和“[在 Azure 中配置 OpenID Connect](/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-azure)”。
{% endnote %}
@@ -39,7 +39,7 @@ This guide explains how to use {% data variables.product.prodname_actions %} to
1. 创建 Web 应用。
For example, you can use the Azure CLI to create an Azure App Service web app:
例如,可以使用 Azure CLI 创建 Azure App Service web app
```bash{:copy}
az webapp create \
@@ -53,11 +53,11 @@ This guide explains how to use {% data variables.product.prodname_actions %} to
{% data reusables.actions.create-azure-publish-profile %}
1. Set registry credentials for your web app.
1. 设置 web app 的注册表凭据。
Create a personal access token with the `repo` and `read:packages` scopes. 更多信息请参阅“[创建个人访问令牌](/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)”。
创建具有 `repo` `read:packages` 作用域的个人访问令牌。 更多信息请参阅“[创建个人访问令牌](/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)”。
Set `DOCKER_REGISTRY_SERVER_URL` to `https://ghcr.io`, `DOCKER_REGISTRY_SERVER_USERNAME` to the GitHub username or organization that owns the repository, and `DOCKER_REGISTRY_SERVER_PASSWORD` to your personal access token from above. This will give your web app credentials so it can pull the container image after your workflow pushes a newly built image to the registry. You can do this with the following Azure CLI command:
`DOCKER_REGISTRY_SERVER_URL` 设置为 `https://ghcr.io`,将 `DOCKER_REGISTRY_SERVER_USERNAME` 设置为拥有该存储库的 GitHub 用户名或组织,将 `DOCKER_REGISTRY_SERVER_PASSWORD` 设置为上面的个人访问令牌。 这将提供 Web 应用凭据,以便在工作流程将新构建的映像推送到注册表后,它可以拉取容器映像。 可以使用以下 Azure CLI 命令执行此操作:
```shell
az webapp config appsettings set \
@@ -72,7 +72,7 @@ This guide explains how to use {% data variables.product.prodname_actions %} to
完成先决条件后,可以继续创建工作流程。
The following example workflow demonstrates how to build and deploy a Docker container to Azure App Service when there is a push to the `main` branch.
以下示例工作流演程示在推送到 `main` 分支时,如何构建 Docker 容器并将其部署到 Azure App Service。
确保在工作流程 `env` 中将 `AZURE_WEBAPP_NAME` 密钥设置为您创建的 web 应用程序名称。
@@ -150,4 +150,4 @@ jobs:
* 有关原始入门工作流程,请参阅 {% data variables.product.prodname_actions %} `starter-workflows` 仓库中的 [`azure-container-webapp.yml`](https://github.com/actions/starter-workflows/blob/main/deployments/azure-container-webapp.yml)。
* 用于部署 Web 应用的操作是正式的 Azure [`Azure/webapps-deploy`](https://github.com/Azure/webapps-deploy) 操作。
* For more examples of GitHub Action workflows that deploy to Azure, see the [actions-workflow-samples](https://github.com/Azure/actions-workflow-samples) repository.
* 有关部署到 Azure 的 GitHub 操作工作流程的更多示例,请参阅 [actions-workflow-samples](https://github.com/Azure/actions-workflow-samples) 存储库。

View File

@@ -1,6 +1,6 @@
---
title: Deploying Java to Azure App Service
intro: You can deploy your Java project to Azure App Service as part of your continuous deployment (CD) workflows.
title: Java 部署到 Azure App Service
intro: 作为持续部署 (CD) 工作流程的一部分,您可以将 Java 项目部署到 Azure App Service。
versions:
fpt: '*'
ghes: '*'
@@ -18,13 +18,13 @@ topics:
## 简介
This guide explains how to use {% data variables.product.prodname_actions %} to build and deploy a Java project to [Azure App Service](https://azure.microsoft.com/services/app-service/).
本指南说明如何使用 {% data variables.product.prodname_actions %} 构建并部署 Java 项目到 [Azure App Service](https://azure.microsoft.com/services/app-service/)
{% ifversion fpt or ghec or ghae-issue-4856 %}
{% note %}
**Note**: {% data reusables.actions.about-oidc-short-overview %} and "[Configuring OpenID Connect in Azure](/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-azure)."
**注意**{% data reusables.actions.about-oidc-short-overview %} 和“[在 Azure 中配置 OpenID Connect](/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-azure)”。
{% endnote %}
@@ -38,7 +38,7 @@ This guide explains how to use {% data variables.product.prodname_actions %} to
1. 创建 Web 应用。
For example, you can use the Azure CLI to create an Azure App Service web app with a Java runtime:
例如,可以使用 Azure CLI 创建具有 Java 运行时的 Azure App Service Web 应用:
```bash{:copy}
az webapp create \
@@ -58,9 +58,9 @@ This guide explains how to use {% data variables.product.prodname_actions %} to
完成先决条件后,可以继续创建工作流程。
The following example workflow demonstrates how to build and deploy a Java project to Azure App Service when there is a push to the `main` branch.
以下示例工作流演程示在推送到 `main` 分支时,如何构建 Java 项目并将其部署到 Azure App Service。
确保在工作流程 `env` 中将 `AZURE_WEBAPP_NAME` 密钥设置为您创建的 web 应用程序名称。 If you want to use a Java version other than `11`, change `JAVA_VERSION`.
确保在工作流程 `env` 中将 `AZURE_WEBAPP_NAME` 密钥设置为您创建的 web 应用程序名称。 如果要使用 `11` 以外的 Java 版本,请更改 `JAVA_VERSION`
{% data reusables.actions.delete-env-key %}
@@ -128,4 +128,4 @@ jobs:
* 有关原始入门工作流程,请参阅 {% data variables.product.prodname_actions %} `starter-workflows` 仓库中的 [`azure-webapps-java-jar.yml`](https://github.com/actions/starter-workflows/blob/main/deployments/azure-webapps-java-jar.yml)。
* 用于部署 Web 应用的操作是正式的 Azure [`Azure/webapps-deploy`](https://github.com/Azure/webapps-deploy) 操作。
* For more examples of GitHub Action workflows that deploy to Azure, see the [actions-workflow-samples](https://github.com/Azure/actions-workflow-samples) repository.
* 有关部署到 Azure 的 GitHub 操作工作流程的更多示例,请参阅 [actions-workflow-samples](https://github.com/Azure/actions-workflow-samples) 存储库。

View File

@@ -1,6 +1,6 @@
---
title: Deploying .NET to Azure App Service
intro: You can deploy your .NET project to Azure App Service as part of your continuous deployment (CD) workflows.
title: .NET 部署到 Azure App Service
intro: 作为持续部署 (CD) 工作流程的一部分,您可以将 .NET 项目部署到 Azure App Service。
versions:
fpt: '*'
ghes: '*'
@@ -17,13 +17,13 @@ topics:
## 简介
This guide explains how to use {% data variables.product.prodname_actions %} to build and deploy a .NET project to [Azure App Service](https://azure.microsoft.com/services/app-service/).
本指南说明如何使用 {% data variables.product.prodname_actions %} 构建并部署 .NET 项目到 [Azure App Service](https://azure.microsoft.com/services/app-service/)
{% ifversion fpt or ghec or ghae-issue-4856 %}
{% note %}
**Note**: {% data reusables.actions.about-oidc-short-overview %} and "[Configuring OpenID Connect in Azure](/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-azure)."
**注意**{% data reusables.actions.about-oidc-short-overview %} 和“[在 Azure 中配置 OpenID Connect](/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-azure)”。
{% endnote %}
@@ -37,7 +37,7 @@ This guide explains how to use {% data variables.product.prodname_actions %} to
2. 创建 Web 应用。
For example, you can use the Azure CLI to create an Azure App Service web app with a .NET runtime:
例如,可以使用 Azure CLI 创建具有 .NET 运行时的 Azure App Service Web 应用:
```bash{:copy}
az webapp create \
@@ -57,9 +57,9 @@ This guide explains how to use {% data variables.product.prodname_actions %} to
完成先决条件后,可以继续创建工作流程。
The following example workflow demonstrates how to build and deploy a .NET project to Azure App Service when there is a push to the `main` branch.
以下示例工作流演程示在推送到 `main` 分支时,如何构建 .NET 项目并将其部署到 Azure App Service。
确保在工作流程 `env` 中将 `AZURE_WEBAPP_NAME` 密钥设置为您创建的 web 应用程序名称。 If the path to your project is not the repository root, change `AZURE_WEBAPP_PACKAGE_PATH`. If you use a version of .NET other than `5`, change `DOTNET_VERSION`.
确保在工作流程 `env` 中将 `AZURE_WEBAPP_NAME` 密钥设置为您创建的 web 应用程序名称。 如果项目的路径不是存储库根目录,请更改 `AZURE_WEBAPP_PACKAGE_PATH` 如果使用的是 `5` 以外的 .NET 版本,请更改 `DOTNET_VERSION`
{% data reusables.actions.delete-env-key %}
@@ -138,4 +138,4 @@ jobs:
* 有关原始入门工作流程,请参阅 {% data variables.product.prodname_actions %} `starter-workflows` 仓库中的 [`azure-webapps-dotnet-core.yml`](https://github.com/actions/starter-workflows/blob/main/deployments/azure-webapps-dotnet-core.yml)。
* 用于部署 Web 应用的操作是正式的 Azure [`Azure/webapps-deploy`](https://github.com/Azure/webapps-deploy) 操作。
* For more examples of GitHub Action workflows that deploy to Azure, see the [actions-workflow-samples](https://github.com/Azure/actions-workflow-samples) repository.
* 有关部署到 Azure 的 GitHub 操作工作流程的更多示例,请参阅 [actions-workflow-samples](https://github.com/Azure/actions-workflow-samples) 存储库。

View File

@@ -1,6 +1,6 @@
---
title: Deploying Node.js to Azure App Service
intro: You can deploy your Node.js project to Azure App Service as part of your continuous deployment (CD) workflows.
title: Node.js 部署到 Azure App Service
intro: 作为持续部署 (CD) 工作流程的一部分,您可以将 Node.js 部署到 Azure App Service。
redirect_from:
- /actions/guides/deploying-to-azure-app-service
- /actions/deployment/deploying-to-azure-app-service
@@ -23,13 +23,13 @@ topics:
## 简介
This guide explains how to use {% data variables.product.prodname_actions %} to build, test, and deploy a Node.js project to [Azure App Service](https://azure.microsoft.com/services/app-service/).
本指南说明如何使用 {% data variables.product.prodname_actions %} 构建、测试并部署 Node.js 项目到 [Azure App Service](https://azure.microsoft.com/services/app-service/)
{% ifversion fpt or ghec or ghae-issue-4856 %}
{% note %}
**Note**: {% data reusables.actions.about-oidc-short-overview %} and "[Configuring OpenID Connect in Azure](/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-azure)."
**注意**{% data reusables.actions.about-oidc-short-overview %} 和“[在 Azure 中配置 OpenID Connect](/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-azure)”。
{% endnote %}
@@ -43,7 +43,7 @@ This guide explains how to use {% data variables.product.prodname_actions %} to
2. 创建 Web 应用。
For example, you can use the Azure CLI to create an Azure App Service web app with a Node.js runtime:
例如,可以使用 Azure CLI 创建具有 Node.js 运行时的 Azure App Service Web 应用:
```bash{:copy}
az webapp create \
@@ -63,9 +63,9 @@ This guide explains how to use {% data variables.product.prodname_actions %} to
完成先决条件后,可以继续创建工作流程。
The following example workflow demonstrates how to build, test, and deploy the Node.js project to Azure App Service when there is a push to the `main` branch.
以下示例工作流演程示在推送到 `main` 分支时,如何构建、测试 Node.js 项目并将其部署到 Azure App Service。
确保在工作流程 `env` 中将 `AZURE_WEBAPP_NAME` 密钥设置为您创建的 web 应用程序名称。 If the path to your project is not the repository root, change `AZURE_WEBAPP_PACKAGE_PATH` to your project path. If you use a version of Node.js other than `10.x`, change `NODE_VERSION` to the version that you use.
确保在工作流程 `env` 中将 `AZURE_WEBAPP_NAME` 密钥设置为您创建的 web 应用程序名称。 如果项目的路径不是存储库根目录,请将 `AZURE_WEBAPP_PACKAGE_PATH` 更改为您的项目路径。 如果使用的 Node.js 版本不是 `10.x`,请将 `NODE_VERSION` 更改为您使用的版本。
{% data reusables.actions.delete-env-key %}
@@ -133,5 +133,5 @@ jobs:
* 有关原始入门工作流程,请参阅 {% data variables.product.prodname_actions %} `starter-workflows` 仓库中的 [`azure-webapps-node.yml`](https://github.com/actions/starter-workflows/blob/main/deployments/azure-webapps-node.yml)。
* 用于部署 Web 应用的操作是正式的 Azure [`Azure/webapps-deploy`](https://github.com/Azure/webapps-deploy) 操作。
* For more examples of GitHub Action workflows that deploy to Azure, see the [actions-workflow-samples](https://github.com/Azure/actions-workflow-samples) repository.
* 有关部署到 Azure 的 GitHub 操作工作流程的更多示例,请参阅 [actions-workflow-samples](https://github.com/Azure/actions-workflow-samples) 存储库。
* Azure web 应用文档中的“[在 Azure 中创建 Node.js web 应用](https://docs.microsoft.com/azure/app-service/quickstart-nodejs)”快速入门说明如何通过 [Azure App Service 扩展](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azureappservice)使用 VS Code。

View File

@@ -1,6 +1,6 @@
---
title: Deploying PHP to Azure App Service
intro: You can deploy your PHP project to Azure App Service as part of your continuous deployment (CD) workflows.
title: PHP 部署到 Azure App Service
intro: 作为持续部署 (CD) 工作流程的一部分,您可以将 PHP 项目部署到 Azure App Service。
versions:
fpt: '*'
ghes: '*'
@@ -17,13 +17,13 @@ topics:
## 简介
This guide explains how to use {% data variables.product.prodname_actions %} to build and deploy a PHP project to [Azure App Service](https://azure.microsoft.com/services/app-service/).
本指南说明如何使用 {% data variables.product.prodname_actions %} 构建并部署 PHP 项目到 [Azure App Service](https://azure.microsoft.com/services/app-service/)
{% ifversion fpt or ghec or ghae-issue-4856 %}
{% note %}
**Note**: {% data reusables.actions.about-oidc-short-overview %} and "[Configuring OpenID Connect in Azure](/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-azure)."
**注意**{% data reusables.actions.about-oidc-short-overview %} 和“[在 Azure 中配置 OpenID Connect](/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-azure)”。
{% endnote %}
@@ -37,7 +37,7 @@ This guide explains how to use {% data variables.product.prodname_actions %} to
2. 创建 Web 应用。
For example, you can use the Azure CLI to create an Azure App Service web app with a PHP runtime:
例如,可以使用 Azure CLI 创建具有 PHP 运行时的 Azure App Service Web 应用:
```bash{:copy}
az webapp create \
@@ -57,9 +57,9 @@ This guide explains how to use {% data variables.product.prodname_actions %} to
完成先决条件后,可以继续创建工作流程。
The following example workflow demonstrates how to build and deploy a PHP project to Azure App Service when there is a push to the `main` branch.
以下示例工作流演程示在推送到 `main` 分支时,如何构建 PHP 项目并将其部署到 Azure App Service。
确保在工作流程 `env` 中将 `AZURE_WEBAPP_NAME` 密钥设置为您创建的 web 应用程序名称。 If the path to your project is not the repository root, change `AZURE_WEBAPP_PACKAGE_PATH` to the path to your project. If you use a version of PHP other than `8.x`, change`PHP_VERSION` to the version that you use.
确保在工作流程 `env` 中将 `AZURE_WEBAPP_NAME` 密钥设置为您创建的 web 应用程序名称。 如果项目的路径不是存储库根目录,请将 `AZURE_WEBAPP_PACKAGE_PATH` 更改为您的项目路径。 如果使用的 PHP 版本不是 `8.x`,请将 `NODE_VERSION` 更改为您使用的版本。
{% data reusables.actions.delete-env-key %}
@@ -149,4 +149,4 @@ jobs:
* 有关原始入门工作流程,请参阅 {% data variables.product.prodname_actions %} `starter-workflows` 仓库中的 [`azure-webapps-php.yml`](https://github.com/actions/starter-workflows/blob/main/deployments/azure-webapps-php.yml)。
* 用于部署 Web 应用的操作是正式的 Azure [`Azure/webapps-deploy`](https://github.com/Azure/webapps-deploy) 操作。
* For more examples of GitHub Action workflows that deploy to Azure, see the [actions-workflow-samples](https://github.com/Azure/actions-workflow-samples) repository.
* 有关部署到 Azure 的 GitHub 操作工作流程的更多示例,请参阅 [actions-workflow-samples](https://github.com/Azure/actions-workflow-samples) 存储库。

View File

@@ -1,6 +1,6 @@
---
title: Deploying Python to Azure App Service
intro: You can deploy your Python project to Azure App Service as part of your continuous deployment (CD) workflows.
title: Python 部署到 Azure App Service
intro: 作为持续部署 (CD) 工作流程的一部分,您可以将 Python 项目部署到 Azure App Service。
versions:
fpt: '*'
ghes: '*'
@@ -18,13 +18,13 @@ topics:
## 简介
This guide explains how to use {% data variables.product.prodname_actions %} to build and deploy a Python project to [Azure App Service](https://azure.microsoft.com/services/app-service/).
本指南说明如何使用 {% data variables.product.prodname_actions %} 构建并部署 Python 项目到 [Azure App Service](https://azure.microsoft.com/services/app-service/)
{% ifversion fpt or ghec or ghae-issue-4856 %}
{% note %}
**Note**: {% data reusables.actions.about-oidc-short-overview %} and "[Configuring OpenID Connect in Azure](/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-azure)."
**注意**{% data reusables.actions.about-oidc-short-overview %} 和“[在 Azure 中配置 OpenID Connect](/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-azure)”。
{% endnote %}
@@ -38,7 +38,7 @@ This guide explains how to use {% data variables.product.prodname_actions %} to
1. 创建 Web 应用。
For example, you can use the Azure CLI to create an Azure App Service web app with a Python runtime:
例如,可以使用 Azure CLI 创建具有 Python 运行时的 Azure App Service Web 应用:
```bash{:copy}
az webapp create \
@@ -52,7 +52,7 @@ This guide explains how to use {% data variables.product.prodname_actions %} to
{% data reusables.actions.create-azure-publish-profile %}
1. Add an app setting called `SCM_DO_BUILD_DURING_DEPLOYMENT` and set the value to `1`.
1. 添加名为 `SCM_DO_BUILD_DURING_DEPLOYMENT` 的应用设置,并将该值设置为 `1`
5. Optionally, configure a deployment environment. {% data reusables.actions.about-environments %}
@@ -60,9 +60,9 @@ This guide explains how to use {% data variables.product.prodname_actions %} to
完成先决条件后,可以继续创建工作流程。
The following example workflow demonstrates how to build and deploy a Python project to Azure App Service when there is a push to the `main` branch.
以下示例工作流演程示在推送到 `main` 分支时,如何构建 Python 项目并将其部署到 Azure App Service。
确保在工作流程 `env` 中将 `AZURE_WEBAPP_NAME` 密钥设置为您创建的 web 应用程序名称。 If you use a version of Python other than `3.8`, change `PYTHON_VERSION` to the version that you use.
确保在工作流程 `env` 中将 `AZURE_WEBAPP_NAME` 密钥设置为您创建的 web 应用程序名称。 如果使用的 Python 版本不是 `3.8x`,请将 `NODE_VERSION` 更改为您使用的版本。
{% data reusables.actions.delete-env-key %}
@@ -143,6 +143,6 @@ jobs:
以下资源也可能有用:
* For the original starter workflow, see [`azure-webapps-python.yml`](https://github.com/actions/starter-workflows/blob/main/deployments/azure-webapps-python.yml) in the {% data variables.product.prodname_actions %} `starter-workflows` repository.
* 有关原始入门工作流程,请参阅 {% data variables.product.prodname_actions %} `starter-workflows` 仓库中的 [`azure-webapps-python.yml`](https://github.com/actions/starter-workflows/blob/main/deployments/azure-webapps-python.yml)
* 用于部署 Web 应用的操作是正式的 Azure [`Azure/webapps-deploy`](https://github.com/Azure/webapps-deploy) 操作。
* For more examples of GitHub Action workflows that deploy to Azure, see the [actions-workflow-samples](https://github.com/Azure/actions-workflow-samples) repository.
* 有关部署到 Azure 的 GitHub 操作工作流程的更多示例,请参阅 [actions-workflow-samples](https://github.com/Azure/actions-workflow-samples) 存储库。

View File

@@ -1,6 +1,6 @@
---
title: Deploying to Azure Kubernetes Service
intro: You can deploy your project to Azure Kubernetes Service (AKS) as part of your continuous deployment (CD) workflows.
title: 部署到 Azure Kubernetes Service
intro: 作为持续部署 (CD) 工作流程的一部分,您可以将项目部署到 Azure Kubernetes Service (AKS)
versions:
fpt: '*'
ghes: '*'
@@ -18,13 +18,13 @@ topics:
## 简介
This guide explains how to use {% data variables.product.prodname_actions %} to build and deploy a project to [Azure Kubernetes Service](https://azure.microsoft.com/services/kubernetes-service/).
本指南说明如何使用 {% data variables.product.prodname_actions %} 构建并部署 Php 项目到 [Azure Kubernetes Service](https://azure.microsoft.com/services/kubernetes-service/)
{% ifversion fpt or ghec or ghae-issue-4856 %}
{% note %}
**Note**: {% data reusables.actions.about-oidc-short-overview %} and "[Configuring OpenID Connect in Azure](/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-azure)."
**注意**{% data reusables.actions.about-oidc-short-overview %} 和“[在 Azure 中配置 OpenID Connect](/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-azure)”。
{% endnote %}
@@ -34,23 +34,23 @@ This guide explains how to use {% data variables.product.prodname_actions %} to
在创建 {% data variables.product.prodname_actions %} 工作流程之前,首先需要完成以下设置步骤:
1. Create a target AKS cluster and an Azure Container Registry (ACR). For more information, see "[Quickstart: Deploy an AKS cluster by using the Azure portal - Azure Kubernetes Service](https://docs.microsoft.com/azure/aks/kubernetes-walkthrough-portal)" and "[Quickstart - Create registry in portal - Azure Container Registry](https://docs.microsoft.com/azure/container-registry/container-registry-get-started-portal)" in the Azure documentation.
1. 创建目标 AKS 群集和 Azure 容器注册表 (ACR)。 更多信息请参阅 Azure 文档中的“[快速入门:使用 Azure 门户部署 AKS 群集 - Azure Kubernetes Service](https://docs.microsoft.com/azure/aks/kubernetes-walkthrough-portal)”和“[快速入门 - 在门户中创建注册表 - Azure 容器注册表](https://docs.microsoft.com/azure/container-registry/container-registry-get-started-portal)”。
1. Create a secret called `AZURE_CREDENTIALS` to store your Azure credentials. For more information about how to find this information and structure the secret, see [the `Azure/login` action documentation](https://github.com/Azure/login#configure-a-service-principal-with-a-secret).
1. 创建名为 `AZURE_CREDENTIALS` 的机密来存储 Azure 凭据。 有关如何查找此信息和构建密钥的详细信息,请参阅[ `Azure/login` 操作文档](https://github.com/Azure/login#configure-a-service-principal-with-a-secret)
## 创建工作流程
完成先决条件后,可以继续创建工作流程。
The following example workflow demonstrates how to build and deploy a project to Azure Kubernetes Service when code is pushed to your repository.
以下示例工作流程演示在将代码推送到存储库时,如何构建项目并将其部署到 Azure Kubernetes Service。
Under the workflow `env` key, change the following values:
- `AZURE_CONTAINER_REGISTRY` to the name of your container registry
- `PROJECT_NAME` to the name of your project
- `RESOURCE_GROUP` to the resource group containing your AKS cluster
- `CLUSTER_NAME` to the name of your AKS cluster
在工作流程 `env` 键下,更改以下值:
- `AZURE_CONTAINER_REGISTRY` 更改为您的容器注册表的名称
- `PROJECT_NAME` 更改为您的项目名称
- `Resources URCE_GROUP` 更改为包含您的 AKS 集群的资源组
- `CLUSTER_NAME` 更改为您的 AKS 集群名称
This workflow uses the `helm` render engine for the [`azure/k8s-bake` action](https://github.com/Azure/k8s-bake). If you will use the `helm` render engine, change the value of `CHART_PATH` to the path to your helm file. Change `CHART_OVERRIDE_PATH` to an array of override file paths. If you use a different render engine, update the input parameters sent to the `azure/k8s-bake` action.
此工作流程对 [`azure/k8s-bake` 操作](https://github.com/Azure/k8s-bake)使用 `helm` 渲染引擎。 如果要使用 `helm` 渲染引擎,请将 `CHART_PATH` 的值更改为 helm 文件的路径。 将 `CHART_OVERRIDE_PATH` 更改为覆盖文件路径数组。 如果使用其他渲染引擎,请更新发送到 `azure/k8s-bake` 操作的输入参数。
```yaml{:copy}
{% data reusables.actions.actions-not-certified-by-github-comment %}
@@ -121,6 +121,6 @@ jobs:
以下资源也可能有用:
* For the original starter workflow, see [`azure-kubernetes-service.yml`](https://github.com/actions/starter-workflows/blob/main/deployments/azure-kubernetes-service.yml) in the {% data variables.product.prodname_actions %} `starter-workflows` repository.
* The actions used to in this workflow are the official Azure [`Azure/login`](https://github.com/Azure/login),[`Azure/aks-set-context`](https://github.com/Azure/aks-set-context), [`Azure/CLI`](https://github.com/Azure/CLI), [`Azure/k8s-bake`](https://github.com/Azure/k8s-bake), and [`Azure/k8s-deploy`](https://github.com/Azure/k8s-deploy)actions.
* For more examples of GitHub Action workflows that deploy to Azure, see the [actions-workflow-samples](https://github.com/Azure/actions-workflow-samples) repository.
* 有关原始入门工作流程,请参阅 {% data variables.product.prodname_actions %} `starter-workflows` 仓库中的 [`azure-kubernetes-service.yml`](https://github.com/actions/starter-workflows/blob/main/deployments/azure-kubernetes-service.yml)
* 用于此工作流程的操作是正式的 Azure [`Azure/login`](https://github.com/Azure/login)[`Azure/aks-set-context`](https://github.com/Azure/aks-set-context)[`Azure/CLI`](https://github.com/Azure/CLI)[`Azure/k8s-bake`](https://github.com/Azure/k8s-bake) [`Azure/k8s-deploy`](https://github.com/Azure/k8s-deploy) 操作。
* 有关部署到 Azure 的 GitHub 操作工作流程的更多示例,请参阅 [actions-workflow-samples](https://github.com/Azure/actions-workflow-samples) 存储库。

View File

@@ -1,6 +1,6 @@
---
title: Deploying to Azure Static Web App
intro: You can deploy your web app to Azure Static Web App as part of your continuous deployment (CD) workflows.
title: 部署到 Azure Static Web App
intro: 作为持续部署 (CD) 工作流程的一部分,可以将 Web 应用部署到 Azure Static Web App。
versions:
fpt: '*'
ghes: '*'
@@ -18,13 +18,13 @@ topics:
## 简介
This guide explains how to use {% data variables.product.prodname_actions %} to build and deploy a web app to [Azure Static Web Apps](https://azure.microsoft.com/services/app-service/static/).
本指南说明如何使用 {% data variables.product.prodname_actions %} 构建 Web 应用并将其部署到 [Azure Static Web App](https://azure.microsoft.com/services/app-service/static/)
{% ifversion fpt or ghec or ghae-issue-4856 %}
{% note %}
**Note**: {% data reusables.actions.about-oidc-short-overview %} and "[Configuring OpenID Connect in Azure](/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-azure)."
**注意**{% data reusables.actions.about-oidc-short-overview %} 和“[在 Azure 中配置 OpenID Connect](/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-azure)”。
{% endnote %}
@@ -34,22 +34,22 @@ This guide explains how to use {% data variables.product.prodname_actions %} to
在创建 {% data variables.product.prodname_actions %} 工作流程之前,首先需要完成以下设置步骤:
1. Create an Azure Static Web App using the 'Other' option for deployment source. For more information, see "[Quickstart: Building your first static site in the Azure portal](https://docs.microsoft.com/azure/static-web-apps/get-started-portal)" in the Azure documentation.
1. 对部署源使用“Other其他”选项创建 Azure Static Web App。 更多信息请参阅 Azure 文档中的“[快速入门:在 Azure 门户中构建第一个静态站点](https://docs.microsoft.com/azure/static-web-apps/get-started-portal)”。
2. Create a secret called `AZURE_STATIC_WEB_APPS_API_TOKEN` with the value of your static web app deployment token. For more information about how to find your deployment token, see "[Reset deployment tokens in Azure Static Web Apps](https://docs.microsoft.com/azure/static-web-apps/deployment-token-management)" in the Azure documentation.
2. 使用静态 Web 应用部署令牌的值创建名为 `AZURE_STATIC_WEB_APPS_API_TOKEN` 的机密。 有关如何查找部署令牌的详细信息,请参阅 Azure 文档中的“[在 Azure 静态 Web 应用中重置部署令牌](https://docs.microsoft.com/azure/static-web-apps/deployment-token-management)”。
## 创建工作流程
完成先决条件后,可以继续创建工作流程。
The following example workflow demonstrates how to build and deploy an Azure static web app when there is a push to the `main` branch or when a pull request targeting `main` is opened, synchronized, or reopened. The workflow also tears down the corresponding pre-production deployment when a pull request targeting `main` is closed.
以下示例工作流程演示了在推送到 `main` 分支时,或者在打开、同步或重新打开面向 `main` 的拉取请求时,如何生成和部署 Azure 静态 Web 应用。 当面向 `main` 的拉取请求关闭时,工作流程还会破坏相应的预生产部署。
Under the workflow `env` key, change the following values:
- `APP_LOCATION` to the location of your client code
- `API_LOCATION` to the location of your API source code. If `API_LOCATION` is not relevant, you can delete the variable and the lines where it is used.
- `APP_ARTIFACT_LOCATION` to the location of your client code build output
在工作流程 `env` 键下,更改以下值:
- `APP_LOCATION` 更改为客户端代码的位置
- `API_LOCATION` 更改为 API 源代码的位置。 如果 `API_LOCATION` 不相关,则可以删除该变量以及使用它的行。
- `APP_ARTIFACT_LOCATION` 更改为客户端代码构建输出的位置
For more information about these values, see "[Build configuration for Azure Static Web Apps](https://docs.microsoft.com/azure/static-web-apps/build-configuration?tabs=github-actions)" in the Azure documentation.
有关这些值的详细信息,请参阅 Azure 文档中的“[Azure 静态 Web 应用的构建配置](https://docs.microsoft.com/azure/static-web-apps/build-configuration?tabs=github-actions)”。
```yaml{:copy}
{% data reusables.actions.actions-not-certified-by-github-comment %}
@@ -108,6 +108,6 @@ jobs:
以下资源也可能有用:
* For the original starter workflow, see [`azure-staticwebapp.yml`](https://github.com/actions/starter-workflows/blob/main/deployments/azure-staticwebapp.yml) in the {% data variables.product.prodname_actions %} `starter-workflows` repository.
* The action used to deploy the web app is the official Azure [`Azure/static-web-apps-deploy`](https://github.com/Azure/static-web-apps-deploy) action.
* For more examples of GitHub Action workflows that deploy to Azure, see the [actions-workflow-samples](https://github.com/Azure/actions-workflow-samples) repository.
* 有关原始入门工作流程,请参阅 {% data variables.product.prodname_actions %} `starter-workflows` 仓库中的 [`azure-staticwebapp.yml`](https://github.com/actions/starter-workflows/blob/main/deployments/azure-staticwebapp.yml)
* 用于部署 Web 应用的操作是正式的 Azure [`Azure/static-web-apps-deploy`](https://github.com/Azure/static-web-apps-deploy) 操作。
* 有关部署到 Azure 的 GitHub 操作工作流程的更多示例,请参阅 [actions-workflow-samples](https://github.com/Azure/actions-workflow-samples) 存储库。

View File

@@ -1,7 +1,7 @@
---
title: Deploying to Azure
shortTitle: Deploy to Azure
intro: 'Learn how to deploy to Azure App Service, Azure Kubernetes, and Azure Static Web App as part of your continuous deployment (CD) workflows.'
title: 部署到 Azure
shortTitle: 部署到 Azure
intro: 了解作为持续部署 (CD) 工作流程的一部分,如何部署到 Azure App ServiceAzure Kubernetes Azure Static Web App
versions:
fpt: '*'
ghes: '*'

View File

@@ -1,7 +1,7 @@
---
title: Using OpenID Connect with reusable workflows
shortTitle: Using OpenID Connect with reusable workflows
intro: You can use reusable workflows with OIDC to standardize and security harden your deployment steps.
title: OpenID Connect 与可重用的工作流程结合使用
shortTitle: OpenID Connect 与可重用的工作流程结合使用
intro: 您可以将可重用的工作流程与 OIDC 结合使用,以标准化您的部署步骤并加强其安全性。
miniTocMaxHeadingLevel: 3
redirect_from:
- /actions/deployment/security-hardening-your-deployments/using-oidc-with-your-reusable-workflows
@@ -19,21 +19,21 @@ topics:
{% data reusables.actions.enterprise-beta %}
{% data reusables.actions.enterprise-github-hosted-runners %}
## About reusable workflows
## 关于可重用工作流程
Rather than copying and pasting deployment jobs from one workflow to another, you can create a reusable workflow that performs the deployment steps. A reusable workflow can be used by another workflow if it meets one of the access requirements described in "[Reusing workflows](/actions/learn-github-actions/reusing-workflows#access-to-reusable-workflows)."
您可以创建一个可重用的工作流程来执行部署步骤,而不是将部署作业从一个工作流程复制并粘贴到另一个工作流程。 如果可重用工作流程满足“[重用工作流](/actions/learn-github-actions/reusing-workflows#access-to-reusable-workflows)”中所述的访问要求之一,则可以由另一个工作流程使用。
When combined with OpenID Connect (OIDC), reusable workflows let you enforce consistent deployments across your repository, organization, or enterprise. You can do this by defining trust conditions on cloud roles based on reusable workflows.
OpenID Connect (OIDC) 结合使用时,可重用工作流程可让您在存储库、组织或企业中实施一致的部署。 为此,可以基于可重用工作流程在云角色上定义信任条件。
In order to create trust conditions based on reusable workflows, your cloud provider must support custom claims for `job_workflow_ref`. This allows your cloud provider to identify which repository the job originally came from. If your cloud provider only supports the standard claims (_audience_ and _subject_), it will not be able to determine that the job originated from the reusable workflow repository. Cloud providers that support `job_workflow_ref` include Google Cloud Platform and HashiCorp Vault.
为了创建基于可重用工作流程的信任条件,云提供商必须支持 `job_workflow_ref` 的自定义声明。 这允许您的云提供商确定作业最初来自哪个存储库。 如果您的云提供商仅支持标准声明_受众_和_主题_则无法确定作业是否源自可重用工作流程存储库。 支持 `job_workflow_ref` 的云提供商包括 Google Cloud Platform HashiCorp Vault
Before proceeding, you should be familiar with the concepts of [reusable workflows](/actions/learn-github-actions/reusing-workflows) and [OpenID Connect](/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect).
在继续之前,您应该熟悉[可重用工作流程](/actions/learn-github-actions/reusing-workflows) [OpenID Connect](/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect) 的概念。
## How the token works with reusable workflows
## 令牌如何与可重用工作流程配合使用
During a workflow run, {% data variables.product.prodname_dotcom %}'s OIDC provider presents a OIDC token to the cloud provider which contains information about the job. If that job is part of a reusable workflow, the token will include the standard claims that contain information about the calling workflow, and will also include a custom claim called `job_workflow_ref` that contains information about the called workflow.
在工作流程运行期间,{% data variables.product.prodname_dotcom %} OIDC 提供商会向云提供商提供一个 OIDC 令牌,其中包含有关作业的信息。 如果该作业是可重用工作流程的一部分,则令牌将包括包含有关调用工作流程的信息的标准声明,并且还将包括一个名为 `job_workflow_ref` 的自定义声明,其中包含有关被调用工作流程的信息。
For example, the following OIDC token is for a job that was part of a called workflow. The `workflow`, `ref`, and other attributes describe the caller workflow, while `job_workflow_ref` refers to the called workflow:
例如,以下 OIDC 令牌适用于作为被调用工作流程一部分的作业。 `workflow``ref` 及其他属性描述调用方工作流程,而 `job_workflow_ref` 则引用被调用的工作流程:
```yaml{:copy}
{
@@ -67,30 +67,30 @@ For example, the following OIDC token is for a job that was part of a called wor
}
```
If your reusable workflow performs deployment steps, then it will typically need access to a specific cloud role, and you might want to allow any repository in your organization to call that reusable workflow. To permit this, you'll create the trust condition that allows any repository and any caller workflow, and then filter on the organization and the called workflow. See the next section for some examples.
如果可重用工作流程执行部署步骤,则它通常需要访问特定的云角色,并且您可能希望允许组织中的任何存储库调用该可重用工作流程。 若要允许这样做,您将创建允许任何存储库和任何调用方工作流程的信任条件,然后筛选组织和被调用的工作流程。 有关一些示例,请参阅下一节。
## 示例
**Filtering for reusable workflows within a specific repository**
**筛选特定存储库中的可重用工作流程**
You can configure a custom claim that filters for any reusable workflow in a specific repository. In this example, the workflow run must have originated from a job defined in a reusable workflow in the `octo-org/octo-automation` repository, and in any repository that is owned by the `octo-org` organization.
您可以配置自定义声明,以筛选特定存储库中的任何可重用工作流程。 在此示例中,工作流程运行必须源自在 `octo-org/octo-automation` 存储库的可重用工作流程中定义的作业,以及由 `octo-org` 组织拥有的任何存储库中定义的作业。
- **Subject**:
- Syntax: `repo:ORG_NAME/*`
- Example: `repo:octo-org/*`
- **主题**
- 语法:`repo:ORG_NAME/*`
- 示例:`repo:octo-org/*`
- **Custom claim**:
- Syntax: `job_workflow_ref:ORG_NAME/REPO_NAME`
- Example: `job_workflow_ref:octo-org/octo-automation@*`
- **自定义声明**
- 语法:`job_workflow_ref:ORG_NAME/REPO_NAME`
- 示例:`job_workflow_ref:octo-org/octo-automation@*`
**Filtering for a specific reusable workflow at a specific ref**
**在特定引用处筛选特定的可重用工作流程**
You can configure a custom claim that filters for a specific reusable workflow. In this example, the workflow run must have originated from a job defined in the reusable workflow `octo-org/octo-automation/.github/workflows/deployment.yml`, and in any repository that is owned by the `octo-org` organization.
您可以配置自定义声明,以筛选特定的可重用工作流程。 在此示例中,工作流程运行必须源自可重用工作流程 `octo-org/octo-automation/.github/workflows/deployment.yml` 中定义的作业,以及由 `octo-org` 组织拥有的任何存储库中。
- **Subject**:
- Syntax: `repo:ORG_NAME/*`
- Example: `repo:octo-org/*`
- **主题**
- 语法:`repo:ORG_NAME/*`
- 示例:`repo:octo-org/*`
- **Custom claim**:
- Syntax: `job_workflow_ref:ORG_NAME/REPO_NAME/.github/workflows/WORKFLOW_FILE@ref`
- Example: `job_workflow_ref:octo-org/octo-automation/.github/workflows/deployment.yml@ 10040c56a8c0253d69db7c1f26a0d227275512e2`
- **自定义声明**
- 语法:`job_workflow_ref:ORG_NAME/REPO_NAME/.github/workflows/WORKFLOW_FILE@ref`
- 示例:`job_workflow_ref:octo-org/octo-automation/.github/workflows/deployment.yml@ 10040c56a8c0253d69db7c1f26a0d227275512e2`

View File

@@ -21,14 +21,12 @@ A self-hosted runner is a system that you deploy and manage to execute jobs from
{% data reusables.actions.self-hosted-runner-description %} {% data reusables.actions.self-hosted-runner-locations %}
{% data reusables.actions.self-hosted-runner-architecture %} {% data reusables.actions.runner-app-open-source %} When a new version is released, the runner application automatically updates itself when a job is assigned to the runner, or within a week of release if the runner hasn't been assigned any jobs.
You can add self-hosted runners at various levels in the management hierarchy:
- Repository-level runners are dedicated to a single repository.
- Organization-level runners can process jobs for multiple repositories in an organization.
- Enterprise-level runners can be assigned to multiple organizations in an enterprise account.
Your runner machine connects to {% data variables.product.product_name %} using the {% data variables.product.prodname_actions %} self-hosted runner application. {% data reusables.actions.runner-app-open-source %} When a new version is released, the runner application automatically updates itself when a job is assigned to the runner, or within a week of release if the runner hasn't been assigned any jobs.
{% data reusables.actions.self-hosted-runner-architecture %} {% data reusables.actions.runner-app-open-source %} When a new version is released, the runner application automatically updates itself when a job is assigned to the runner, or within a week of release if the runner hasn't been assigned any jobs.
{% data reusables.actions.self-hosted-runner-auto-removal %}

View File

@@ -91,6 +91,7 @@ type: overview
- 对于私有存储库,请使用具有 [`repo` 作用域](/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/#available-scopes)的访问令牌。
- 对于公共存储库,请使用具有 [`public_repo` 作用域](/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/#available-scopes)的访问令牌。
- For organizations, use an access token with the [`admin:org` scope](/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/#available-scopes).
要使用 {% data variables.product.prodname_dotcom %} 应用进行身份验证,必须为其分配以下权限:
- 对于存储库,请分配`管理`权限。

View File

@@ -19,6 +19,7 @@ children:
- /about-self-hosted-runners
- /adding-self-hosted-runners
- /autoscaling-with-self-hosted-runners
- /running-scripts-before-or-after-a-job
- /configuring-the-self-hosted-runner-application-as-a-service
- /using-a-proxy-server-with-self-hosted-runners
- /using-labels-with-self-hosted-runners

View File

@@ -0,0 +1,76 @@
---
title: Running scripts before or after a job
intro: 'Scripts can automatically execute on a self-hosted runner, directly before or after a job.'
versions:
feature: job-hooks-for-runners
type: tutorial
miniTocMaxHeadingLevel: 3
shortTitle: Run a script before or after a job
---
{% note %}
**Note**: This feature is currently in beta and is subject to change.
{% endnote %}
## About pre- and post-job scripts
You can automatically execute scripts on a self-hosted runner, either before a job runs, or after a job finishes running. You could use these scripts to support the job's requirements, such as building or tearing down a runner environment, or cleaning out directories. You could also use these scripts to track telemetry of how your runners are used.
The custom scripts are automatically triggered when a specific environment variable is set on the runner; the environment variable must contain the absolute path to the script. For more information, see "[Triggering the scripts](#triggering-the-scripts)" below.
The following scripting languages are supported:
- **Bash**: Uses `bash` and can fallback to `sh`. Executes by running `-e {pathtofile}`.
- **PowerShell**: Uses `pwsh` and can fallback to `powershell`. Executes by running `-command \". '{pathtofile}'\"`.
## Writing the scripts
Your custom scripts can use the following features:
- **Environment variables**: Scripts have access to the default environment variables. The full webhook event payload can be found in `GITHUB_EVENT_PATH`. 更多信息请参阅“[环境变量](/actions/learn-github-actions/environment-variables#default-environment-variables)”。
- **Workflow commands**: Scripts can use workflow commands. For more information, see ["Workflow commands for {% data variables.product.prodname_actions %}"](/actions/using-workflows/workflow-commands-for-github-actions), with the exception of `save-state` and `set-output`, which are not supported by these scripts. Scripts can also use environment files. For more information, see [Environment files](/actions/using-workflows/workflow-commands-for-github-actions#environment-files).
{% note %}
**Note**: Avoid using your scripts to output sensitive information to the console, as anyone with read access to the repository might be able to see the output in the UI logs.
{% endnote %}
### Handling exit codes
For pre-job scripts, exit code `0` indicates that the script completed successfully, and the job will then proceed to run. If there is any other exit code, the job will not run and will be marked as failed. To see the results of your pre-job scripts, check the logs for `Set up runner` entries. For more information on checking the logs, see "[Viewing logs to diagnose failures](/actions/monitoring-and-troubleshooting-workflows/using-workflow-run-logs#viewing-logs-to-diagnose-failures)."
The [`continue-on-error`](/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idcontinue-on-error) setting is not supported for use by these scripts.
## Triggering the scripts
The custom scripts must be located on the runner, but should not be stored in the `actions-runner` application directory. The scripts are executed in the security context of the service account that's running the runner service.
{% note %}
**Note**: The triggered scripts are processed synchronously, so they will block job execution while they are running.
{% endnote %}
The scripts are automatically executed when the runner has the following environment variables containing an absolute path to the script:
- `ACTIONS_RUNNER_HOOK_JOB_STARTED`: The script defined in this environment variable is triggered when a job has been assigned to a runner, but before the job starts running.
- `ACTIONS_RUNNER_HOOK_JOB_COMPLETED`: The script defined in this environment variable is triggered after the job has finished processing.
To set these environment variables, you can either add them to the operating system, or add them to a file named `.env` within the self-hosted runner application directory. For example, the following `.env` entry will have the runner automatically run a script named `cleanup_script.sh` before each job runs:
```bash
ACTIONS_RUNNER_HOOK_JOB_STARTED=/cleanup_script.sh
```
## 疑难解答
### No timeout setting
There is currently no timeout setting available for scripts executed by `ACTIONS_RUNNER_HOOK_JOB_STARTED` or `ACTIONS_RUNNER_HOOK_JOB_COMPLETED`. As a result, you could consider adding timeout handling to your script.
### Reviewing the workflow run log
To confirm whether your scripts are executing, you can review the logs for that job. The scripts will be listed within separate steps for either `Set up runner` or `Complete runner`, depending on which environment variable is triggering the script. For more information on checking the logs, see "[Viewing logs to diagnose failures](/actions/monitoring-and-troubleshooting-workflows/using-workflow-run-logs#viewing-logs-to-diagnose-failures)."

View File

@@ -366,4 +366,40 @@ steps:
]
```
过滤条件 `fruits.*.name` 返回数组 `[ "apple", "orange", "pear" ]`
过滤条件 `fruits.*.name` 返回数组 `[ "apple", "orange", "pear" ]`.
You may also use the `*` syntax on an object. For example, suppose you have an object named `vegetables`.
```json
{
"scallions":
{
"colors": ["green", "white", "red"],
"ediblePortions": ["roots", "stalks"],
},
"beets":
{
"colors": ["purple", "red", "gold", "white", "pink"],
"ediblePortions": ["roots", "stems", "leaves"],
},
"artichokes":
{
"colors": ["green", "purple", "red", "black"],
"ediblePortions": ["hearts", "stems", "leaves"],
},
}
```
The filter `vegetables.*.ediblePortions` could evaluate to:
```json
[
["roots", "stalks"],
["hearts", "stems", "leaves"],
["roots", "stems", "leaves"],
]
```
Since objects don't preserve order, the order of the output can not be guaranteed.

View File

@@ -226,9 +226,9 @@ steps:
```
{% endraw %}
Secrets cannot be directly referenced in `if:` conditionals. Instead, consider setting secrets as job-level environment variables, then referencing the environment variables to conditionally run steps in the job. 更多信息请参阅“[上下文可用性](/actions/learn-github-actions/contexts#context-availability)”和 [`jobs.<job_id>.steps[*].if`](/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsif)。
无法直接在 `if:` 条件中引用机密。 而应考虑将机密设置为作业级环境变量,然后引用环境变量以有条件地运行作业中的步骤。 更多信息请参阅“[上下文可用性](/actions/learn-github-actions/contexts#context-availability)”和 [`jobs.<job_id>.steps[*].if`](/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsif)。
If a secret has not been set, the return value of an expression referencing the secret (such as {% raw %}`${{ secrets.SuperSecret }}`{% endraw %} in the example) will be an empty string.
如果尚未设置机密,则引用该机密的表达式(例如示例中的 {% raw %}`${{ secrets.SuperSecret }}`{% endraw %})的返回值将为空字符串。
尽可能避免使用命令行在进程之间传递密码。 命令行进程可能对其他用户可见(使用 `ps` 命令)或通过[安全审计事件](https://docs.microsoft.com/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing)获取。 为帮助保护密码,请考虑使用环境变量 `STDIN` 或目标进程支持的其他机制。

View File

@@ -23,7 +23,7 @@ topics:
服务容器是 Docker 容器,以简便、可携带的方式托管您可能需要在工作流程中测试或操作应用程序的服务。 例如,您的工作流程可能必须运行需要访问数据库和内存缓存的集成测试。
您可以为工作流程中的每个作业配置服务容器。 {% data variables.product.prodname_dotcom %} 为工作流中配置的每个服务创建一个新的 Docker 容器,并在作业完成后销毁该服务容器。 作业中的步骤可与属于同一作业的所有服务容器通信。
您可以为工作流程中的每个作业配置服务容器。 {% data variables.product.prodname_dotcom %} 为工作流中配置的每个服务创建一个新的 Docker 容器,并在作业完成后销毁该服务容器。 作业中的步骤可与属于同一作业的所有服务容器通信。 However, you cannot create and use service containers inside a composite action.
{% data reusables.actions.docker-container-os-support %}

View File

@@ -1,7 +1,7 @@
---
title: Assigning permissions to jobs
shortTitle: Assigning permissions to jobs
intro: Modify the default permissions granted to `GITHUB_TOKEN`.
title: 为作业分配权限
shortTitle: 为作业分配权限
intro: 修改授予“GITHUB_TOKEN”的默认权限。
versions:
fpt: '*'
ghes: '> 3.1'
@@ -17,6 +17,6 @@ miniTocMaxHeadingLevel: 4
{% data reusables.actions.jobs.section-assigning-permissions-to-jobs %}
## Assigning permissions to a specific job
## 为特定作业分配权限
{% data reusables.actions.jobs.section-assigning-permissions-to-jobs-specific %}

View File

@@ -1,7 +1,7 @@
---
title: Choosing the runner for a job
shortTitle: Choosing the runner for a job
intro: Define the type of machine that will process a job in your workflow.
title: 选择作业的运行器
shortTitle: 选择作业的运行器
intro: 定义将在工作流程中处理作业的计算机类型。
versions:
fpt: '*'
ghes: '*'

View File

@@ -1,7 +1,7 @@
---
title: Defining outputs for jobs
shortTitle: Defining outputs for jobs
intro: Create a map of outputs for your jobs.
title: 定义作业的输出
shortTitle: 定义作业的输出
intro: 为作业的输出创建映射。
versions:
fpt: '*'
ghes: '*'

View File

@@ -1,7 +1,7 @@
---
title: Using jobs
shortTitle: Using jobs
intro: 'Creating and managing {% data variables.product.prodname_actions %} jobs.'
title: 使用作业
shortTitle: 使用作业
intro: '创建和管理 {% data variables.product.prodname_actions %} 作业。'
redirect_from:
- /actions/jobs
versions:

View File

@@ -1,7 +1,7 @@
---
title: 在容器中运行作业
shortTitle: 在容器中运行作业
intro: Use a container to run the steps in a job.
intro: 使用容器运行作业中的步骤。
versions:
fpt: '*'
ghes: '*'
@@ -17,27 +17,27 @@ miniTocMaxHeadingLevel: 4
{% data reusables.actions.jobs.section-running-jobs-in-a-container %}
## Defining the container image
## 定义容器映像
{% data reusables.actions.jobs.section-running-jobs-in-a-container-image %}
## Defining credentials for a container registry
## 定义容器注册表的凭据
{% data reusables.actions.jobs.section-running-jobs-in-a-container-credentials %}
## Using environment variables with a container
## 将环境变量与容器一起使用
{% data reusables.actions.jobs.section-running-jobs-in-a-container-env %}
## Exposing network ports on a container
## 公开容器上的网络端口
{% data reusables.actions.jobs.section-running-jobs-in-a-container-ports %}
## Mounting volumes in a container
## 在容器中装载卷
{% data reusables.actions.jobs.section-running-jobs-in-a-container-volumes %}
## Setting container resource options
## 设置容器资源选项
{% data reusables.actions.jobs.section-running-jobs-in-a-container-options %}

View File

@@ -1,7 +1,7 @@
---
title: Setting default values for jobs
shortTitle: Setting default values for jobs
intro: 'Define the default settings that will apply to all jobs in the workflow, or all steps in a job.'
title: 设置作业的默认值
shortTitle: 设置作业的默认值
intro: 定义将应用于工作流程中的所有作业或作业中所有步骤的默认设置。
versions:
fpt: '*'
ghes: '*'
@@ -17,14 +17,14 @@ miniTocMaxHeadingLevel: 4
{% data reusables.actions.jobs.setting-default-values-for-jobs-defaults %}
## Setting default shell and working directory
## 设置默认 shell 和工作目录
{% data reusables.actions.jobs.setting-default-values-for-jobs-defaults-run %}
## Setting default values for a specific job
## 设置特定作业的默认值
{% data reusables.actions.jobs.setting-default-values-for-jobs-defaults-job %}
## Setting default shell and working directory for a job
## 设置作业的默认 shell 和工作目录
{% data reusables.actions.jobs.setting-default-values-for-jobs-defaults-job-run %}

View File

@@ -1,7 +1,7 @@
---
title: Using a build matrix for your jobs
shortTitle: Using a build matrix for your jobs
intro: Create a build matrix and define variations for each job.
title: 对作业使用构建矩阵
shortTitle: 对作业使用构建矩阵
intro: 创建构建矩阵并定义每个作业的变体。
versions:
fpt: '*'
ghes: '*'
@@ -17,14 +17,14 @@ miniTocMaxHeadingLevel: 4
{% data reusables.actions.jobs.section-using-a-build-matrix-for-your-jobs-strategy %}
## Creating a matrix of different job configurations
## 创建不同作业配置的矩阵
{% data reusables.actions.jobs.section-using-a-build-matrix-for-your-jobs-matrix %}
## Canceling remaining jobs if a `matrix` job fails
## 在 `matrix` 作业失败时取消剩余作业
{% data reusables.actions.jobs.section-using-a-build-matrix-for-your-jobs-failfast %}
## Defining the maximum number of concurrent jobs in a `matrix`
## 定义 `matrix` 中的最大并发作业数
{% data reusables.actions.jobs.section-using-a-build-matrix-for-your-jobs-max-parallel %}

View File

@@ -1,7 +1,7 @@
---
title: 使用并发
shortTitle: 使用并发
intro: Run a single job at a time.
intro: 一次运行一个作业。
versions:
fpt: '*'
ghes: '> 3.1'

View File

@@ -1,7 +1,7 @@
---
title: Using conditions to control job execution
shortTitle: Using conditions to control job execution
intro: Prevent a job from running unless your conditions are met.
title: 使用条件控制作业执行
shortTitle: 使用条件控制作业执行
intro: 除非满足条件,否则阻止作业运行。
versions:
fpt: '*'
ghes: '*'

View File

@@ -1,7 +1,7 @@
---
title: Using environments for jobs
shortTitle: Using environments for jobs
intro: Specify an environment for a job.
title: 将环境用于作业
shortTitle: 将环境用于作业
intro: 为作业指定环境。
versions:
fpt: '*'
ghes: '> 3.0'

View File

@@ -1,7 +1,7 @@
---
title: Using jobs in a workflow
shortTitle: Using jobs in a workflow
intro: Use workflows to run multiple jobs.
title: 在工作流程中使用作业
shortTitle: 在工作流程中使用作业
intro: 使用工作流程运行多个作业。
versions:
fpt: '*'
ghes: '*'
@@ -17,14 +17,14 @@ miniTocMaxHeadingLevel: 4
{% data reusables.actions.jobs.section-using-jobs-in-a-workflow %}
## Setting an ID for a job
## 设置作业的 ID
{% data reusables.actions.jobs.section-using-jobs-in-a-workflow-id %}
## Setting a name for a job
## 设置作业的名称
{% data reusables.actions.jobs.section-using-jobs-in-a-workflow-name %}
## Defining prerequisite jobs
## 定义必备作业
{% data reusables.actions.jobs.section-using-jobs-in-a-workflow-needs %}

View File

@@ -1,7 +1,7 @@
---
title: Advanced workflow features
shortTitle: Advanced workflow features
intro: 'This guide shows you how to use the advanced features of {% data variables.product.prodname_actions %}, with secret management, dependent jobs, caching, build matrices, environments, and labels.'
title: 高级工作流程功能
shortTitle: 高级工作流程功能
intro: '本指南演示如何使用 {% data variables.product.prodname_actions %} 的高级功能,包括机密管理、从属作业、缓存、构建矩阵、环境和标签。'
redirect_from:
- /actions/learn-github-actions/managing-complex-workflows
versions:
@@ -68,7 +68,7 @@ jobs:
- run: ./test_server.sh
```
For more information, see "[Defining prerequisite jobs](/actions/using-jobs/using-jobs-in-a-workflow#defining-prerequisite-jobs)."
更多信息请参阅“[定义先决条件作业](/actions/using-jobs/using-jobs-in-a-workflow#defining-prerequisite-jobs)”。
## 使用构建矩阵
@@ -89,7 +89,7 @@ jobs:
```
{% endraw %}
For more information, see "[Using a build matrix for your jobs](/actions/using-jobs/using-a-build-matrix-for-your-jobs)."
更多信息请参阅“[对作业使用构建矩阵](/actions/using-jobs/using-a-build-matrix-for-your-jobs)”。
{% ifversion fpt or ghec %}
## 缓存依赖项
@@ -161,11 +161,11 @@ jobs:
要了解自托管运行器标签的更多信息,请参阅“[将标签与自托管运行器一起使用](/actions/hosting-your-own-runners/using-labels-with-self-hosted-runners)”。
{% ifversion fpt or ghes %}
To learn more about {% data variables.product.prodname_dotcom %}-hosted runner labels, see ["Supported runners and hardware resources"](/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources).
要详细了解 {% data variables.product.prodname_dotcom %} 托管的运行器标签,请参阅[“支持的运行器和硬件资源”](/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources)
{% endif %}
{% ifversion fpt or ghes > 3.3 or ghae-issue-4757 or ghec %}
## Reusing workflows
## 重新使用工作流程
{% data reusables.actions.reusable-workflows %}
{% endif %}
@@ -173,14 +173,14 @@ To learn more about {% data variables.product.prodname_dotcom %}-hosted runner l
您可以使用保护规则和机密配置环境。 工作流程中的每个作业都可以引用单个环境。 在将引用环境的作业发送到运行器之前,必须通过为环境配置的任何保护规则。 更多信息请参阅“[使用环境进行部署](/actions/deployment/using-environments-for-deployment)”。
## Using starter workflows
## 使用入门工作流程
{% data reusables.actions.workflow-template-overview %}
{% data reusables.repositories.navigate-to-repo %}
{% data reusables.repositories.actions-tab %}
1. 如果您的仓库已经有工作流程:在左上角单击 **New workflow新工作流程**。 ![创建新工作流程](/assets/images/help/repository/actions-new-workflow.png)
1. Under the name of the starter workflow you'd like to use, click **Set up this workflow**. ![设置此工作流程](/assets/images/help/settings/actions-create-starter-workflow.png)
1. 在您想要使用的入门工作流程名称下,单击 **Set up this workflow(设置此工作流程)** ![设置此工作流程](/assets/images/help/settings/actions-create-starter-workflow.png)
## 后续步骤

View File

@@ -1,7 +1,7 @@
---
title: Creating starter workflows for your organization
shortTitle: Creating starter workflows
intro: Learn how you can create starter workflows to help people in your team add new workflows more easily.
title: 为组织创建入门工作流程
shortTitle: 创建入门工作流程
intro: 了解如何创建入门工作流程,以帮助团队中的人员更轻松地添加新工作流程。
redirect_from:
- /actions/configuring-and-managing-workflows/sharing-workflow-templates-within-your-organization
- /actions/learn-github-actions/creating-workflow-templates
@@ -26,29 +26,29 @@ topics:
{% data reusables.actions.starter-workflow-categories %}
## Creating a starter workflow
## 创建入门工作流程
Starter workflows can be created by users with write access to the organization's `.github` repository. These can then be used by organization members who have permission to create workflows.
入门工作流程可由对组织的 `.github` 存储库具有写入访问权限的用户创建。 然后,有权限创建工作流程的组织成员便可使用它们。
{% ifversion fpt %}
Starter workflows created by users can only be used to create workflows in public repositories. Organizations using {% data variables.product.prodname_ghe_cloud %} can also use starter workflows to create workflows in private repositories. 更多信息请参阅 [{% data variables.product.prodname_ghe_cloud %} 文档](/enterprise-cloud@latest/actions/learn-github-actions/creating-starter-workflows-for-your-organization)。
用户创建的入门工作流程只能用于在公共存储库中创建工作流程。 使用 {% data variables.product.prodname_ghe_cloud %} 的组织还可以使用入门工作流程在私有仓库中创建工作流程。 更多信息请参阅 [{% data variables.product.prodname_ghe_cloud %} 文档](/enterprise-cloud@latest/actions/learn-github-actions/creating-starter-workflows-for-your-organization)。
{% endif %}
{% ifversion fpt or ghes > 3.3 or ghae-issue-4757 or ghec %}
{% note %}
**Note:** To avoid duplication among starter workflows you can call reusable workflows from within a workflow. This can help make your workflows easier to maintain. For more information, see "[Reusing workflows](/actions/learn-github-actions/reusing-workflows)."
**注意:**为避免入门工作流程之间的重复,您可以从工作流程中调用可重用工作流程。 这有助于使您的工作流程更易于维护。 For more information, see "[Reusing workflows](/actions/learn-github-actions/reusing-workflows)."
{% endnote %}
{% endif %}
This procedure demonstrates how to create a starter workflow and metadata file. The metadata file describes how the starter workflows will be presented to users when they are creating a new workflow.
此过程演示如何创建入门工作流程和元数据文件。 元数据文件描述了在用户创建新工作流程时如何向用户显示入门工作流程。
1. 如果组织中没有名为 `.github` 的公共仓库,请新建一个。
2. 创建一个名为 `workflow-templates` 的目录。
3.`workflow-templates` 目录中创建新的工作流程文件。
如果需要引用仓库的默认分支,可以使用 `$default-branch` 占位符。 When a workflow is created the placeholder will be automatically replaced with the name of the repository's default branch.
如果需要引用仓库的默认分支,可以使用 `$default-branch` 占位符。 创建工作流程时,占位符将自动替换为仓库默认分支的名称。
例如,下面这个名为 `octo-organization-ci.yml` 的文件展示了一个基本的工作流程。
@@ -87,16 +87,16 @@ This procedure demonstrates how to create a starter workflow and metadata file.
]
}
```
* `name` - **Required.** The name of the workflow. This is displayed in the list of available workflows.
* `description` - **Required.** The description of the workflow. This is displayed in the list of available workflows.
* `iconName` - **Optional.** Specifies an icon for the workflow that's displayed in the list of workflows. The `iconName` must be the name of an SVG file, without the file name extension, stored in the `workflow-templates` directory. For example, an SVG file named `example-icon.svg` is referenced as `example-icon`.
* `categories` - **可选。**定义工作流程的语言类别。 When a user views the available starter workflows for a repository, the workflows that match the identified language for the project are featured more prominently. 有关可用语言类别的信息请参阅https://github.com/github/linguist/blob/master/lib/linguist/languages.yml。
* `filePatterns` - **Optional.** Allows the workflow to be used if the user's repository has a file in its root directory that matches a defined regular expression.
* `name` - **必要。**工作流程的名称。 这会显示在可用工作流程列表中。
* `description` - **必要。**工作流程的描述。 这会显示在可用工作流程列表中。
* `iconName` - **可选。** 指定显示在工作流程列表中的工作流程的图标。 `iconName` 必须是 SVG 文件的名称,没有文件名扩展名,存储在 `workflow-templates` 目录中。 例如,名为 `example-icon.svg` 的 SVG 文件被引用为 `example-icon`
* `categories` - **可选。**定义工作流程的语言类别。 当用户查看存储库的可用入门工作流程时,与项目已识别语言匹配的工作流程将更加突出。 有关可用语言类别的信息请参阅https://github.com/github/linguist/blob/master/lib/linguist/languages.yml。
* `filePatterns` - **可选。**如果用户仓库在其根目录中有符合定义的正则表达式的文件,则允许使用工作流程。
To add another starter workflow, add your files to the same `workflow-templates` directory. 例如:
要添加另一个入门工作流程,请将您的文件添加到同一 `workflow-templates` 目录中。 例如:
![Workflow files](/assets/images/help/images/workflow-template-files.png)
![工作流程文件](/assets/images/help/images/workflow-template-files.png)
## 后续步骤
To continue learning about {% data variables.product.prodname_actions %}, see "[Using starter workflows](/actions/using-workflows/using-starter-workflows)."
要继续了解 {% data variables.product.prodname_actions %},请参阅“[使用入门工作流程](/actions/using-workflows/using-starter-workflows)”。

View File

@@ -16,13 +16,13 @@ versions:
shortTitle: 触发工作流程的事件
---
## About events that trigger workflows
## 关于触发工作流程的事件
Workflow triggers are events that cause a workflow to run. For more information about how to use workflow triggers, see "[Triggering a workflow](/actions/using-workflows/triggering-a-workflow)."
工作流程触发器是导致工作流程运行的事件。 有关如何使用工作流程触发器的详细信息,请参阅“[触发工作流程](/actions/using-workflows/triggering-a-workflow)”。
## Available events
## 可用事件
Some events have multiple activity types. For these events, you can specify which activity types will trigger a workflow run. For more information about what each activity type means, see "[Webhook events and payloads](/developers/webhooks-and-events/webhook-events-and-payloads)." Note that not all webhook events trigger workflows.
某些事件具有多种活动类型。 对于这些事件,您可以指定将触发工作流程运行的活动类型。 有关每个活动类型的含义的详细信息,请参阅“[web 挂钩事件和有效负载](/developers/webhooks-and-events/webhook-events-and-payloads)”。 请注意,并非所有 web 挂钩事件都会触发工作流程。
{% ifversion fpt or ghec or ghes > 3.3 or ghae-issue-4968 %}
### `branch_protection_rule`
@@ -33,15 +33,15 @@ Some events have multiple activity types. For these events, you can specify whic
{% note %}
**Note**: {% data reusables.developer-site.multiple_activity_types %} For information about each activity type, see "[Webhook events and payloads](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#branch_protection_rule)." {% data reusables.developer-site.limit_workflow_to_activity_types %}
**注意**{% data reusables.developer-site.multiple_activity_types %} 有关每种活动类型的信息,请参阅“[web 挂钩事件和有效负载](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#branch_protection_rule)”。 {% data reusables.developer-site.limit_workflow_to_activity_types %}
{% endnote %}
{% data reusables.actions.branch-requirement %}
Runs your workflow when branch protection rules in the workflow repository are changed. 有关分支保护规则的更多信息,请参阅“[关于受保护分支](/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/about-protected-branches)”。 For information about the branch protection rule APIs, see "[BranchProtectionRule](/graphql/reference/objects#branchprotectionrule)" in the GraphQL API documentation or "[Branches](/rest/reference/branches)" in the REST API documentation.
在工作流程存储库中的分支保护规则发生更改时运行工作流程。 有关分支保护规则的更多信息,请参阅“[关于受保护分支](/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/about-protected-branches)”。 有关分支保护规则 API 的信息,请参阅 GraphQL API 文档中的“[BranchProtectionRule](/graphql/reference/objects#branchprotectionrule)”或 REST API 文档中的“[分支](/rest/reference/branches)”。
For example, you can run a workflow when a branch protection rule has been `created` or `deleted`:
例如,您可以在分支保护规则为 `created` `deleted` 时运行工作流程。
```yaml
on:
@@ -59,13 +59,13 @@ on:
{% note %}
**Note**: {% data reusables.developer-site.multiple_activity_types %} For information about each activity type, see "[Webhook events and payloads](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#check_run)." {% data reusables.developer-site.limit_workflow_to_activity_types %}
**注意**{% data reusables.developer-site.multiple_activity_types %} 有关每种活动类型的信息,请参阅“[web 挂钩事件和有效负载](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#check_run)”。 {% data reusables.developer-site.limit_workflow_to_activity_types %}
{% endnote %}
{% data reusables.actions.branch-requirement %}
Runs your workflow when activity related to a check run occurs. 检查运行是检查套件中的单个测试。 For information, see "[Getting started with the Checks API](/rest/guides/getting-started-with-the-checks-api)." For information about the check run APIs, see "[CheckRun](/graphql/reference/objects#checkrun)" in the GraphQL API documentation or "[Checks](/rest/reference/checks#runs)" in the REST API documentation.
在发生与检查运行相关的活动时运行工作流程。 检查运行是检查套件中的单个测试。 有关信息,请参阅“[检查 API 入门](/rest/guides/getting-started-with-the-checks-api)”。 有关检查运行 API 的信息,请参阅 GraphQL API 文档中的“[CheckRun](/graphql/reference/objects#checkrun)”或 REST API 文档中的“[检查](/rest/reference/checks#runs)”。
例如,您可以在检查运行为 `rerequested``completed` 时运行工作流程。
@@ -83,7 +83,7 @@ on:
{% note %}
**Note**: {% data reusables.developer-site.multiple_activity_types %} For information about each activity type, see "[Webhook events and payloads](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#check_suite)." Although only the `started` activity type is supported, specifying the activity type will keep your workflow specific if more activity types are added in the future. {% data reusables.developer-site.limit_workflow_to_activity_types %}
**注意**{% data reusables.developer-site.multiple_activity_types %} 有关每种活动类型的信息,请参阅“[web 挂钩事件和有效负载](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#check_suite)”。 尽管仅支持 `started` 活动类型,但如果将来添加更多活动类型,则指定活动类型将使您的工作流程保持特定。 {% data reusables.developer-site.limit_workflow_to_activity_types %}
{% endnote %}
@@ -95,9 +95,9 @@ on:
{% endnote %}
Runs your workflow when check suite activity occurs. A check suite is a collection of the check runs created for a specific commit. Check suites summarize the status and conclusion of the check runs that are in the suite. For information, see "[Getting started with the Checks API](/rest/guides/getting-started-with-the-checks-api)." For information about the check suite APIs, see "[CheckSuite](/graphql/reference/objects#checksuite)" in the GraphQL API documentation or "[Checks](/rest/reference/checks#suites)" in the REST API documentation.
在发生检查套件活动时运行工作流程。 检查套件是为特定提交创建的检查运行的集合。 检查套件汇总了套件中检查运行的状态和结论。 有关信息,请参阅“[检查 API 入门](/rest/guides/getting-started-with-the-checks-api)”。 有关检查套件 API 的信息,请参阅 GraphQL API 文档中的“[CheckSuite](/graphql/reference/objects#checksuite)”或 REST API 文档中的“[检查](/rest/reference/checks#suites)”。
For example, you can run a workflow when a check suite has been `completed`.
例如,您可以在检查套件为 `completed` 时运行工作流程。
```yaml
on:
@@ -113,11 +113,11 @@ on:
{% note %}
**Note**: An event will not be created when you create more than three tags at once.
**注意**:一次创建三个以上的标记时,不会创建事件。
{% endnote %}
Runs your workflow when someone creates a Git reference (Git branch or tag) in the workflow's repository. For information about the APIs to create a Git reference, see "[createRef](/graphql/reference/mutations#createref)" in the GraphQL API documentation or "[Create a reference](/rest/reference/git#create-a-reference)" in the REST API documentation.
当有人在工作流程的存储库中创建 Git 引用Git 分支或标记)时运行工作流程。 有关用于创建 Git 引用的 API 的信息,请参阅 GraphQL API 文档中的“[createRef](/graphql/reference/mutations#createref)”或 REST API 文档中的“[创建引用](/rest/reference/git#create-a-reference)”。
例如,您可以在发生 `create` 事件时运行工作流程。
@@ -136,11 +136,11 @@ on:
{% note %}
**Note**: An event will not be created when you delete more than three tags at once.
**注意**:一次删除三个以上的标记时,不会创建事件。
{% endnote %}
Runs your workflow when someone deletes a Git reference (Git branch or tag) in the workflow's repository. For information about the APIs to delete a Git reference, see "[deleteRef](/graphql/reference/mutations#deleteref)" in the GraphQL API documentation or "[Delete a reference](/rest/reference/git#delete-a-reference)" in the REST API documentation.
当有人删除工作流程存储库中的 Git 引用Git 分支或标记)时运行工作流程。 有关删除 Git 引用的 API 的信息,请参阅 GraphQL API 文档中的“[deleteRef](/graphql/reference/mutations#deleteref)”或 REST API 文档中的“[删除引用](/rest/reference/git#delete-a-reference)”。
例如,您可以在发生 `delete` 事件时运行工作流程。
@@ -151,11 +151,11 @@ on:
### `deployment`
| Web 挂钩事件有效负载 | 活动类型 | `GITHUB_SHA` | `GITHUB_REF` |
| ------------------------------------------------------------------------------------------------ | ---- | ------------ | ----------------------------------------------------------------- |
| [`deployment`](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads/#deployment) | n/a | 要部署的提交 | Branch or tag to be deployed (empty if created with a commit SHA) |
| Web 挂钩事件有效负载 | 活动类型 | `GITHUB_SHA` | `GITHUB_REF` |
| ------------------------------------------------------------------------------------------------ | ---- | ------------ | ---------------------------- |
| [`deployment`](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads/#deployment) | n/a | 要部署的提交 | 要部署的分支或标记(如果使用提交 SHA 创建,则为空) |
Runs your workflow when someone creates a deployment in the workflow's repository. 使用提交 SHA 创建的部署可能没有 Git 引用。 For information about the APIs to create a deployment, see "[createDeployment](/graphql/reference/mutations#createdeployment)" in the GraphQL API documentation or "[Deployments](/rest/reference/repos#deployments)" in the REST API documentation.
当有人在工作流程的存储库中创建部署时运行工作流程。 使用提交 SHA 创建的部署可能没有 Git 引用。 有关用于创建部署的 API 的信息,请参阅 GraphQL API 文档中的“[创建部署](/graphql/reference/mutations#createdeployment)”或 REST API 文档中的“[部署](/rest/reference/repos#deployments)”。
例如,您可以在发生 `deployment` 事件时运行工作流程。
@@ -172,11 +172,11 @@ on:
{% note %}
**Note:** When a deployment status's state is set to `inactive`, a workflow run will not be triggered.
**注意:**当部署状态的状态设置为 `inactive` 时,不会触发工作流程运行。
{% endnote %}
Runs your workflow when a third party provides a deployment status. 使用提交 SHA 创建的部署可能没有 Git 引用。 For information about the APIs to create a deployment status, see "[createDeploymentStatus](/graphql/reference/mutations#createdeploymentstatus)" in the GraphQL API documentation or "[Create a deployment status](/rest/reference/deployments#create-a-deployment-status)" in the REST API documentation.
在第三方提供部署状态时运行工作流程。 使用提交 SHA 创建的部署可能没有 Git 引用。 有关用于创建部署状态的 API 的信息,请参阅 GraphQL API 文档中的“[createDeploymentStatus](/graphql/reference/mutations#createdeploymentstatus)”或 REST API 文档中的“[创建部署状态](/rest/reference/deployments#create-a-deployment-status)”。
例如,您可以在发生 `deployment_status` 事件时运行工作流程。
@@ -194,7 +194,7 @@ on:
{% note %}
**Note**: {% data reusables.developer-site.multiple_activity_types %} For information about each activity type, see "[Webhook events and payloads](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#discussion)." {% data reusables.developer-site.limit_workflow_to_activity_types %}
**注意**{% data reusables.developer-site.multiple_activity_types %} 有关每种活动类型的信息,请参阅“[web 挂钩事件和有效负载](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#discussion)”。 {% data reusables.developer-site.limit_workflow_to_activity_types %}
{% endnote %}
@@ -202,7 +202,7 @@ on:
{% data reusables.webhooks.discussions-webhooks-beta %}
Runs your workflow when a discussion in the workflow's repository is created or modified. For activity related to comments on a discussion, use the [`discussion_comment`](#discussion_comment) event. For more information about discussions, see "[About discussions](/discussions/collaborating-with-your-community-using-discussions/about-discussions)." For information about the GraphQL API, see "[Discussion](/graphql/reference/objects#discussion)."
在创建或修改工作流程存储库中的讨论时运行工作流程。 对于与讨论评论相关的活动,请使用 [`discussion_comment`](#discussion_comment) 事件。 有关讨论的更多信息,请参阅“[关于讨论](/discussions/collaborating-with-your-community-using-discussions/about-discussions)”。 有关 GraphQL API 的信息,请参阅“[讨论](/graphql/reference/objects#discussion)”。
例如,您可以在讨论为 `created``edited``answered` 时运行工作流程。
@@ -220,7 +220,7 @@ on:
{% note %}
**Note**: {% data reusables.developer-site.multiple_activity_types %} For information about each activity type, see "[Webhook events and payloads](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#discussion_comment)." {% data reusables.developer-site.limit_workflow_to_activity_types %}
**注意**{% data reusables.developer-site.multiple_activity_types %} 有关每种活动类型的信息,请参阅“[web 挂钩事件和有效负载](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#discussion_comment)”。 {% data reusables.developer-site.limit_workflow_to_activity_types %}
{% endnote %}
@@ -228,9 +228,9 @@ on:
{% data reusables.webhooks.discussions-webhooks-beta %}
Runs your workflow when a comment on a discussion in the workflow's repository is created or modified. For activity related to a discussion as opposed to comments on the discussion, use the [`discussion`](#discussion) event. For more information about discussions, see "[About discussions](/discussions/collaborating-with-your-community-using-discussions/about-discussions)." For information about the GraphQL API, see "[Discussion](/graphql/reference/objects#discussion)."
在创建或修改工作流程存储库中讨论的评论时运行工作流程。 对于与讨论相关的活动,而不是对讨论的评论,请使用 [`discussion`](#discussion) 事件。 有关讨论的更多信息,请参阅“[关于讨论](/discussions/collaborating-with-your-community-using-discussions/about-discussions)”。 有关 GraphQL API 的信息,请参阅“[讨论](/graphql/reference/objects#discussion)”。
For example, you can run a workflow when a discussion comment has been `created` or `deleted`.
例如,您可以在讨论评论为 `created` `deleted` 时运行工作流程。
```yaml
on:
@@ -248,7 +248,7 @@ on:
{% data reusables.actions.branch-requirement %}
Runs your workflow when someone forks a repository. 有关 REST API 的信息,请参阅“[创建复刻](/rest/reference/repos#create-a-fork)”。
当有人复刻存储库时运行工作流程。 有关 REST API 的信息,请参阅“[创建复刻](/rest/reference/repos#create-a-fork)”。
例如,您可以在发生 `fork` 事件时运行工作流程。
@@ -265,7 +265,7 @@ on:
{% data reusables.actions.branch-requirement %}
Runs your workflow when someone creates or updates a Wiki page. 更多信息请参阅“[关于 wiki](/communities/documenting-your-project-with-wikis/about-wikis)”。
在有人创建或更新 Wiki 页面时运行工作流程。 更多信息请参阅“[关于 wiki](/communities/documenting-your-project-with-wikis/about-wikis)”。
例如,您可以在发生 `gollum` 事件时运行工作流程。
@@ -282,15 +282,15 @@ on:
{% note %}
**Note**: {% data reusables.developer-site.multiple_activity_types %} For information about each activity type, see "[Webhook events and payloads](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#issue_comment)." {% data reusables.developer-site.limit_workflow_to_activity_types %}
**注意**{% data reusables.developer-site.multiple_activity_types %} 有关每种活动类型的信息,请参阅“[web 挂钩事件和有效负载](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#issue_comment)”。 {% data reusables.developer-site.limit_workflow_to_activity_types %}
{% endnote %}
{% data reusables.actions.branch-requirement %}
Runs your workflow when an issue or pull request comment is created, edited, or deleted. For information about the issue comment APIs, see "[IssueComment](/graphql/reference/objects#issuecomment)" in the GraphQL API documentation or "[Issue comments](/developers/webhooks-and-events/webhook-events-and-payloads#issue_comment)" in the REST API documentation.
在创建、编辑或删除议题或拉取请求评论时运行工作流程。 有关议题评论 API 的信息,请参阅 GraphQL API 文档中的“[IssueComment](/graphql/reference/objects#issuecomment)”或 REST API 文档中的“[议题评论](/developers/webhooks-and-events/webhook-events-and-payloads#issue_comment)”。
For example, you can run a workflow when an issue or pull request comment has been `created` or `deleted`.
例如,您可以在议题或拉取请求评论为 `created` `deleted` 时运行工作流程。
```yaml
on:
@@ -298,11 +298,11 @@ on:
types: [created, deleted]
```
#### `issue_comment` on issues only or pull requests only
#### `issue_comment` 仅用于议题或拉取请求
`issue_comment` 事件在评论问题和拉取请求时发生。 You can use the `github.event.issue.pull_request` property in a conditional to take different action depending on whether the triggering object was an issue or pull request.
`issue_comment` 事件在评论问题和拉取请求时发生。 您可以在条件中使用 `github.event.issue.pull_request` 属性,根据触发对象是议题还是拉取请求,执行不同的操作。
For example, this workflow will run the `pr_commented` job only if the `issue_comment` event originated from a pull request. It will run the `issue_commented` job only if the `issue_comment` event originated from an issue.
例如,仅当 `issue_comment` 事件源自拉取请求时,此工作流程才会运行 `pr_commented` 作业。 仅当 `issue_comment` 事件源自某个议题时,它才会运行 `issue_commented` 作业。
```yaml
on: issue_comment
@@ -339,13 +339,13 @@ jobs:
{% note %}
**Note**: {% data reusables.developer-site.multiple_activity_types %} For information about each activity type, see "[Webhook events and payloads](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#issues)." {% data reusables.developer-site.limit_workflow_to_activity_types %}
**注意**{% data reusables.developer-site.multiple_activity_types %} 有关每种活动类型的信息,请参阅“[web 挂钩事件和有效负载](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#issues)”。 {% data reusables.developer-site.limit_workflow_to_activity_types %}
{% endnote %}
{% data reusables.actions.branch-requirement %}
Runs your workflow when an issue in the workflow's repository is created or modified. For activity related to comments in an issue, use the [`issue_comment`](#issue_comment) event. 有关议题的更多信息,请参阅“[关于议题](/issues/tracking-your-work-with-issues/about-issues)”。 For information about the issue APIs, see "[Issue](/graphql/reference/objects#issue)" in the GraphQL API documentation or "[Issues](/rest/reference/issues)" in the REST API documentation.
在创建或修改工作流程存储库中的议题时运行工作流程。 对于与议题中的评论相关的活动,请使用 [`issue_comment`](#issue_comment) 事件。 有关议题的更多信息,请参阅“[关于议题](/issues/tracking-your-work-with-issues/about-issues)”。 有关议题 API 的信息,请参阅 GraphQL API 文档中的“[Issue](/graphql/reference/objects#issue)”或 REST API 文档中的“[议题](/rest/reference/issues)”。
例如,您可以在议题为 `opened``edited``milestoned` 时运行工作流程。
@@ -363,15 +363,15 @@ on:
{% note %}
**Note**: {% data reusables.developer-site.multiple_activity_types %} For information about each activity type, see "[Webhook events and payloads](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#label)." {% data reusables.developer-site.limit_workflow_to_activity_types %}
**注意**{% data reusables.developer-site.multiple_activity_types %} 有关每种活动类型的信息,请参阅“[web 挂钩事件和有效负载](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#label)”。 {% data reusables.developer-site.limit_workflow_to_activity_types %}
{% endnote %}
{% data reusables.actions.branch-requirement %}
Runs your workflow when a label in your workflow's repository is created or modified. For more information about labels, see "[Managing labels](/issues/using-labels-and-milestones-to-track-work/managing-labels)." For information about the label APIs, see "[Label](/graphql/reference/objects#label)" in the GraphQL API documentation or "[Labels](/rest/reference/issues#labels)" in the REST API documentation.
在创建或修改工作流程存储库中的标签时运行工作流程。 有关标签的更多信息,请参阅“[管理标签](/issues/using-labels-and-milestones-to-track-work/managing-labels)”。 有关标签 API 的信息,请参阅 GraphQL API 文档中的“[标签](/graphql/reference/objects#label)”或 REST API 文档中的“[标签](/rest/reference/issues#labels)”。
If you want to run your workflow when a label is added to or removed from an issue, pull request, or discussion, use the `labeled` or `unlabeled` activity types for the [`issues`](#issues), [`pull_request`](#pull_request), [`pull_request_target`](#pull_request_target), or [`discussion`](#discussion) events instead.
如果要在议题、拉取请求或讨论中添加或删除标签时运行工作流程,请对 [`issues`](#issues)[`pull_request`](#pull_request)[`pull_request_target`](#pull_request_target) [`discussion`](#discussion) 事件使用 `labeled``unlabeled` 活动类型。
例如,您可以在标签为 `created``deleted` 时运行工作流程。
@@ -389,15 +389,15 @@ on:
{% note %}
**Note**: {% data reusables.developer-site.multiple_activity_types %} For information about each activity type, see "[Webhook events and payloads](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#milestone)." {% data reusables.developer-site.limit_workflow_to_activity_types %}
**注意**{% data reusables.developer-site.multiple_activity_types %} 有关每种活动类型的信息,请参阅“[web 挂钩事件和有效负载](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#milestone)”。 {% data reusables.developer-site.limit_workflow_to_activity_types %}
{% endnote %}
{% data reusables.actions.branch-requirement %}
Runs your workflow when a milestone in the workflow's repository is created or modified. For more information about milestones, see "[About milestones](/issues/using-labels-and-milestones-to-track-work/about-milestones)." For information about the milestone APIs, see "[Milestone](/graphql/reference/objects#milestone)" in the GraphQL API documentation or "[Milestones](/rest/reference/issues#milestones)" in the REST API documentation.
在创建或修改工作流程存储库中的里程碑时运行工作流程。 有关里程碑的更多信息,请参阅“[关于里程碑](/issues/using-labels-and-milestones-to-track-work/about-milestones)”。 有关里程碑 API 的信息,请参阅 GraphQL API 文档中的“[里程碑](/graphql/reference/objects#milestone)”或 REST API 文档中的“[里程碑](/rest/reference/issues#milestones)”。
If you want to run your workflow when an issue is added to or removed from a milestone, use the `milestoned` or `demilestoned` activity types for the [`issues`](#issues) event instead.
如果要在里程碑中添加或删除议题时运行工作流程,请改为对 [`issues`](#issues) 事件使用 `milestoned` `demilestoned` 活动类型。
例如,您可以在里程碑为 `opened``deleted` 时运行工作流程。
@@ -415,7 +415,7 @@ on:
{% data reusables.actions.branch-requirement %}
Runs your workflow when someone pushes to a branch that is the publishing source for {% data variables.product.prodname_pages %}, if {% data variables.product.prodname_pages %} is enabled for the repository. For more information about {% data variables.product.prodname_pages %} publishing sources, see "[Configuring a publishing source for your GitHub Pages site](/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#choosing-a-publishing-source)." 有关 REST API 的信息,请参阅“[页面](/rest/reference/repos#pages)”。
当有人推送到作为 {% data variables.product.prodname_pages %} 的发布源的分支时,如果为存储库启用了 {% data variables.product.prodname_pages %} ,则运行工作流程。 有关 {% data variables.product.prodname_pages %} 发布源的详细信息,请参阅“[ GitHub Pages 站点配置发布源](/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site#choosing-a-publishing-source)”。 有关 REST API 的信息,请参阅“[页面](/rest/reference/repos#pages)”。
例如,您可以在发生 `page_build` 事件时运行工作流程。
@@ -432,7 +432,7 @@ on:
{% note %}
**Note**: {% data reusables.developer-site.multiple_activity_types %} The `edited` activity type refers to when a project board, not a column or card on the project board, is edited. For information about each activity type, see "[Webhook events and payloads](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#project)." {% data reusables.developer-site.limit_workflow_to_activity_types %}
**注意**{% data reusables.developer-site.multiple_activity_types %} `edited` 活动类型是指编辑项目板(而不是项目板上的列或卡片)的时间。 有关每种活动类型的详细信息,请参阅“[web 挂钩事件和有效负载](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#project)”。 {% data reusables.developer-site.limit_workflow_to_activity_types %}
{% endnote %}
@@ -440,19 +440,19 @@ on:
{% note %}
**Note**: This event only occurs for projects owned by the workflow's repository, not for organization-owned or user-owned projects or for projects owned by another repository.
**注意**:此事件仅对工作流存储库拥有的项目发生,对于组织拥有或用户拥有的项目,或者对于其他存储库拥有的项目,不会发生此事件。
{% endnote %}
{% ifversion fpt or ghec %}
{% note %}
**Note**: This event does not occur for projects (beta). For more information, see "[About projects (beta)](/issues/trying-out-the-new-projects-experience/about-projects)."
**注意**:此事件对项目(测试版)不会发生。 更多信息请参阅“[关于项目(测试版)](/issues/trying-out-the-new-projects-experience/about-projects)”。
{% endnote %}
{% endif %}
Runs your workflow when a project board is created or modified. For activity related to cards or columns in a project board, use the [`project_card`](#project_card) or [`project_column`](#project_column) events instead. For more information about project boards, see "[About project boards](/issues/organizing-your-work-with-project-boards/managing-project-boards/about-project-boards)." For information about the project board APIs, see "[Project](/graphql/reference/objects#project)" in the GraphQL API documentation or "[Projects](/rest/reference/projects)" in the REST API documentation.
在创建或修改项目板时运行工作流程。 对于与项目板中的卡片或列相关的活动,请改用 [`project_card`](#project_card) [`project_column`](#project_column) 事件。 有关项目板的更多信息,请参阅“[关于项目板](/issues/organizing-your-work-with-project-boards/managing-project-boards/about-project-boards)”。 有关项目板 API 的信息,请参阅 GraphQL API 文档中的“[项目](/graphql/reference/objects#project)”或 REST API 文档中的“[项目](/rest/reference/projects)”。
例如,您可以在项目为 `created``deleted` 时运行工作流程。
@@ -470,7 +470,7 @@ on:
{% note %}
**Note**: {% data reusables.developer-site.multiple_activity_types %} For information about each activity type, see "[Webhook events and payloads](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#project_card)." {% data reusables.developer-site.limit_workflow_to_activity_types %}
**注意**{% data reusables.developer-site.multiple_activity_types %} 有关每种活动类型的信息,请参阅“[web 挂钩事件和有效负载](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#project_card)”。 {% data reusables.developer-site.limit_workflow_to_activity_types %}
{% endnote %}
@@ -478,21 +478,21 @@ on:
{% note %}
**Note**: This event only occurs for projects owned by the workflow's repository, not for organization-owned or user-owned projects or for projects owned by another repository.
**注意**:此事件仅对工作流存储库拥有的项目发生,对于组织拥有或用户拥有的项目,或者对于其他存储库拥有的项目,不会发生此事件。
{% endnote %}
{% ifversion fpt or ghec %}
{% note %}
**Note**: This event does not occur for projects (beta). For more information, see "[About projects (beta)](/issues/trying-out-the-new-projects-experience/about-projects)."
**注意**:此事件对项目(测试版)不会发生。 更多信息请参阅“[关于项目(测试版)](/issues/trying-out-the-new-projects-experience/about-projects)”。
{% endnote %}
{% endif %}
Runs your workflow when a card on a project board is created or modified. For activity related to project boards or columns in a project board, use the [`project`](#project) or [`project_column`](#project_column) event instead. For more information about project boards, see "[About project boards](/issues/organizing-your-work-with-project-boards/managing-project-boards/about-project-boards)." For information about the project card APIs, see "[ProjectCard](/graphql/reference/objects#projectcard)" in the GraphQL API documentation or "[Project cards](/rest/reference/projects#cards)" in the REST API documentation.
在创建或修改项目板上的卡片时运行工作流程。 对于与项目板或项目板中的列相关的活动,请改用 [`project`](#project) [`project_column`](#project_column) 事件。 有关项目板的更多信息,请参阅“[关于项目板](/issues/organizing-your-work-with-project-boards/managing-project-boards/about-project-boards)”。 有关项目卡 API 的信息,请参阅 GraphQL API 文档中的“[ProjectCard](/graphql/reference/objects#projectcard)”或 REST API 文档中的“[项目卡](/rest/reference/projects#cards)”。
For example, you can run a workflow when a project card has been `created` or `deleted`.
例如,您可以在项目卡为 `created` `deleted` 时运行工作流程。
```yaml
on:
@@ -508,7 +508,7 @@ on:
{% note %}
**Note**: {% data reusables.developer-site.multiple_activity_types %} For information about each activity type, see "[Webhook events and payloads](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#project_column)." {% data reusables.developer-site.limit_workflow_to_activity_types %}
**注意**{% data reusables.developer-site.multiple_activity_types %} 有关每种活动类型的信息,请参阅“[web 挂钩事件和有效负载](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#project_column)”。 {% data reusables.developer-site.limit_workflow_to_activity_types %}
{% endnote %}
@@ -516,19 +516,19 @@ on:
{% note %}
**Note**: This event only occurs for projects owned by the workflow's repository, not for organization-owned or user-owned projects or for projects owned by another repository.
**注意**:此事件仅对工作流存储库拥有的项目发生,对于组织拥有或用户拥有的项目,或者对于其他存储库拥有的项目,不会发生此事件。
{% endnote %}
{% ifversion fpt or ghec %}
{% note %}
**Note**: This event does not occur for projects (beta). For more information, see "[About projects (beta)](/issues/trying-out-the-new-projects-experience/about-projects)."
**注意**:此事件对项目(测试版)不会发生。 更多信息请参阅“[关于项目(测试版)](/issues/trying-out-the-new-projects-experience/about-projects)”。
{% endnote %}
{% endif %}
Runs your workflow when a column on a project board is created or modified. For activity related to project boards or cards in a project board, use the [`project`](#project) or [`project_card`](#project_card) event instead. For more information about project boards, see "[About project boards](/issues/organizing-your-work-with-project-boards/managing-project-boards/about-project-boards)." For information about the project column APIs, see "[Project Column](/graphql/reference/objects#projectcolumn)" in the GraphQL API documentation or "[Project columns](/rest/reference/projects#columns)" in the REST API documentation.
在创建或修改项目板上的列时运行工作流程。 对于与项目板或项目板中的卡相关的活动,请改用 [`project`](#project) [`project_card`](#project_card) 事件。 有关项目板的更多信息,请参阅“[关于项目板](/issues/organizing-your-work-with-project-boards/managing-project-boards/about-project-boards)”。 有关项目列 API 的信息,请参阅 GraphQL API 文档中的“[项目列](/graphql/reference/objects#projectcolumn)”或 REST API 文档中的“[项目列](/rest/reference/projects#columns)”。
例如,您可以在项目列为 `created``deleted` 时运行工作流程。
@@ -546,7 +546,7 @@ on:
{% data reusables.actions.branch-requirement %}
Runs your workflow when your workflow's repository changes from private to public. 有关 REST API 的信息,请参阅“[编辑仓库](/rest/reference/repos#edit)”。
当工作流程的存储库从私有变为公共时运行工作流程。 有关 REST API 的信息,请参阅“[编辑仓库](/rest/reference/repos#edit)”。
例如,您可以在发生 `public` 事件时运行工作流程。
@@ -563,29 +563,29 @@ on:
{% note %}
**Note**: {% data reusables.developer-site.multiple_activity_types %} For information about each activity type, see "[Webhook events and payloads](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request)." By default, a workflow only runs when a `pull_request` event's activity type is `opened`, `synchronize`, or `reopened`. You can specify different activity types using the `types` keyword. 更多信息请参阅“[{% data variables.product.prodname_actions %} 的工作流程语法](/articles/workflow-syntax-for-github-actions#onevent_nametypes)”。
**注意**{% data reusables.developer-site.multiple_activity_types %} 有关每种活动类型的信息,请参阅“[web 挂钩事件和有效负载](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request)”。 默认情况下,工作流程仅在 `pull_request` 事件的活动类型为 `opened``synchronize` `reopened` 时运行。 您可以使用 `types` 关键字指定不同的活动类型。 更多信息请参阅“[{% data variables.product.prodname_actions %} 的工作流程语法](/articles/workflow-syntax-for-github-actions#onevent_nametypes)”。
{% endnote %}
{% note %}
**Note:** By default, only the `opened`, `synchronize`, and `reopened` activity types trigger workflows that run on the `pull_request` event. To trigger workflows by different activity types, use the `types` keyword.
**注意:** 默认情况下,只有 `opened``synchronize` `reopened` 活动类型才会触发在 `pull_request` 事件上运行的工作流程。 要按不同的活动类型触发工作流,请使用 `types` 关键字。
{% endnote %}
{% note %}
**Note:** Workflows will not run on `pull_request` activity if the pull request has a merge conflict. 必须先解决合并冲突。
**注意:**如果拉取请求具有合并冲突,工作流程将不会在 `pull_request` 活动上运行。 必须先解决合并冲突。
Conversely, workflows with the `pull_request_target` event will run even if the pull request has a merge conflict. Before using the `pull_request_target` trigger, you should be aware of the security risks. For more information, see [`pull_request_target`](#pull_request_target).
相反,具有 `pull_request_target` 事件的工作流程将运行,即使拉取请求存在合并冲突也是如此。 在使用 `pull_request_target` 触发器之前,您应该了解安全风险。 更多信息请参阅 [`pull_request_target`](#pull_request_target)
{% endnote %}
Runs your workflow when activity on a pull request in the workflow's repository occurs. For example, if no activity types are specified, the workflow runs when a pull request is opened or reopened or when the head branch of the pull request is updated. For activity related to pull request reviews, pull request review comments, or pull request comments, use the [`pull_request_review`](#pull_request_review), [`pull_request_review_comment`](#pull_request_review_comment), or [`issue_comment`](#issue_comment) events instead. For information about the pull request APIs, see "[PullRequest](/graphql/reference/objects#pullrequest)" in the GraphQL API documentation or "[Pull requests](/rest/reference/pulls)" in the REST API documentation.
在工作流程存储库中发生有关拉取请求的活动时运行工作流程。 例如,如果未指定任何活动类型,则工作流程将在打开或重新打开拉取请求时运行,或者在更新拉取请求的头部分支时运行。 对于与拉取请求审阅、拉取请求审阅评论或拉取请求评论相关的活动,请改用 [`pull_request_review`](#pull_request_review)[`pull_request_review_comment`](#pull_request_review_comment) [`issue_comment`](#issue_comment) 事件。 有关拉取请求 API 的信息,请参阅 GraphQL API 文档中的“[PullRequest](/graphql/reference/objects#pullrequest)”或 REST API 文档中的“[拉取请求](/rest/reference/pulls)”。
Note that `GITHUB_SHA` for this event is the last merge commit of the pull request merge branch. If you want to get the commit ID for the last commit to the head branch of the pull request, use `github.event.pull_request.head.sha` instead.
请注意,此事件 `GITHUB_SHA` 是拉取请求合并分支的最后一个合并提交。 如果要获取最后一次提交到拉取请求的头部分支的提交 ID请改用 `github.event.pull_request.head.sha`
For example, you can run a workflow when a pull request has been opened or reopened.
例如,您可以在打开或重新打开拉取请求时运行工作流程。
```yaml
on:
@@ -593,7 +593,7 @@ on:
types: [opened, reopened]
```
You can use the event context to further control when jobs in your workflow will run. For example, this workflow will run when a review is requested on a pull request, but the `specific_review_requested` job will only run when a review by `octo-team` is requested.
您可以使用事件上下文进一步控制工作流程中作业的运行时间。 例如,此工作流程将在对请求审查拉取请求时运行,但 `specific_review_requested` 作业仅在请求 `octo-team` 审查时运行。
```yaml
on:
@@ -607,11 +607,11 @@ jobs:
- run: echo 'A review from octo-team was requested'
```
#### Running your workflow based on the head or base branch of a pull request
#### 基于拉取请求的头部分支或基本分支运行工作流程
You can use the `branches` or `branches-ignore` filter to configure your workflow to only run on pull requests that target specific branches. 更多信息请参阅“[GitHub Actions 的工作流程语法](/actions/learn-github-actions/workflow-syntax-for-github-actions#onpull_requestpull_request_targetbranchesbranches-ignore)”。
您可以使用 `branches` `branches-ignore` 筛选器,将工作流配置为仅针对特定分支的拉取请求运行。 更多信息请参阅“[GitHub Actions 的工作流程语法](/actions/learn-github-actions/workflow-syntax-for-github-actions#onpull_requestpull_request_targetbranchesbranches-ignore)”。
For example, this workflow will run when someone opens a pull request that targets a branch whose name starts with `releases/`:
例如,当有人打开面向名称以 `releases/` 开头的分支的拉取请求时,此工作流程将运行:
```yaml
on:
@@ -624,7 +624,7 @@ on:
{% note %}
**Note:** {% data reusables.actions.branch-paths-filter %} For example, the following workflow will only run when a pull request that includes a change to a JavaScript (`.js`) file is opened on a branch whose name starts with `releases/`:
**注意:**{% data reusables.actions.branch-paths-filter %} 例如,仅当在名称以 `releases/`开头的分支上打开包含 JavaScript (`.js`) 文件更改的拉取请求时,才会运行以下工作流程:
```yaml
on:
@@ -639,7 +639,7 @@ on:
{% endnote %}
To run a job based on the pull request's head branch name (as opposed to the pull request's base branch name), use the `github.head_ref` context in a conditional. For example, this workflow will run whenever a pull request is opened, but the `run_if` job will only execute if the head of the pull request is a branch whose name starts with `releases/`:
要基于拉取请求的头部分支名称(而不是拉取请求的基本分支名称)运行作业,请在条件中使用 `github.head_ref` 上下文。 例如,每当打开拉取请求时,此工作流程都会运行,但仅当拉取请求的头部是名称以 `releases/` 开头的分支时,才会执行 `run_if` 作业:
```yaml
on:
@@ -654,11 +654,11 @@ jobs:
- run: echo "The head of this PR starts with 'releases/'"
```
#### Running your workflow based on files changed in a pull request
#### 根据拉取请求中更改的文件运行工作流程
You can also configure your workflow to run when a pull request changes specific files. 更多信息请参阅“[GitHub Actions 的工作流程语法](/actions/learn-github-actions/workflow-syntax-for-github-actions#onpushpull_requestpull_request_targetpathspaths-ignore)”。
您还可以将工作流程配置为在拉取请求更改特定文件时运行。 更多信息请参阅“[GitHub Actions 的工作流程语法](/actions/learn-github-actions/workflow-syntax-for-github-actions#onpushpull_requestpull_request_targetpathspaths-ignore)”。
For example, this workflow will run when a pull request includes a change to a JavaScript file (`.js`):
例如,当拉取请求包含对 JavaScript 文件 (`.js`) 的更改时,此工作流程将运行:
```yaml
on:
@@ -669,7 +669,7 @@ on:
{% note %}
**Note:** {% data reusables.actions.branch-paths-filter %} For example, the following workflow will only run when a pull request that includes a change to a JavaScript (`.js`) file is opened on a branch whose name starts with `releases/`:
**注意:**{% data reusables.actions.branch-paths-filter %} 例如,仅当在名称以 `releases/`开头的分支上打开包含 JavaScript (`.js`) 文件更改的拉取请求时,才会运行以下工作流程:
```yaml
on:
@@ -684,9 +684,9 @@ on:
{% endnote %}
#### Running your workflow when a pull request merges
#### 在拉取请求合并时运行工作流程
When a pull request merges, the pull request is automatically closed. To run a workflow when a pull request merges, use the `pull_request` `closed` event type along with a conditional that checks the `merged` value of the event. For example, the following workflow will run whenever a pull request closes. The `if_merged` job will only run if the pull request was also merged.
当拉取请求合并时,拉取请求将自动关闭。 要在拉取请求合并时运行工作流程,请使用 `pull_request` `closed` 事件类型以及检查事件的 `merged` 值的条件。 例如,每当拉取请求关闭时,将运行以下工作流程。 仅当拉取请求也合并时, `if_merged` 作业才会运行。
```yaml
on:
@@ -705,9 +705,9 @@ jobs:
{% data reusables.developer-site.pull_request_forked_repos_link %}
### `pull_request_comment` (use `issue_comment`)
### `pull_request_comment`(使用 `issue_comment`
To run your workflow when a comment on a pull request (not on a pull request's diff) is created, edited, or deleted, use the [`issue_comment`](#issue_comment) event. For activity related to pull request reviews or pull request review comments, use the [`pull_request_review`](#pull_request_review) or [`pull_request_review_comment`](#pull_request_review_comment) events.
要在创建、编辑或删除对拉取请求(而不是拉取请求的差异)的评论时运行工作流程,请使用 [`issue_comment`](#issue_comment) 事件。 对于与拉取请求审核或拉取请求审核评论相关的活动,请使用 [`pull_request_review`](#pull_request_review) [`pull_request_review_comment`](#pull_request_review_comment) 事件。
### `pull_request_review`
@@ -717,11 +717,11 @@ To run your workflow when a comment on a pull request (not on a pull request's d
{% note %}
**Note**: {% data reusables.developer-site.multiple_activity_types %} For information about each activity type, see "[Webhook events and payloads](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request_review)." {% data reusables.developer-site.limit_workflow_to_activity_types %}
**注意**{% data reusables.developer-site.multiple_activity_types %} 有关每种活动类型的信息,请参阅“[web 挂钩事件和有效负载](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request_review)”。 {% data reusables.developer-site.limit_workflow_to_activity_types %}
{% endnote %}
Runs your workflow when a pull request review is submitted, edited, or dismissed. A pull request review is a group of pull request review comments in addition to a body comment and a state. For activity related to pull request review comments or pull request comments, use the [`pull_request_review_comment`](#pull_request_review_comment) or [`issue_comment`](#issue_comment) events instead. For information about the pull request review APIs, see "[PullRequestReview](/graphql/reference/objects#pullrequest)" in the GraphQL API documentation or "[Pull request reviews](/rest/reference/pulls#reviews)" in the REST API documentation.
在提交、编辑或关闭拉取请求审阅时运行工作流程。 拉取请求审查是除正文评论和状态之外的一组拉取请求审查评论。 对于与拉取请求审查评论或拉取请求评论相关的活动,请改用 [`pull_request_review_comment`](#pull_request_review_comment) [`issue_comment`](#issue_comment) 事件。 有关拉取请求审查 API 的信息,请参阅 GraphQL API 文档中的“[PullRequestReview](/graphql/reference/objects#pullrequest)”或 REST API 文档中的“[拉取请求审查](/rest/reference/pulls#reviews)”。
例如,您可以在拉取请求审查为 `edited``dismissed` 时运行工作流程。
@@ -731,9 +731,9 @@ on:
types: [edited, dismissed]
```
#### Running a workflow when a pull request is approved
#### 在批准拉取请求时运行工作流程
To run your workflow when a pull request has been approved, you can trigger your workflow with the `submitted` type of `pull_request_review` event, then check the review state with the `github.event.review.state` property. For example, this workflow will run whenever a pull request review is submitted, but the `approved` job will only run if the submitted review is an approving review:
要在拉取请求获得批准时运行工作流程,可以使用 `submitted` 类型的 `pull_request_review` 事件触发工作流程,然后使用 `github.event.review.state` 属性检查审查状态。 例如,每当提交拉取请求审查时,此工作流程都将运行,但`approved` 作业仅当提交的审查是批准审查时才会运行:
```yaml
on:
@@ -758,11 +758,11 @@ jobs:
{% note %}
**Note**: {% data reusables.developer-site.multiple_activity_types %} For information about each activity type, see "[Webhook events and payloads](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request_review_comment)." {% data reusables.developer-site.limit_workflow_to_activity_types %}
**注意**{% data reusables.developer-site.multiple_activity_types %} 有关每种活动类型的信息,请参阅“[web 挂钩事件和有效负载](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request_review_comment)”。 {% data reusables.developer-site.limit_workflow_to_activity_types %}
{% endnote %}
Runs your workflow when a pull request review comment is modified. A pull request review comment is a comment on a pull request's diff. For activity related to pull request reviews or pull request comments, use the [`pull_request_review`](#pull_request_review) or [`issue_comment`](#issue_comment) events instead. For information about the pull request review comment APIs, see "[PullRequestReviewComment](/graphql/reference/objects#pullrequestreviewcomment)" in the GraphQL API documentation or "[Review comments](/rest/reference/pulls#comments)" in the REST API documentation.
在修改拉取请求审查评论时运行工作流程。 拉取请求审查评论是对拉取请求差异的评论。 对于与拉取请求评论或拉取请求评论相关的活动,请改用 [`pull_request_review`](#pull_request_review) [`issue_comment`](#issue_comment) 事件。 有关拉取请求审查评论 API 的信息,请参阅 GraphQL API 文档中的“[PullRequestReviewComment](/graphql/reference/objects#pullrequestreviewcomment)”或 REST API 文档中的“[审查评论](/rest/reference/pulls#comments)”。
例如,您可以在拉取请求审查评论为 `created``deleted` 时运行工作流程。
@@ -782,23 +782,23 @@ on:
{% note %}
**Note**: {% data reusables.developer-site.multiple_activity_types %} For information about each activity type, see "[Webhook events and payloads](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request_target)." 默认情况下,工作流程仅在 `pull_request_target` 的活动类型为 `opened``synchronize``reopened` 时运行。 要让更多活动类型触发工作流程,请使用 `types` 关键词。 You can specify different activity types using the `types` keyword. 更多信息请参阅“[{% data variables.product.prodname_actions %} 的工作流程语法](/articles/workflow-syntax-for-github-actions#onevent_nametypes)”。
**注意**{% data reusables.developer-site.multiple_activity_types %} 有关每种活动类型的信息,请参阅“[web 挂钩事件和有效负载](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request_target)”。 默认情况下,工作流程仅在 `pull_request_target` 的活动类型为 `opened``synchronize``reopened` 时运行。 要让更多活动类型触发工作流程,请使用 `types` 关键词。 您可以使用 `types` 关键字指定不同的活动类型。 更多信息请参阅“[{% data variables.product.prodname_actions %} 的工作流程语法](/articles/workflow-syntax-for-github-actions#onevent_nametypes)”。
{% endnote %}
{% note %}
**Note:** By default, only the `opened`, `synchronize`, and `reopened` activity types trigger workflows that run on the `pull_request` event. To trigger workflows by different activity types, use the `types` keyword.
**注意:** 默认情况下,只有 `opened``synchronize` `reopened` 活动类型才会触发在 `pull_request` 事件上运行的工作流程。 要按不同的活动类型触发工作流,请使用 `types` 关键字。
{% endnote %}
Runs your workflow when activity on a pull request in the workflow's repository occurs. For example, if no activity types are specified, the workflow runs when a pull request is opened or reopened or when the head branch of the pull request is updated.
在工作流程存储库中发生有关拉取请求的活动时运行工作流程。 例如,如果未指定任何活动类型,则工作流程将在打开或重新打开拉取请求时运行,或者在更新拉取请求的头部分支时运行。
This event runs in the context of the base of the pull request, rather than in the context of the merge commit, as the `pull_request` event does. This prevents execution of unsafe code from the head of the pull request that could alter your repository or steal any secrets you use in your workflow. This event allows your workflow to do things like label or comment on pull requests from forks. Avoid using this event if you need to build or run code from the pull request.
此事件在拉取请求基础的上下文中运行,而不是像 `pull_request` 事件一样在合并提交的上下文中运行。 这样可以防止从拉取请求的头部执行不安全的代码,以免更改您的仓库或窃取您在工作流程中使用的任何机密。 此事件允许您的工作流程对来自复刻的拉取请求执行标记或评论等操作。 如果需要从拉取请求构建或运行代码,请避免使用此事件。
{% warning %}
**Warning:** For workflows that are triggered by the `pull_request_target` event, the `GITHUB_TOKEN` is granted read/write repository permission unless the `permissions` key is specified and the workflow can access secrets, even when it is triggered from a fork. 虽然工作流程在拉取请求的基础上下文中运行,但您应该确保不在此事件中检出、生成或运行来自拉取请求的不受信任代码。 Additionally, any caches share the same scope as the base branch. To help prevent cache poisoning, you should not save the cache if there is a possibility that the cache contents were altered. 更多信息请参阅 GitHub 安全实验室网站上的“[保持 GitHub Actions 和工作流程安全:阻止 pwn 请求](https://securitylab.github.com/research/github-actions-preventing-pwn-requests)”。
**警告:** 对于由 `pull_request_target` 事件触发的工作流程,除非指定了 `permissions` 密钥并且工作流程可以访问机密,否则将向 `GITHUB_TOKEN` 授予读/写存储库权限, 即使它是从复刻触发的。 虽然工作流程在拉取请求的基础上下文中运行,但您应该确保不在此事件中检出、生成或运行来自拉取请求的不受信任代码。 此外,任何缓存都与基本分支共享相同的作用域。 为帮助防止缓存中毒,如果缓存内容可能已更改,则不应保存缓存。 更多信息请参阅 GitHub 安全实验室网站上的“[保持 GitHub Actions 和工作流程安全:阻止 pwn 请求](https://securitylab.github.com/research/github-actions-preventing-pwn-requests)”。
{% endwarning %}
@@ -810,11 +810,11 @@ on:
types: [assigned, opened, synchronize, reopened]
```
#### Running your workflow based on the head or base branch of a pull request
#### 基于拉取请求的头部分支或基本分支运行工作流程
You can use the `branches` or `branches-ignore` filter to configure your workflow to only run on pull requests that target specific branches. 更多信息请参阅“[GitHub Actions 的工作流程语法](/actions/learn-github-actions/workflow-syntax-for-github-actions#onpull_requestpull_request_targetbranchesbranches-ignore)”。
您可以使用 `branches` `branches-ignore` 筛选器,将工作流配置为仅针对特定分支的拉取请求运行。 更多信息请参阅“[GitHub Actions 的工作流程语法](/actions/learn-github-actions/workflow-syntax-for-github-actions#onpull_requestpull_request_targetbranchesbranches-ignore)”。
For example, this workflow will run when someone opens a pull request that targets a branch whose name starts with `releases/`:
例如,当有人打开面向名称以 `releases/` 开头的分支的拉取请求时,此工作流程将运行:
```yaml
on:
@@ -827,7 +827,7 @@ on:
{% note %}
**Note:** {% data reusables.actions.branch-paths-filter %} For example, the following workflow will only run when a pull request that includes a change to a JavaScript (`.js`) file is opened on a branch whose name starts with `releases/`:
**注意:**{% data reusables.actions.branch-paths-filter %} 例如,仅当在名称以 `releases/`开头的分支上打开包含 JavaScript (`.js`) 文件更改的拉取请求时,才会运行以下工作流程:
```yaml
on:
@@ -842,7 +842,7 @@ on:
{% endnote %}
To run a job based on the pull request's head branch name (as opposed to the pull request's base branch name), use the `github.head_ref` context in a conditional. For example, this workflow will run whenever a pull request is opened, but the `run_if` job will only execute if the head of the pull request is a branch whose name starts with `releases/`:
要基于拉取请求的头部分支名称(而不是拉取请求的基本分支名称)运行作业,请在条件中使用 `github.head_ref` 上下文。 例如,每当打开拉取请求时,此工作流程都会运行,但仅当拉取请求的头部是名称以 `releases/` 开头的分支时,才会执行 `run_if` 作业:
```yaml
on:
@@ -857,11 +857,11 @@ jobs:
- run: echo "The head of this PR starts with 'releases/'"
```
#### Running your workflow based on files changed in a pull request
#### 根据拉取请求中更改的文件运行工作流程
You can use the `paths` or `paths-ignore` filter to configure your workflow to run when a pull request changes specific files. 更多信息请参阅“[GitHub Actions 的工作流程语法](/actions/learn-github-actions/workflow-syntax-for-github-actions#onpushpull_requestpull_request_targetpathspaths-ignore)”。
您可以使用 `paths` `paths-ignore` 筛选器来配置工作流程,以便在拉取请求更改特定文件时运行。 更多信息请参阅“[GitHub Actions 的工作流程语法](/actions/learn-github-actions/workflow-syntax-for-github-actions#onpushpull_requestpull_request_targetpathspaths-ignore)”。
For example, this workflow will run when a pull request includes a change to a JavaScript file (`.js`):
例如,当拉取请求包含对 JavaScript 文件 (`.js`) 的更改时,此工作流程将运行:
```yaml
on:
@@ -872,7 +872,7 @@ on:
{% note %}
**Note:** {% data reusables.actions.branch-paths-filter %} For example, the following workflow will only run when a pull request that includes a change to a JavaScript (`.js`) file is opened on a branch whose name starts with `releases/`:
**注意:**{% data reusables.actions.branch-paths-filter %} 例如,仅当在名称以 `releases/`开头的分支上打开包含 JavaScript (`.js`) 文件更改的拉取请求时,才会运行以下工作流程:
```yaml
on:
@@ -887,9 +887,9 @@ on:
{% endnote %}
#### Running your workflow when a pull request merges
#### 在拉取请求合并时运行工作流程
When a pull request merges, the pull request is automatically closed. To run a workflow when a pull request merges, use the `pull_request_target` `closed` event type along with a conditional that checks the `merged` value of the event. For example, the following workflow will run whenever a pull request closes. The `if_merged` job will only run if the pull request was also merged.
当拉取请求合并时,拉取请求将自动关闭。 要在拉取请求合并时运行工作流程,请使用 `pull_request_target` `closed` 事件类型以及检查事件的 `merged` 值的条件。 例如,每当拉取请求关闭时,将运行以下工作流程。 仅当拉取请求也合并时, `if_merged` 作业才会运行。
```yaml
on:
@@ -914,17 +914,17 @@ jobs:
{% note %}
**注:**适用于 GitHub Actions 的 web 挂钩有效负载在 `commit` 对象中不包括 `added``removed``modified` 属性。 You can retrieve the full commit object using the API. For information, see "[Commit](/graphql/reference/objects#commit)" in the GraphQL API documentation or "[Get a commit](/rest/reference/commits#get-a-commit)" in the REST API documentation.
**注:**适用于 GitHub Actions 的 web 挂钩有效负载在 `commit` 对象中不包括 `added``removed``modified` 属性。 您可以使用 API 检索完整的提交对象。 有关信息,请参阅 GraphQL API 文档中的“[提交](/graphql/reference/objects#commit)”或 REST API 文档中的“[获取提交](/rest/reference/commits#get-a-commit)”。
{% endnote %}
{% note %}
**Note**: An event will not be created when you push more than three tags at once.
**注意**:一次推送三个以上的标记时,不会创建事件。
{% endnote %}
Runs your workflow when you push a commit or tag.
在推送提交或标记时运行工作流程。
例如,您可以在发生 `push` 事件时运行工作流程。
@@ -933,11 +933,11 @@ on:
push
```
#### Running your workflow only when a push to specific branches occurs
#### 仅在推送到特定分支时运行工作流程
You can use the `branches` or `branches-ignore` filter to configure your workflow to only run when specific branches are pushed. 更多信息请参阅“[GitHub Actions 的工作流程语法](/actions/learn-github-actions/workflow-syntax-for-github-actions#onpushbranchestagsbranches-ignoretags-ignore)”。
您可以使用 `branches` `branches-ignore` 筛选器,将工作流程配置为仅在推送特定分支时运行。 更多信息请参阅“[GitHub Actions 的工作流程语法](/actions/learn-github-actions/workflow-syntax-for-github-actions#onpushbranchestagsbranches-ignoretags-ignore)”。
For example, this workflow will run when someone pushes to `main` or to a branch that starts with `releases/`.
例如,当有人推送到 `main` 分支或以 `releases/` 开头的分支时,此工作流程将运行。
```yaml
on:
@@ -949,7 +949,7 @@ on:
{% note %}
**Note:** {% data reusables.actions.branch-paths-filter %} For example, the following workflow will only run when a push that includes a change to a JavaScript (`.js`) file is made to a branch whose name starts with `releases/`:
**注意:**{% data reusables.actions.branch-paths-filter %} 例如,仅当向名称以 `releases/`开头的分支发出包含 JavaScript (`.js`) 文件更改的推送时,才会运行以下工作流程:
```yaml
on:
@@ -962,11 +962,11 @@ on:
{% endnote %}
#### Running your workflow only when a push of specific tags occurs
#### 仅在发生特定标记的推送时运行工作流程
You can use the `tags` or `tags-ignore` filter to configure your workflow to only run when specific tags or are pushed. 更多信息请参阅“[GitHub Actions 的工作流程语法](/actions/learn-github-actions/workflow-syntax-for-github-actions#onpushbranchestagsbranches-ignoretags-ignore)”。
您可以使用 `tags` `tags-ignore` 筛选器,将工作流程配置为仅在特定标记或推送时运行。 更多信息请参阅“[GitHub Actions 的工作流程语法](/actions/learn-github-actions/workflow-syntax-for-github-actions#onpushbranchestagsbranches-ignoretags-ignore)”。
For example, this workflow will run when someone pushes a tag that starts with `v1.`.
例如,当有人推送以 `v1.` 开头的标记时,此工作流程将运行。
```yaml
on:
@@ -975,11 +975,11 @@ on:
- v1.**
```
#### Running your workflow only when a push affects specific files
#### 仅当推送影响特定文件时才运行工作流程
You can use the `paths` or `paths-ignore` filter to configure your workflow to run when a push to specific files occurs. 更多信息请参阅“[GitHub Actions 的工作流程语法](/actions/learn-github-actions/workflow-syntax-for-github-actions#onpushpull_requestpull_request_targetpathspaths-ignore)”。
可以使用 `paths` `paths-ignore` 筛选器配置工作流程在推送到特定文件时运行。 更多信息请参阅“[GitHub Actions 的工作流程语法](/actions/learn-github-actions/workflow-syntax-for-github-actions#onpushpull_requestpull_request_targetpathspaths-ignore)”。
For example, this workflow will run when someone pushes a change to a JavaScript file (`.js`):
例如,当有人将更改推送到 JavaScript 文件 (`.js`)时,此工作流程将运行:
```yaml
on:
@@ -990,7 +990,7 @@ on:
{% note %}
**Note:** {% data reusables.actions.branch-paths-filter %} For example, the following workflow will only run when a push that includes a change to a JavaScript (`.js`) file is made to a branch whose name starts with `releases/`:
**注意:**{% data reusables.actions.branch-paths-filter %} 例如,仅当向名称以 `releases/`开头的分支发出包含 JavaScript (`.js`) 文件更改的推送时,才会运行以下工作流程:
```yaml
on:
@@ -1011,13 +1011,13 @@ on:
{% note %}
**Note**: {% data reusables.developer-site.multiple_activity_types %} For information about each activity type, see "[Webhook events and payloads](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#registry_package)." {% data reusables.developer-site.limit_workflow_to_activity_types %}
**注意**{% data reusables.developer-site.multiple_activity_types %} 有关每种活动类型的信息,请参阅“[web 挂钩事件和有效负载](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#registry_package)”。 {% data reusables.developer-site.limit_workflow_to_activity_types %}
{% endnote %}
{% data reusables.actions.branch-requirement %}
Runs your workflow when activity related to {% data variables.product.prodname_registry %} occurs in your repository. 更多信息请参阅“[{% data variables.product.prodname_registry %} 文档](/packages)”。
当存储库中发生与 {% data variables.product.prodname_registry %} 相关的活动时运行工作流程。 更多信息请参阅“[{% data variables.product.prodname_registry %} 文档](/packages)”。
例如,您可以在软件包为 `published` 时运行工作流程。
@@ -1029,19 +1029,19 @@ on:
### `发行版`
| Web 挂钩事件有效负载 | 活动类型 | `GITHUB_SHA` | `GITHUB_REF` |
| -------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ----------------------------------------------- |
| [`发行版`](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads/#release) | - `published` <br/>- `unpublished` <br/>- `created` <br/>- `edited` <br/>- `deleted` <br/>- `prereleased`<br/> - `released` | 标记的发行版中的最新提交 | Tag ref of release `refs/tags/<tag_name>` |
| Web 挂钩事件有效负载 | 活动类型 | `GITHUB_SHA` | `GITHUB_REF` |
| -------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | -------------------------------------- |
| [`发行版`](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads/#release) | - `published` <br/>- `unpublished` <br/>- `created` <br/>- `edited` <br/>- `deleted` <br/>- `prereleased`<br/> - `released` | 标记的发行版中的最新提交 | 发行版 `refs/tags/<tag_name>` 的标记引用 |
{% note %}
**Note**: {% data reusables.developer-site.multiple_activity_types %} For information about each activity type, see "[Webhook events and payloads](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#release)." {% data reusables.developer-site.limit_workflow_to_activity_types %}
**注意**{% data reusables.developer-site.multiple_activity_types %} 有关每种活动类型的信息,请参阅“[web 挂钩事件和有效负载](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#release)”。 {% data reusables.developer-site.limit_workflow_to_activity_types %}
{% endnote %}
{% note %}
**Note:** Workflows are not triggered for the `created`, `edited`, or `deleted` activity types for draft releases. When you create your release through the {% data variables.product.product_name %} browser UI, your release may automatically be saved as a draft.
**注意**:对于草稿发行版的 `created``edited` `deleted` 活动类型,不会触发工作流程。 当您通过 {% data variables.product.product_name %} 浏览器 UI 创建版本时,您的版本可能会自动另存为草稿。
{% endnote %}
@@ -1051,7 +1051,7 @@ on:
{% endnote %}
Runs your workflow when release activity in your repository occurs. For information about the release APIs, see "[Release](/graphql/reference/objects#release)" in the GraphQL API documentation or "[Releases](/rest/reference/repos#releases)" in the REST API documentation.
在存储库中发生发布活动时运行工作流程。 有关发行版 API 的信息,请参阅 GraphQL API 文档中的“[发行版](/graphql/reference/objects#release)”或 REST API 文档中的“[发行版](/rest/reference/repos#releases)”。
例如,您可以在版本发布为 `published` 时运行工作流程。
@@ -1071,7 +1071,7 @@ on:
当您想要触发在 {% data variables.product.product_name %} 外发生的活动的工作流程时,可以使用 {% data variables.product.product_name %} API 触发名为 [`repository_dispatch`](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads/#repository_dispatch) 的 web 挂钩事件。 更多信息请参阅“[创建仓库调度事件](/rest/reference/repos#create-a-repository-dispatch-event)”。
When you make a request to create a `repository_dispatch` event, you must specify an `event_type` to describe the activity type. By default, all `repository_dispatch` activity types trigger a workflow to run. You can use the `types` keyword to limit your workflow to run when a specific `event_type` value is sent in the `repository_dispatch` webhook payload.
当您请求创建 `repository_dispatch` 事件时,必须指定 `event_type` 以描述活动类型。 默认情况下,所有 `repository_dispatch` 活动类型都会触发工作流程运行。 您可以使用 `types` 关键字来限制工作流程在 `repository_dispatch` web 挂钩负载中发送特定 `event_type` 值时运行。
```yaml
on:
@@ -1079,7 +1079,7 @@ on:
types: [on-demand-test]
```
Any data that you send through the `client_payload` parameter will be available in the `github.event` context in your workflow. For example, if you send this request body when you create a repository dispatch event:
通过 `client_payload` 参数发送的任何数据都将在工作流程中的 `github.event` 上下文中提供。 例如,如果在创建存储库调度事件时发送此请求正文:
```json
{
@@ -1091,7 +1091,7 @@ Any data that you send through the `client_payload` parameter will be available
}
```
then you can access the payload in a workflow like this:
则您可以在如下工作流程中访问有效负载:
```yaml
on:
@@ -1136,12 +1136,12 @@ jobs:
您可在这五个字段中使用以下运算符:
| 运算符 | 描述 | 示例 |
| --- | ------ | ---------------------------------------------------------------- |
| * | 任意值 | `15 * * * *` runs at every minute 15 of every hour of every day. |
| , | 值列表分隔符 | `2,10 4,5 * * *` 在每天第 4 和第 5 小时的第 2 和第 10 分钟运行。 |
| - | 值的范围 | `30 4-6 * * *` runs at minute 30 of the 4th, 5th, and 6th hour. |
| / | 步骤值 | `20/15 * * * *` 从第 20 分钟到第 59 分钟每隔 15 分钟运行(第 20、35 和 50 分钟)。 |
| 运算符 | 描述 | 示例 |
| --- | ------ | ------------------------------------------------------------ |
| * | 任意值 | `15 * * *` 每天每小时的每个第 15 分钟运行。 |
| , | 值列表分隔符 | `2,10 4,5 * * *` 在每天第 4 和第 5 小时的第 2 和第 10 分钟运行。 |
| - | 值的范围 | `30 4-6 * * *` 在第 4、5 和 6 小时的第 30 分钟运行。 |
| / | 步骤值 | `20/15 * * * *` 从第 20 分钟到第 59 分钟每隔 15 分钟运行(第 20、35 和 50 分钟)。 |
{% note %}
@@ -1151,7 +1151,7 @@ jobs:
您可以使用 [crontab guru](https://crontab.guru/) 帮助生成计划任务语法并确认它在何时运行。 为帮助您开始,我们还提供了一系列 [crontab guru 示例](https://crontab.guru/examples.html)。
计划工作流程的通知将发送给最后修改工作流程文件中的 cron 语法的用户。 For more information, see "[Notifications for workflow runs](/actions/guides/about-continuous-integration#notifications-for-workflow-runs)."
计划工作流程的通知将发送给最后修改工作流程文件中的 cron 语法的用户。 更多信息请参阅“[工作流程运行通知](/actions/guides/about-continuous-integration#notifications-for-workflow-runs)”。
### `状态`
@@ -1161,7 +1161,7 @@ jobs:
{% data reusables.actions.branch-requirement %}
Runs your workflow when the status of a Git commit changes. For example, commits can be marked as `error`, `failure`, `pending`, or `success`. If you want to provide more details about the status change, you may want to use the [`check_run`](#check_run) event. For information about the commit status APIs, see "[Status](/graphql/reference/objects#statue)" in the GraphQL API documentation or "[Statuses](/rest/reference/commits#commit-statuses)" in the REST API documentation.
在 Git 提交状态更改时运行工作流程。 例如,提交可标记为 `error``failure``pending` `success`。 如果要提供有关状态更改的更多详细信息,则可能需要使用 [`check_run`](#check_run) 事件。 有关提交状态 API 的信息,请参阅 GraphQL API 文档中的“[状态](/graphql/reference/objects#statue)”或 REST API 文档中的“[状态](/rest/reference/commits#commit-statuses)”。
例如,您可以在发生 `status` 事件时运行工作流程。
@@ -1170,7 +1170,7 @@ on:
status
```
If you want to run a job in your workflow based on the new commit state, you can use the `github.event.state` context. For example, the following workflow triggers when a commit status changes, but the `if_error_or_failure` job only runs if the new commit state is `error` or `failure`.
如果要基于新的提交状态在工作流程中运行作业,可以使用 `github.event.state` 上下文。 例如,以下工作流程在提交状态更改时触发,但仅当新的提交状态为 `error` 或 `failure` 时, `if_error_or_failure` 作业才会运行。
```yaml
on:
@@ -1196,15 +1196,15 @@ jobs:
{% note %}
**Note**: {% data reusables.developer-site.multiple_activity_types %} Although only the `started` activity type is supported, specifying the activity type will keep your workflow specific if more activity types are added in the future. For information about each activity type, see "[Webhook events and payloads](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#watch)." {% data reusables.developer-site.limit_workflow_to_activity_types %}
**注意**{% data reusables.developer-site.multiple_activity_types %}尽管仅支持 `started` 活动类型,但如果将来添加更多活动类型,则指定活动类型将使您的工作流程保持特定。 有关每种活动类型的详细信息,请参阅“[web 挂钩事件和有效负载](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#watch)”。 {% data reusables.developer-site.limit_workflow_to_activity_types %}
{% endnote %}
{% data reusables.actions.branch-requirement %}
Runs your workflow when the workflow's repository is starred. For information about the pull request APIs, see "[addStar](/graphql/reference/mutations#addstar)" in the GraphQL API documentation or "[Starring](/rest/reference/activity#starring)" in the REST API documentation.
在工作流程的存储库加星标时运行工作流程。 有关拉取请求 API 的信息,请参阅 GraphQL API 文档中的“[addStar](/graphql/reference/mutations#addstar)”或 REST API 文档中的“[标星](/rest/reference/activity#starring)”。
For example, you can run a workflow when someone stars a repository, which is the `started` activity type for a watch event.
例如,您可以在某人为仓库加星标时(即关注事件的 `started` 活动类型)运行工作流程。
```yaml
on:
@@ -1216,13 +1216,13 @@ on:
### `workflow_call`
| Web 挂钩事件有效负载 | 活动类型 | `GITHUB_SHA` | `GITHUB_REF` |
| --------------------------- | ---- | --------------------------- | --------------------------- |
| Same as the caller workflow | n/a | Same as the caller workflow | Same as the caller workflow |
| Web 挂钩事件有效负载 | 活动类型 | `GITHUB_SHA` | `GITHUB_REF` |
| ------------ | ---- | ------------ | ------------ |
| 与调用方工作流程相同 | n/a | 与调用方工作流程相同 | 与调用方工作流程相同 |
`workflow_call` is used to indicate that a workflow can be called by another workflow. When a workflow is triggered with the `workflow_call` event, the event payload in the called workflow is the same event payload from the calling workflow. 更多信息请参阅“[重用工作流程](/actions/learn-github-actions/reusing-workflows)”。
`workflow_call` 用于指示一个工作流程可以由另一个工作流程调用。 当使用 `workflow_call` 事件触发工作流程时,被调用工作流程中的事件负载与调用工作流程中的事件负载相同。 更多信息请参阅“[重用工作流程](/actions/learn-github-actions/reusing-workflows)”。
The example below only runs the workflow when it's called from another workflow:
以下示例仅在从另一个工作流程调用时运行工作流程:
```yaml
on: workflow_call
@@ -1236,18 +1236,18 @@ on: workflow_call
| ------------------------------------------------------------------------------------------------------------ | ---- | --------------------- | ------------ |
| [workflow_dispatch](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads/#workflow_dispatch) | n/a | `GITHUB_REF` 分支上的最新提交 | 收到了分发的分支 |
To manually trigger a workflow, use the `workflow_dispatch` event. You can manually trigger a workflow run using the {% data variables.product.product_name %} API, {% data variables.product.prodname_cli %}, or {% data variables.product.product_name %} browser interface. 更多信息请参阅“[手动配置工作流程](/actions/managing-workflow-runs/manually-running-a-workflow)。
要手动触发工作流程,请使用 `workflow_dispatch` 事件。 您可以使用 {% data variables.product.product_name %} API{% data variables.product.prodname_cli %} {% data variables.product.product_name %} 浏览器界面手动触发工作流程运行。 更多信息请参阅“[手动配置工作流程](/actions/managing-workflow-runs/manually-running-a-workflow)。
```yaml
on: workflow_dispatch
```
#### Providing inputs
#### 提供输入
您可以直接在工作流程中配置事件的自定义输入属性、默认输入值和必要输入。 When you trigger the event, you can provide the `ref` and any `inputs`. 当工作流程运行时,您可以访问 `github.event.inputs` 上下文中的输入值。 更多信息请参阅“[上下文](/actions/learn-github-actions/contexts)”。
您可以直接在工作流程中配置事件的自定义输入属性、默认输入值和必要输入。 触发事件时,可以提供 `ref` 和任何 `inputs` 当工作流程运行时,您可以访问 `github.event.inputs` 上下文中的输入值。 更多信息请参阅“[上下文](/actions/learn-github-actions/contexts)”。
{% ifversion fpt or ghec or ghes > 3.3 or ghae-issue-5511 %}
This example defines inputs called `logLevel`, `tags`, and `environment`. You pass values for these inputs to the workflow when you run it. This workflow then prints the values to the log, using the `github.event.inputs.logLevel`, `github.event.inputs.tags`, and `github.event.inputs.environment` context properties.
此示例定义了称为 `logLevel``tags` `environment` 的输入。 在运行工作流程时,可以将这些输入的值传递给工作流程。 然后,此工作流程使用 `github.event.inputs.logLevel``github.event.inputs.tags` `github.event.inputs.environment` 上下文属性,将值输出到日志中。
{% raw %}
```yaml
@@ -1287,17 +1287,17 @@ jobs:
```
{% endraw %}
If you run this workflow from a browser you must enter values for the required inputs manually before the workflow will run.
如果从浏览器运行此工作流程,则必须在工作流程运行之前手动输入所需输入的值。
![Entering inputs for a workflow](/assets/images/help/images/workflow-dispatch-inputs.png)
![输入工作流程的输入](/assets/images/help/images/workflow-dispatch-inputs.png)
You can also pass inputs when you run a workflow from a script, or by using {% data variables.product.prodname_cli %}. 例如:
还可以在从脚本运行工作流程时传递输入,或者使用 {% data variables.product.prodname_cli %} 例如:
```
gh workflow run run-tests.yml -f logLevel=warning -f tags=false -f environment=staging
```
For more information, see the {% data variables.product.prodname_cli %} information in "[Manually running a workflow](/actions/managing-workflow-runs/manually-running-a-workflow)."
更多信息请参阅“[手动运行工作流程](/actions/managing-workflow-runs/manually-running-a-workflow)”中的 {% data variables.product.prodname_cli %} 信息。
{% else %}
此示例定义了 `name` 和 `home` 输入,并使用 `github.event.inputs.name` 和 `github.event.inputs.home` 上下文打印。 如果未提供 `home` 则打印默认值“The Octoverse”。
@@ -1337,7 +1337,7 @@ jobs:
{% note %}
**Note**: {% data reusables.developer-site.multiple_activity_types %} The `requested` activity type does no occur when a workflow is re-run. For information about each activity type, see "[Webhook events and payloads](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_run)." {% data reusables.developer-site.limit_workflow_to_activity_types %}
**Note**: {% data reusables.developer-site.multiple_activity_types %} The `requested` activity type does not occur when a workflow is re-run. 有关每种活动类型的详细信息,请参阅“[web 挂钩事件和有效负载](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_run)”。 {% data reusables.developer-site.limit_workflow_to_activity_types %}
{% endnote %}
@@ -1345,11 +1345,11 @@ jobs:
{% note %}
**Note:** You can't use `workflow_run` to chain together more than three levels of workflows. For example, if you attempt to trigger five workflows (named `B` to `F`) to run sequentially after an initial workflow `A` has run (that is: `A` → `B` → `C` → `D` → `E` → `F`), workflows `E` and `F` will not be run.
**注意:** 不能使用 `workflow_run` 将超过三级的工作流程链接在一起。 例如,如果尝试触发五个工作流程(名称为 `B` `F`)在初始工作流程 `A` 运行后按顺序运行(即:`A` → `B` → `C` → `D` → `E` → `F`),则工作流程 `E` `F` 不会运行。
{% endnote %}
This event occurs when a workflow run is requested or completed. It allows you to execute a workflow based on execution or completion of another workflow. 由 `workflow_run` 事件启动的工作流程能够访问密钥和写入令牌,即使以前的工作流程不能访问也一样。 这在以前的工作流程有意未获权限的情况下很有用,但您需要在以后的工作流程中采取特权行动。
此事件在请求或完成工作流程运行时发生。 它允许您基于另一个工作流程的执行或完成来执行工作流程。 由 `workflow_run` 事件启动的工作流程能够访问密钥和写入令牌,即使以前的工作流程不能访问也一样。 这在以前的工作流程有意未获权限的情况下很有用,但您需要在以后的工作流程中采取特权行动。
在此示例中,工作流程配置为在单独的“运行测试”工作流程完成后运行。
@@ -1361,7 +1361,7 @@ on:
- completed
```
If you specify multiple `workflows` for the `workflow_run` event, only one of the workflows needs to run. For example, a workflow with the following trigger will run whenever the "Staging" workflow or the "Lab" workflow completes.
如果为 `workflow_run` 事件指定了多个 `workflows` ,则只需运行其中一个工作流程。 例如,具有以下触发器的工作流程将在 "Staging" 工作流程或 "Lab" 工作流程完成时运行。
```yaml
on:
@@ -1371,9 +1371,9 @@ on:
- completed
```
#### Running a workflow based on the conclusion of another workflow
#### 基于另一个工作流程的结果运行工作流程
A workflow run is triggered regardless of the conclusion of the previous workflow. If you want to run a job or step based on the result of the triggering workflow, you can use a conditional with the `github.event.workflow_run.conclusion` property. For example, this workflow will run whenever a workflow named "Build" completes, but the `on-success` job will only run if the "Build" workflow succeeded, and the `on-failure` job will only run if the "Build" workflow failed:
无论上一个工作流程的结果如何,工作流程运行都会被触发。 如果要基于触发工作流程的结果运行作业或步骤,则可以使用带有 `github.event.workflow_run.conclusion` 属性的条件。 例如,每当名为 "Build" 的工作流程完成时,此工作流程就会运行,但 `on-success` 作业仅在 "Build" 工作流程成功时才会运行,而 `on-failure` 作业仅在 "Build" 工作流程失败时才会运行:
```yaml
on:
@@ -1394,9 +1394,9 @@ jobs:
- run: echo 'The triggering workflow failed'
```
#### Limiting your workflow to run based on branches
#### 将工作流限于基于分支的运行
You can use the `branches` or `branches-ignore` filter to specify what branches the triggering workflow must run on in order to trigger your workflow. For more information, see "[Workflow syntax for GitHub Actions](/actions/learn-github-actions/workflow-syntax-for-github-actions#onworkflow_runbranchesbranches-ignore)." For example, a workflow with the following trigger will only run when the workflow named `Build` runs on a branch named `canary`.
您可以使用 `branches` `branches-ignore` 筛选器来指定触发工作流程必须在哪些分支上运行才能触发您的工作流程。 更多信息请参阅“[GitHub Actions 的工作流程语法](/actions/learn-github-actions/workflow-syntax-for-github-actions#onworkflow_runbranchesbranches-ignore)”。 例如,仅当名为 `Build` 的工作流程在名为 ` <0>Canary` 的分支上运行时,具有以下触发器的工作流程才会运行。
```yaml
on:
@@ -1406,11 +1406,11 @@ on:
branches: [canary]
```
#### Using data from the triggering workflow
#### 使用触发工作流程中的数据
You can access the [`workflow_run` event payload](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_run) that corresponds to the workflow that triggered your workflow. For example, if your triggering workflow generates artifacts, a workflow triggered with the `workflow_run` event can access these artifacts.
您可以访问与触发工作流程的工作流程对应的 [`workflow_run` 事件有效负载](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_run)。 例如,如果触发工作流程生成构件,则使用 `workflow_run` 事件触发的工作流程可以访问这些构件。
The following workflow uploads data as an artifact. (In this simplified example, the data is the pull request number.)
以下工作流程将数据作为构件上传。 (在此简化的示例中,数据是拉取请求编号。)
```yaml
name: Upload data
@@ -1435,7 +1435,7 @@ jobs:
path: pr/
```
When a run of the above workflow completes, it triggers a run of the following workflow. The following workflow uses the `github.event.workflow_run` context and the {% data variables.product.product_name %} REST API to download the artifact that was uploaded by the above workflow, unzips the downloaded artifact, and comments on the pull request whose number was uploaded as an artifact.
当上述工作流程的运行完成时,它将触发以下工作流程的运行。 以下工作流程使用 `github.event.workflow_run` 上下文和 {% data variables.product.product_name %} REST API 下载由上述工作流程上传的构件,解压缩下载的构件,并对其编号作为构件上传的拉取请求进行评论。
```yaml
name: Use the data

View File

@@ -1,7 +1,7 @@
---
title: Using workflows
shortTitle: Using workflows
intro: 'Creating and managing {% data variables.product.prodname_actions %} workflows.'
title: 使用工作流程
shortTitle: 使用工作流程
intro: '创建和管理 {% data variables.product.prodname_actions %} 工作流程。'
redirect_from:
- /actions/configuring-and-managing-workflows/configuring-a-workflow
- /articles/creating-a-workflow-with-github-actions

View File

@@ -19,7 +19,7 @@ topics:
{% data reusables.actions.reusable-workflows-ghes-beta %}
{% data reusables.actions.enterprise-github-hosted-runners %}
## 概览
## Overview
Rather than copying and pasting from one workflow to another, you can make workflows reusable. You and anyone with access to the reusable workflow can then call the reusable workflow from another workflow.
@@ -35,7 +35,7 @@ If you reuse a workflow from a different repository, any actions in the called w
When a reusable workflow is triggered by a caller workflow, the `github` context is always associated with the caller workflow. The called workflow is automatically granted access to `github.token` and `secrets.GITHUB_TOKEN`. For more information about the `github` context, see "[Context and expression syntax for GitHub Actions](/actions/reference/context-and-expression-syntax-for-github-actions#github-context)."
You can view the reused workflows referenced in your {% data variables.product.prodname_actions %} workflows as dependencies in the dependency graph of the repository containing your workflows. 更多信息请参阅“[关于依赖关系图](/code-security/supply-chain-security/understanding-your-software-supply-chain/about-the-dependency-graph)”
You can view the reused workflows referenced in your {% data variables.product.prodname_actions %} workflows as dependencies in the dependency graph of the repository containing your workflows. For more information, see “[About the dependency graph](/code-security/supply-chain-security/understanding-your-software-supply-chain/about-the-dependency-graph).
### Reusable workflows and starter workflows
@@ -48,16 +48,16 @@ For more information, see "[Creating starter workflows for your organization](/a
A reusable workflow can be used by another workflow if {% ifversion ghes or ghec or ghae %}any{% else %}either{% endif %} of the following is true:
* Both workflows are in the same repository.
* The called workflow is stored in a public repository.{% ifversion ghes or ghec or ghae %}
* The called workflow is stored in a public repository{% if actions-workflow-policy %}, and your {% ifversion ghec %}enterprise{% else %}organization{% endif %} allows you to use public reusable workflows{% endif %}.{% ifversion ghes or ghec or ghae %}
* The called workflow is stored in an internal repository and the settings for that repository allow it to be accessed. For more information, see {% if internal-actions %}"[Sharing actions and workflows with your enterprise](/actions/creating-actions/sharing-actions-and-workflows-with-your-enterprise){% else %}"[Managing {% data variables.product.prodname_actions %} settings for a repository](/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-an-internal-repository){% endif %}."{% endif %}
## Using runners
{% ifversion fpt or ghes or ghec %}
### 使用 GitHub 托管的运行器
### Using GitHub-hosted runners
The assignment of {% data variables.product.prodname_dotcom %}-hosted runners is always evaluated using only the caller's context. Billing for {% data variables.product.prodname_dotcom %}-hosted runners is always associated with the caller. The caller workflow cannot use {% data variables.product.prodname_dotcom %}-hosted runners from the called repository. 更多信息请参阅“[关于 {% data variables.product.prodname_dotcom %} 托管的运行器](/actions/using-github-hosted-runners/about-github-hosted-runners)”。
The assignment of {% data variables.product.prodname_dotcom %}-hosted runners is always evaluated using only the caller's context. Billing for {% data variables.product.prodname_dotcom %}-hosted runners is always associated with the caller. The caller workflow cannot use {% data variables.product.prodname_dotcom %}-hosted runners from the called repository. For more information, see "[About {% data variables.product.prodname_dotcom %}-hosted runners](/actions/using-github-hosted-runners/about-github-hosted-runners)."
### Using self-hosted runners
@@ -67,7 +67,7 @@ Called workflows that are owned by the same user or organization{% ifversion ghe
* In the caller repository
* In the caller repository's organization{% ifversion ghes or ghec or ghae %} or enterprise{% endif %}, provided that the runner has been made available to the caller repository
## 限制
## Limitations
* Reusable workflows can't call other reusable workflows.
* Reusable workflows stored within a private repository can only be used by workflows within the same repository.
@@ -123,7 +123,7 @@ You can define inputs and secrets, which can be passed from the caller workflow
{% note %}
**Note**: Environment secrets are encrypted strings that are stored in an environment that you've defined for a repository. Environment secrets are only available to workflow jobs that reference the appropriate environment. 更多信息请参阅“[使用环境进行部署](/actions/deployment/targeting-different-environments/using-environments-for-deployment#environment-secrets)”。
**Note**: Environment secrets are encrypted strings that are stored in an environment that you've defined for a repository. Environment secrets are only available to workflow jobs that reference the appropriate environment. For more information, see "[Using environments for deployment](/actions/deployment/targeting-different-environments/using-environments-for-deployment#environment-secrets)."
{% endnote %}
@@ -195,9 +195,9 @@ When you call a reusable workflow, you can only use the following keywords in th
{% note %}
**:**
**Note:**
* If `jobs.<job_id>.permissions` is not specified in the calling job, the called workflow will have the default permissions for the `GITHUB_TOKEN`. 更多信息请参阅“[工作流程中的身份验证](/actions/reference/authentication-in-a-workflow#permissions-for-the-github_token)
* If `jobs.<job_id>.permissions` is not specified in the calling job, the called workflow will have the default permissions for the `GITHUB_TOKEN`. For more information, see "[Authentication in a workflow](/actions/reference/authentication-in-a-workflow#permissions-for-the-github_token)."
* The `GITHUB_TOKEN` permissions passed from the caller workflow can be only downgraded (not elevated) by the called workflow.
{% endnote %}
@@ -304,7 +304,7 @@ For information about using the REST API to query the audit log for an organizat
{% endnote %}
## 后续步骤
## Next steps
To continue learning about {% data variables.product.prodname_actions %}, see "[Events that trigger workflows](/actions/learn-github-actions/events-that-trigger-workflows)."

View File

@@ -1,7 +1,7 @@
---
title: 'Sharing workflows, secrets, and runners with your organization'
title: 与组织共享工作流程、机密和运行器
shortTitle: 与组织共享工作流程
intro: 'Learn how you can use organization features to collaborate with your team, by sharing starter workflows, secrets, and self-hosted runners.'
intro: 了解如何通过共享入门工作流程、机密和自托管运行器,使用组织功能与团队协作。
redirect_from:
- /actions/learn-github-actions/sharing-workflows-with-your-organization
- /actions/learn-github-actions/sharing-workflows-secrets-and-runners-with-your-organization
@@ -18,31 +18,31 @@ type: how_to
## 概览
如果需要与您的团队共享工作流程和其他 {% data variables.product.prodname_actions %} 功能,则考虑在 {% data variables.product.prodname_dotcom %} 组织内协作。 组织允许您集中存储和管理机密、构件和自托管运行器。 You can also create starter workflows in the `.github` repository and share them with other users in your organization.
如果需要与您的团队共享工作流程和其他 {% data variables.product.prodname_actions %} 功能,则考虑在 {% data variables.product.prodname_dotcom %} 组织内协作。 组织允许您集中存储和管理机密、构件和自托管运行器。 您还可以在 `.github` 存储库中创建入门工作流程,并与组织中的其他用户共享这些工作流程。
## Sharing {% if internal-actions %}actions and {% endif %}workflows
## 共享 {% if internal-actions %}操作和 {% endif %}工作流程
{% if internal-actions %}
You can share both individual actions and entire workflows with your organization, with or without publishing the actions or workflows publicly. You can reuse actions and workflows exactly by referencing them in your workflow file, and you can create starter workflows that provide templates for new workflows.
您可以与组织共享单个操作和整个工作流程,无论是否公开发布操作或工作流程。 您可以通过在工作流程文件中引用操作和工作流程来精确地重复使用它们,并且可以创建为新工作流程提供模板的起始工作流程。
{% else %}
Your organization can share workflows by reusing the workflows exactly or by creating starter workflows that provide templates for new workflows.
组织可以通过完全重用工作流程或创建为新工作流程提供模板的入门工作流程来共享工作流程。
{% endif %}
{% if internal-actions %}
### Sharing actions with your enterprise
### 与企业共享操作
{% data reusables.actions.internal-actions-summary %}
{% endif %}
{% ifversion fpt or ghes > 3.3 or ghae-issue-4757 or ghec %}
### Reusing workflows
### 重新使用工作流程
{% data reusables.actions.reusable-workflows %}
{% endif %}
### Using starter workflows
### 使用入门工作流程
{% data reusables.actions.workflow-organization-templates %} For more information, see "[Creating starter workflows for your organization](/actions/using-workflows/creating-starter-workflows-for-your-organization)."
{% data reusables.actions.workflow-organization-templates %} 更多信息请参阅“[为组织创建入门工作流程](/actions/using-workflows/creating-starter-workflows-for-your-organization)”。
## 在组织内共享机密
@@ -70,4 +70,4 @@ Your organization can share workflows by reusing the workflows exactly or by cre
## 后续步骤
To continue learning about {% data variables.product.prodname_actions %}, see "[Creating starter workflows for your organization](/actions/using-workflows/creating-starter-workflows-for-your-organization)."
要继续了解 {% data variables.product.prodname_actions %},请参阅“[为组织创建入门工作流程](/actions/using-workflows/creating-starter-workflows-for-your-organization)”。

View File

@@ -1,7 +1,7 @@
---
title: Triggering a workflow
shortTitle: Triggering a workflow
intro: 'How to automatically trigger {% data variables.product.prodname_actions %} workflows'
title: 触发工作流程
shortTitle: 触发工作流程
intro: '如何自动触发 {% data variables.product.prodname_actions %} 工作流程'
versions:
fpt: '*'
ghes: '*'
@@ -18,34 +18,34 @@ miniTocMaxHeadingLevel: 3
{% data reusables.actions.enterprise-beta %}
{% data reusables.actions.enterprise-github-hosted-runners %}
## About workflow triggers
## 关于工作流程触发器
Workflow triggers are events that cause a workflow to run. These events can be:
工作流程触发器是导致工作流程运行的事件。 这些事件可以是:
- Events that occur in your workflow's repository
- Events that occur outside of {% data variables.product.product_name %} and trigger a `repository_dispatch` event on {% data variables.product.product_name %}
- Scheduled times
- 工作流程存储库中发生的事件
- {% data variables.product.product_name %} 之外发生并在 {% data variables.product.product_name %} 上触发 `repository_dispatch` 事件的事件
- 预定时间
- 手册
For example, you can configure your workflow to run when a push is made to the default branch of your repository, when a release is created, or when an issue is opened.
例如,您可以将工作流程配置为在推送到存储库的默认分支、创建发行版或打开议题时运行。
Workflow triggers are defined with the `on` key. 更多信息请参阅“[{% data variables.product.prodname_actions %} 的工作流程语法](/articles/workflow-syntax-for-github-actions#on)”。
工作流程触发器使用 `on` 键定义。 更多信息请参阅“[{% data variables.product.prodname_actions %} 的工作流程语法](/articles/workflow-syntax-for-github-actions#on)”。
以下步骤将触发工作流程运行:
1. An event occurs on your repository. The event has an associated commit SHA and Git ref.
1. {% data variables.product.product_name %} searches the `.github/workflows` directory in your repository for workflow files that are present in the associated commit SHA or Git ref of the event.
1. A workflow run is triggered for any workflows that have `on:` values that match the triggering event. Some events also require the workflow file to be present on the default branch of the repository in order to run.
1. 存储库上发生事件。 该事件具有关联的提交 SHA Git 引用。
1. {% data variables.product.product_name %} 在存储库的 `.github/workflows` 目录中搜索事件的关联提交 SHA Git 引用中存在的工作流程文件。
1. 对于具有与与触发事件匹配的 `on:` 值的任何工作流程,触发工作流程运行。 某些事件还要求工作流程文件位于存储库的默认分支上才能运行。
Each workflow run will use the version of the workflow that is present in the associated commit SHA or Git ref of the event. 当工作流程运行时,{% data variables.product.product_name %} 会在运行器环境中设置 `GITHUB_SHA`(提交 SHA`GITHUB_REF`Git 引用)环境变量。 更多信息请参阅“[使用环境变量](/actions/automating-your-workflow-with-github-actions/using-environment-variables)”。
每个工作流程运行都将使用事件的关联提交 SHA Git ref 中存在的工作流程版本。 当工作流程运行时,{% data variables.product.product_name %} 会在运行器环境中设置 `GITHUB_SHA`(提交 SHA`GITHUB_REF`Git 引用)环境变量。 更多信息请参阅“[使用环境变量](/actions/automating-your-workflow-with-github-actions/using-environment-variables)”。
### Triggering a workflow from a workflow
### 从工作流程触发工作流程
{% data reusables.actions.actions-do-not-trigger-workflows %} For more information, see "[Authenticating with the GITHUB_TOKEN](/actions/configuring-and-managing-workflows/authenticating-with-the-github_token)."
{% data reusables.actions.actions-do-not-trigger-workflows %} 更多信息请参阅“[使用 GITHUB_TOKEN 验证身份](/actions/configuring-and-managing-workflows/authenticating-with-the-github_token)”。
If you do want to trigger a workflow from within a workflow run, you can use a personal access token instead of `GITHUB_TOKEN` to trigger events that require a token. 您需要创建个人访问令牌并将其存储为密码。 为了最大限度地降低 {% data variables.product.prodname_actions %} 使用成本,请确保不要创建递归或意外的工作流程。 有关创建个人访问令牌的更多信息,请参阅“[创建个人访问令牌](/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)”。 For more information about storing a personal access token as a secret, see "[Creating and storing encrypted secrets](/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets)."
如果确实要从工作流程运行中触发工作流程,则可以使用个人访问令牌而不是 `GITHUB_TOKEN` 来触发需要令牌的事件。 您需要创建个人访问令牌并将其存储为密码。 为了最大限度地降低 {% data variables.product.prodname_actions %} 使用成本,请确保不要创建递归或意外的工作流程。 有关创建个人访问令牌的更多信息,请参阅“[创建个人访问令牌](/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)”。 有关存储个人访问令牌的更多信息,请参阅“[创建和存储加密密码](/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets)”。
For example, the following workflow uses a personal access token (stored as a secret called `MY_TOKEN`) to add a label to an issue via {% data variables.product.prodname_cli %}. Any workflows that run when a label is added will run once this step is performed.
例如,以下工作流程使用个人访问令牌(存储为称为 `MY_TOKEN` 的机密)通过 {% data variables.product.prodname_cli %} 向议题添加标签。 添加标签时运行的任何工作流程都将在执行此步骤后运行。
```yaml
on:
@@ -64,7 +64,7 @@ jobs:
gh issue edit $ISSUE_URL --add-label "triage"
```
Conversely, the following workflow uses `GITHUB_TOKEN` to add a label to an issue. It will not trigger any workflows that run when a label is added.
相反,以下工作流程使用 `GITHUB_TOKEN` 向议题添加标签。 它不会触发在添加标签时运行的任何工作流程。
```yaml
on:
@@ -83,68 +83,68 @@ jobs:
gh issue edit $ISSUE_URL --add-label "triage"
```
## Using events to trigger workflows
## 使用事件触发工作流程
Use the `on` key to specify what events trigger your workflow. For more information about events you can use, see "[Events that trigger workflows](/actions/using-workflows/events-that-trigger-workflows)."
使用 `on` 键指定触发工作流程的事件。 有关您可以使用的事件的更多信息,请参阅“[触发工作流程的事件](/actions/using-workflows/events-that-trigger-workflows)”。
### Using a single event
### 使用单个事件
{% data reusables.actions.on-single-example %}
### Using multiple events
### 使用多个事件
{% data reusables.actions.on-multiple-example %}
### Using activity types and filters with multiple events
### 将活动类型和筛选器用于多个事件
You can use activity types and filters to further control when your workflow will run. For more information, see [Using event activity types](#using-event-activity-types) and [Using filters](#using-filters). {% data reusables.actions.actions-multiple-types %}
您可以使用活动类型和筛选器进一步控制工作流程的运行时间。 更多信息请参阅[使用事件活动类型](#using-event-activity-types)和[使用筛选器](#using-filters) {% data reusables.actions.actions-multiple-types %}
## Using event activity types
## 使用事件活动类型
{% data reusables.actions.actions-activity-types %}
## Using filters
## 使用筛选器
{% data reusables.actions.actions-filters %}
### Using filters to target specific branches for pull request events
### 使用筛选器定位拉取请求事件的特定分支
{% data reusables.actions.workflows.section-triggering-a-workflow-branches %}
### Using filters to target specific branches or tags for push events
### 使用筛选器定位推送事件的特定分支或标记
{% data reusables.actions.workflows.section-run-on-specific-branches-or-tags %}
### Using filters to target specific paths for pull request or push events
### 使用筛选器定位拉取请求或推送事件的特定路径
{% data reusables.actions.workflows.section-triggering-a-workflow-paths %}
### Using filters to target specific branches for workflow run events
### 使用筛选器定位工作流程运行事件的特定分支
{% data reusables.actions.workflows.section-specifying-branches %}
## Defining inputs for manually triggered workflows
## 定义手动触发的工作流程的输入
{% data reusables.actions.workflow-dispatch-inputs %}
{% ifversion fpt or ghes > 3.3 or ghae-issue-4757 or ghec %}
## Defining inputs, outputs, and secrets for reusable workflows
## 定义可重复使用的工作流程的输入、输出和机密
{% data reusables.actions.reusable-workflows-ghes-beta %}
You can define inputs and secrets that a reusable workflow should receive from a calling workflow. You can also specify outputs that a reusable workflow will make available to a calling workflow. For more information, see "[Reusing workflows](/actions/using-workflows/reusing-workflows)."
您可以定义可重用工作流程应从调用工作流程接收的输入和机密。 您还可以指定可重用工作流程将提供给调用工作流程的输出。 更多信息请参阅“[重用工作流程](/actions/using-workflows/reusing-workflows)”。
{% endif %}
## Using event information
## 使用事件信息
Information about the event that triggered a workflow run is available in the `github.event` context. The properties in the `github.event` context depend on the type of event that triggered the workflow. For example, a workflow triggered when an issue is labeled would have information about the issue and label.
有关触发工作流程运行的事件的信息可在 `github.event` 上下文中找到。 `github.event` 上下文中的属性取决于触发工作流程的事件类型。 例如,在标记议题时触发的工作流程将包含有关议题和标签的信息。
### Viewing all properties of an event
### 查看事件的所有属性
Reference the webhook event documentation for common properties and example payloads. For more information, see "[Webhook events and payloads](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads)."
有关常见属性和示例负载,请参阅 web 挂钩事件文档。 更多信息请参阅“[web 挂钩事件和有效负载](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads)”。
You can also print the entire `github.event` context to see what properties are available for the event that triggered your workflow:
您还可以将整个 `github.event` 上下文中打印出来,以查看哪些属性可用于触发工作流程的事件:
```yaml
jobs:
@@ -157,9 +157,9 @@ jobs:
echo $EVENT_CONTEXT
```
### Accessing and using event properties
### 访问和使用事件属性
You can use the `github.event` context in your workflow. For example, the following workflow runs when a pull request that changes `package*.json`, `.github/CODEOWNERS`, or `.github/workflows/**` is opened. If the pull request author (`github.event.pull_request.user.login`) is not `octobot` or `dependabot[bot]`, then the workflow uses the {% data variables.product.prodname_cli %} to label and comment on the pull request (`github.event.pull_request.number`).
您可以在工作流程中使用 `github.event` 上下文。 例如,当打开更改 `package*.json``.github/CODEOWNERS` `.github/workflows/**` 的拉取请求时,将运行以下工作流程。 如果拉取请求作者 (`github.event.pull_request.user.login`) 不是 `octobot` `dependabot[bot]`,则工作流程使用 {% data variables.product.prodname_cli %} 来标记和注释拉取请求 (`github.event.pull_request.number`)
```yaml
on:
@@ -187,19 +187,19 @@ jobs:
gh pr comment $PR --body 'It looks like you edited `package*.json`, `.github/CODEOWNERS`, or `.github/workflows/**`. We do not allow contributions to these files. Please review our [contributing guidelines](https://github.com/octo-org/octo-repo/blob/main/CONTRIBUTING.md) for what contributions are accepted.'
```
有关上下文的更多信息,请参阅“[上下文](/actions/learn-github-actions/contexts)”。 For more information about event payloads, see "[Webhook events and payloads](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads)."
有关上下文的更多信息,请参阅“[上下文](/actions/learn-github-actions/contexts)”。 有关事件有效负载的详细信息,请参阅“[web 挂钩事件和有效负载](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads)”。
## Further controlling how your workflow will run
## 进一步控制工作流程的运行方式
If you want more granular control than events, event activity types, or event filters provide, you can use conditionals{% ifversion fpt or ghae or ghes > 3.1 or ghec %} and environments{% endif %} to control whether individual jobs or steps in your workflow will run.
如果需要比事件、事件活动类型或事件筛选器更精细的控制,则可以使用条件{% ifversion fpt or ghae or ghes > 3.1 or ghec %} 和环境{% endif %} 来控制工作流程中的单个作业或步骤是否运行。
### Using conditionals
### 使用条件
You can use conditionals to further control whether jobs or steps in your workflow will run.
您可以使用条件进一步控制工作流程中的作业或步骤是否运行。
#### Example using a value in the event payload
#### 在事件负载中使用值的示例
For example, if you want the workflow to run when a specific label is added to an issue, you can trigger on the `issues labeled` event activity type and use a conditional to check what label triggered the workflow. The following workflow will run when any label is added to an issue in the workflow's repository, but the `run_if_label_matches` job will only execute if the label is named `bug`.
例如,如果希望在将特定标签添加到议题时运行工作流程,则可以在 `issues labeled` 事件活动类型上触发,并使用条件来检查触发工作流程的标签。 将任何标签添加到工作流程的存储库中的议题时,将运行以下工作流程,但仅当标签命名为 `bug` 时,才会执行 `run_if_label_matches` 作业。
```yaml
on:
@@ -215,9 +215,9 @@ jobs:
- run: echo 'The label was bug'
```
#### Example using event type
#### 使用事件类型的示例
For example, if you want to run different jobs or steps depending on what event triggered the workflow, you can use a conditional to check whether a specific event type exists in the event context. The following workflow will run whenever an issue or pull request is closed. If the workflow ran because an issue was closed, the `github.event` context will contain a value for `issue` but not for `pull_request`. Therefore, the `if_issue` step will run but the `if_pr` step will not run. Conversely, if the workflow ran because a pull request was closed, the `if_pr` step will run but the `if_issue` step will not run.
例如,如果要根据触发工作流程的事件运行不同的作业或步骤,则可以使用条件来检查事件上下文中是否存在特定的事件类型。 每当议题或拉取请求关闭时,将运行以下工作流程。 如果工作流程因议题已关闭而运行,则 `github.event` 上下文将包含 `issue` 的值,但不包含 `pull_request` 的值。 因此,`if_issue` 步骤将运行,但 `if_pr` 步骤不会运行。 相反,如果工作流程因拉取请求关闭而运行,则 `if_pr` 步骤将运行,但 `if_issue` 步骤不会运行。
```yaml
on:
@@ -242,15 +242,15 @@ jobs:
echo A pull request was closed
```
For more information about what information is available in the event context, see "[Using event information](#using-event-information)." For more information about how to use conditionals, see "[Expressions](/actions/learn-github-actions/expressions)."
有关事件上下文中可用信息的详细信息,请参阅“[使用事件信息](#using-event-information)”。 有关如何使用条件语句的详细信息,请参阅“[表达式](/actions/learn-github-actions/expressions)”。
{% ifversion fpt or ghae or ghes > 3.1 or ghec %}
### Using environments to manually trigger workflow jobs
### 使用环境手动触发工作流程作业
If you want to manually trigger a specific job in a workflow, you can use an environment that requires approval from a specific team or user. First, configure an environment with required reviewers. For more information, see "[Using environments for deployment](/actions/deployment/targeting-different-environments/using-environments-for-deployment)." Then, reference the environment name in a job in your workflow using the `environment:` key. Any job referencing the environment will not run until at least one reviewer approves the job.
如果要手动触发工作流程中的特定作业,可以使用需要特定团队或用户批准的环境。 首先,使用所需的审阅者配置环境。 更多信息请参阅“[使用环境进行部署](/actions/deployment/targeting-different-environments/using-environments-for-deployment)”。 然后,使用 `environment:` 键在工作流程的作业中引用环境名称。 在至少有一个审阅者批准该作业之前,引用环境的任何作业都不会运行。
For example, the following workflow will run whenever there is a push to main. The `build` job will always run. The `publish` job will only run after the `build` job successfully completes (due to `needs: [build]`) and after all of the rules (including required reviewers) for the environment called `production` pass (due to `environment: production`).
例如,只要有推送到 main 分支,以下工作流程就会运行。 `build` 作业将始终运行。 只有在 `publish` 作业成功完成(由于 `needs: [build]`)并且称为 `production` 的环境的所有规则(包括必需的审阅者)通过(由于 `environment: production`)之后,`publish` 作业才会运行。
```yaml
on:
@@ -281,6 +281,6 @@ jobs:
{% endnote %}
{% endif %}
## Available events
## 可用事件
For a full list of available events, see "[Events that trigger workflows](/actions/using-workflows/events-that-trigger-workflows)."
有关可用事件的完整列表,请参阅“[触发工作流程的事件](/actions/using-workflows/events-that-trigger-workflows)”。

View File

@@ -1,6 +1,6 @@
---
title: Using starter workflows
intro: '{% data variables.product.product_name %} provides starter workflows for a variety of languages and tooling.'
title: 使用入门工作流程
intro: '{% data variables.product.product_name %} 为各种语言和工具提供入门工作流程。'
redirect_from:
- /articles/setting-up-continuous-integration-using-github-actions
- /github/automating-your-workflow-with-github-actions/setting-up-continuous-integration-using-github-actions
@@ -24,33 +24,33 @@ topics:
{% data reusables.actions.enterprise-beta %}
{% data reusables.actions.enterprise-github-hosted-runners %}
## About starter workflows
## 关于入门工作流程
{% data variables.product.product_name %} offers starter workflows for a variety of languages and tooling. When you set up workflows in your repository, {% data variables.product.product_name %} analyzes the code in your repository and recommends workflows based on the language and framework in your repository. For example, if you use [Node.js](https://nodejs.org/en/), {% data variables.product.product_name %} will suggest a starter workflow file that installs your Node.js packages and runs your tests.{% if actions-starter-template-ui %} You can search and filter to find relevant starter workflows.{% endif %}
{% data variables.product.product_name %} 为各种语言和工具提供入门工作流程。 在存储库中设置工作流程时,{% data variables.product.product_name %} 会分析存储库中的代码,并根据存储库中的语言和框架推荐工作流程。 例如,如果您使用 [Node.js](https://nodejs.org/en/){% data variables.product.product_name %} 将提议使用入门工作流程来安装 Node.js 包和运行测试。{% if actions-starter-template-ui %}您可以搜索并筛选来查找相关的入门工作流程。{% endif %}
{% data reusables.actions.starter-workflow-categories %}
You can also create your own starter workflow to share with your organization. These starter workflows will appear alongside the {% data variables.product.product_name %}-provided starter workflows. For more information, see "[Creating starter workflows for your organization](/actions/learn-github-actions/creating-starter-workflows-for-your-organization)."
您还可以创建自己的入门工作流程以与您的组织共享。 这些入门工作流程将显示在 {% data variables.product.product_name %} 提供的入门工作流程旁边。 更多信息请参阅“[为组织创建入门工作流程](/actions/learn-github-actions/creating-starter-workflows-for-your-organization)”。
## Using starter workflows
## 使用入门工作流程
Anyone with write permission to a repository can set up {% data variables.product.prodname_actions %} starter workflows for CI/CD or other automation.
对存储库具有写入权限的任何人都可以为 CI/CD 或其他自动化设置 {% data variables.product.prodname_actions %} 入门工作流程。
{% data reusables.repositories.navigate-to-repo %}
{% data reusables.repositories.actions-tab %}
1. If you already have a workflow in your repository, click **New workflow**.
1. Find the starter workflow that you want to use, then click **Set up this workflow**.{% if actions-starter-template-ui %} To help you find the starter workflow that you want, you can search for keywords or filter by category.{% endif %}
1. If the starter workflow contains comments detailing additional setup steps, follow these steps. Many of the starter workflow have corresponding guides. For more information, see [the {% data variables.product.prodname_actions %} guides](/actions/guides)."
1. Some starter workflows use secrets. For example, {% raw %}`${{ secrets.npm_token }}`{% endraw %}. If the starter workflow uses a secret, store the value described in the secret name as a secret in your repository. 更多信息请参阅“[加密密码](/actions/reference/encrypted-secrets)”。
1. Optionally, make additional changes. For example, you might want to change the value of `on` to change when the workflow runs.
1. 如果存储库中已有工作流程,请单击 **New workflow(新建工作流程)**
1. 找到要使用的入门工作流程,然后单击 **Set up this workflow(设置此工作流程)**{% if actions-starter-template-ui %} 为帮助您找到所需的入门工作流程,您可以搜索关键字或按类别进行筛选。{% endif %}
1. 如果入门工作流程包含详细说明其他设置步骤的注释,请按照下列步骤操作。 许多入门工作流程都有相应的指南。 更多信息请参阅“[{% data variables.product.prodname_actions %} 指南](/actions/guides)”。
1. 某些入门工作流程使用机密。 例如 {% raw %}`${{ secrets.npm_token }}`{% endraw %}。 如果入门工作流使用机密,请将机密名称中描述的值作为机密存储在存储库中。 更多信息请参阅“[加密密码](/actions/reference/encrypted-secrets)”。
1. (可选)进行其他更改。 例如,您可能希望更改 `on` 的值,以便在工作流程运行时进行更改。
1. 单击 **Start commit开始提交**
1. Write a commit message and decide whether to commit directly to the default branch or to open a pull request.
1. 编写提交消息并决定是直接提交到默认分支还是打开拉取请求。
## 延伸阅读
- "[关于持续集成](/articles/about-continuous-integration)"
- "[Managing workflow runs](/actions/managing-workflow-runs)"
- "[About monitoring and troubleshooting](/actions/monitoring-and-troubleshooting-workflows/about-monitoring-and-troubleshooting)"
- "[管理工作流程运行](/actions/managing-workflow-runs)"
- "[关于监控和故障排除](/actions/monitoring-and-troubleshooting-workflows/about-monitoring-and-troubleshooting)"
- "[了解 {% data variables.product.prodname_actions %}](/actions/learn-github-actions)"
{% ifversion fpt or ghec %}
- "[管理 {% data variables.product.prodname_actions %} 的计费](/billing/managing-billing-for-github-actions)"

View File

@@ -65,7 +65,7 @@ Write-Output "::workflow-command parameter1={data},parameter2={data}::{command v
core.setOutput('SELECTED_COLOR', 'green');
```
### Example: Setting a value
### 示例:设置值
您可以在工作流程中使用 `set-output` 命令来设置相同的值:
@@ -101,13 +101,13 @@ core.setOutput('SELECTED_COLOR', 'green');
| 工具包函数 | 等效工作流程命令 |
| --------------------- | --------------------------------------------------------------------- |
| `core.addPath` | Accessible using environment file `GITHUB_PATH` |
| `core.addPath` | 可使用环境文件 `GITHUB_PATH` 访问 |
| `core.debug` | `debug` |{% ifversion fpt or ghes > 3.2 or ghae-issue-4929 or ghec %}
| `core.notice` | `notice`
{% endif %}
| `core.error` | `error` |
| `core.endGroup` | `endgroup` |
| `core.exportVariable` | Accessible using environment file `GITHUB_ENV` |
| `core.exportVariable` | 可使用环境文件 `GITHUB_ENV` 访问 |
| `core.getInput` | 可使用环境变量 `INPUT_{NAME}` 访问 |
| `core.getState` | 可使用环境变量 `STATE_{NAME}` 访问 |
| `core.isDebug` | 可使用环境变量 `RUNNER_DEBUG` 访问 |
@@ -129,7 +129,7 @@ core.setOutput('SELECTED_COLOR', 'green');
(可选)您也可以在操作的元数据文件中声明输出参数。 更多信息请参阅“[{% data variables.product.prodname_actions %} 的元数据语法](/articles/metadata-syntax-for-github-actions#outputs-for-docker-container-and-javascript-actions)”。
### Example: Setting an output parameter
### 示例:设置输出参数
{% bash %}
@@ -155,7 +155,7 @@ Write-Output "::set-output name=action_fruit::strawberry"
::debug::{message}
```
### Example: Setting a debug message
### 示例:设置调试消息
{% bash %}
@@ -185,7 +185,7 @@ Write-Output "::debug::Set the Octocat variable"
{% data reusables.actions.message-parameters %}
### Example: Setting a notice message
### 示例:设置通知消息
{% bash %}
@@ -214,7 +214,7 @@ Write-Output "::notice file=app.js,line=1,col=5,endColumn=7::Missing semicolon"
{% data reusables.actions.message-parameters %}
### Example: Setting a warning message
### 示例:设置警告消息
{% bash %}
@@ -241,7 +241,7 @@ Write-Output "::warning file=app.js,line=1,col=5,endColumn=7::Missing semicolon"
{% data reusables.actions.message-parameters %}
### Example: Setting an error message
### 示例:设置错误消息
{% bash %}
@@ -268,7 +268,7 @@ Write-Output "::error file=app.js,line=1,col=5,endColumn=7::Missing semicolon"
::endgroup::
```
### Example: Grouping log lines
### 示例:对日志行进行分组
{% bash %}
@@ -310,9 +310,9 @@ jobs:
::add-mask::{value}
```
屏蔽值可阻止在日志中打印字符串或变量。 用空格分隔的每个屏蔽的词均替换为 `*` 字符。 您可以使用环境变量或字符串作为屏蔽的 `value`。
屏蔽值可阻止在日志中打印字符串或变量。 用空格分隔的每个屏蔽的词均替换为 `*` 字符。 您可以使用环境变量或字符串作为屏蔽的 `value`。 When you mask a value, it is treated as a secret and will be redacted on the runner. For example, after you mask a value, you won't be able to set that value as an output.
### Example: Masking a string
### 示例:屏蔽字符串
当您在日志中打印 `"Mona The Octocat"` 时,您将看到 `"***"`。
@@ -332,7 +332,7 @@ Write-Output "::add-mask::Mona The Octocat"
{% endpowershell %}
### Example: Masking an environment variable
### 示例:屏蔽环境变量
当您在日志中打印变量 `MY_NAME` 或值 `"Mona The Octocat"` 时,您将看到 `"***"` 而不是 `"Mona The Octocat"`。
@@ -386,7 +386,7 @@ jobs:
::{endtoken}::
```
### Example: Stopping and starting workflow commands
### 示例:停止和启动工作流程命令
{% bash %}
@@ -432,22 +432,22 @@ jobs:
{% endpowershell %}
## Echoing command outputs
## 回显命令输出
Enables or disables echoing of workflow commands. For example, if you use the `set-output` command in a workflow, it sets an output parameter but the workflow run's log does not show the command itself. If you enable command echoing, then the log shows the command, such as `::set-output name={name}::{value}`.
启用或禁用工作流程命令的回显。 例如,如果在工作流程中使用 `set-output` 命令,则会设置输出参数,但工作流程运行的日志不会显示命令本身。 如果启用命令回显,则日志将显示该命令,例如 `::set-output name={name}::{value}`
```{:copy}
::echo::on
::echo::off
```
Command echoing is disabled by default. However, a workflow command is echoed if there are any errors processing the command.
默认情况下,命令回显处于禁用状态。 但是,如果处理工作流命令时出现任何错误,则会回显该命令。
The `add-mask`, `debug`, `warning`, and `error` commands do not support echoing because their outputs are already echoed to the log.
`add-mask``debug``warning` `error` 命令不支持回显,因为它们的输出已经回显到日志。
You can also enable command echoing globally by turning on step debug logging using the `ACTIONS_STEP_DEBUG` secret. For more information, see "[Enabling debug logging](/actions/managing-workflow-runs/enabling-debug-logging)". In contrast, the `echo` workflow command lets you enable command echoing at a more granular level, rather than enabling it for every workflow in a repository.
还可以通过使用 `ACTIONS_STEP_DEBUG` 密钥打开步骤调试日志记录来启用命令全局回显。 更多信息请参阅“[启用调试日志记录](/actions/managing-workflow-runs/enabling-debug-logging)”。 相比之下,`echo` 工作流程命令允许您在更精细的级别启用命令回显,而不是为存储库中的每个工作流程启用它。
### Example: Toggling command echoing
### 示例:切换命令回显
{% bash %}
@@ -485,14 +485,14 @@ jobs:
{% endpowershell %}
The example above prints the following lines to the log:
上面的示例将以下行打印到日志中:
```{:copy}
::set-output name=action_echo::enabled
::echo::off
```
Only the second `set-output` and `echo` workflow commands are included in the log because command echoing was only enabled when they were run. Even though it is not always echoed, the output parameter is set in all cases.
日志中仅包含第二个 `set-output` `echo` 工作流程命令,因为命令回显仅在运行时启用。 即使它并不总是回显,输出参数在所有情况下都会被设置。
## 将值发送到 pre 和 post 操作
@@ -514,7 +514,7 @@ console.log('::save-state name=processID::12345')
console.log("The running PID from the main action is: " + process.env.STATE_processID);
```
## Environment files
## 环境文件
在工作流程执行期间,运行器生成可用于执行某些操作的临时文件。 这些文件的路径通过环境变量显示。 写入这些文件时,您需要使用 UTF-8 编码,以确保正确处理命令。 多个命令可以写入同一个文件,用换行符分隔。
@@ -522,7 +522,7 @@ console.log("The running PID from the main action is: " + process.env.STATE_pro
{% note %}
**Note:** PowerShell versions 5.1 and below (`shell: powershell`) do not use UTF-8 by default, so you must specify the UTF-8 encoding. 例如:
**注意:** PowerShell 版本 5.1 及更低版本 (`shell: powershell`) 默认情况下不使用 UTF-8因此必须指定 UTF-8 编码。 例如:
```yaml{:copy}
jobs:
@@ -534,7 +534,7 @@ jobs:
"mypath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
```
PowerShell Core versions 6 and higher (`shell: pwsh`) use UTF-8 by default. 例如:
PowerShell Core 版本 6 及更高版本 (`shell: pwsh`) 默认使用 UTF-8 例如:
```yaml{:copy}
jobs:
@@ -562,19 +562,19 @@ echo "{environment_variable_name}={value}" >> $GITHUB_ENV
{% powershell %}
- Using PowerShell version 6 and higher:
- 使用 PowerShell 版本 6 及更高版本:
```pwsh{:copy}
"{environment_variable_name}={value}" >> $env:GITHUB_ENV
```
- Using PowerShell version 5.1 and below:
- 使用 PowerShell 版本 5.1 及更低版本:
```powershell{:copy}
"{environment_variable_name}={value}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
```
{% endpowershell %}
You can make an environment variable available to any subsequent steps in a workflow job by defining or updating the environment variable and writing this to the `GITHUB_ENV` environment file. 创建或更新环境变量的步骤无法访问新值,但在作业中的所有后续步骤均可访问。 The names of environment variables are case-sensitive, and you can include punctuation. 更多信息请参阅“[环境变量](/actions/learn-github-actions/environment-variables)”。
通过定义或更新环境变量并将其写入 `GITHUB_ENV` 环境文件,可以使环境变量用于工作流程作业中的任何后续步骤。 创建或更新环境变量的步骤无法访问新值,但在作业中的所有后续步骤均可访问。 环境变量的名称区分大小写,您可以包含标点符号。 更多信息请参阅“[环境变量](/actions/learn-github-actions/environment-variables)”。
### 示例
@@ -626,7 +626,7 @@ steps:
#### 示例
This example uses `EOF` as a delimiter, and sets the `JSON_RESPONSE` environment variable to the value of the `curl` response.
此示例使用 `EOF` 作为分隔符,并将 `JSON_RESPONSE` 环境变量设置为 `curl` 响应的值。
{% bash %}
@@ -659,7 +659,7 @@ steps:
## 添加系统路径
Prepends a directory to the system `PATH` variable and automatically makes it available to all subsequent actions in the current job; the currently running action cannot access the updated path variable. 要查看作业的当前定义路径,您可以在步骤或操作中使用 `echo "$PATH"`。
为系统 `PATH` 变量预先设置一个目录,并自动使其可用于当前作业中的所有后续操作;当前运行的操作无法访问更新的路径变量。 要查看作业的当前定义路径,您可以在步骤或操作中使用 `echo "$PATH"`。
{% bash %}
@@ -689,7 +689,7 @@ echo "$HOME/.local/bin" >> $GITHUB_PATH
{% endbash %}
This example demonstrates how to add the user `$env:HOMEPATH/.local/bin` directory to `PATH`:
此示例演示如何将用户 `$env:HOMEPATH/.local/bin` 目录添加到 `PATH`
{% powershell %}

View File

@@ -58,19 +58,19 @@ miniTocMaxHeadingLevel: 4
{% data reusables.actions.reusable-workflows-ghes-beta %}
Use `on.workflow_call` to define the inputs and outputs for a reusable workflow. You can also map the secrets that are available to the called workflow. For more information on reusable workflows, see "[Reusing workflows](/actions/using-workflows/reusing-workflows)."
使用 `on.workflow_call` 定义可重用工作流程的输入和输出。 您还可以映射可用于被调用工作流程的机密。 有关可重用工作流程的详细信息,请参阅“[重用工作流程](/actions/using-workflows/reusing-workflows)”。
### `on.workflow_call.inputs`
When using the `workflow_call` keyword, you can optionally specify inputs that are passed to the called workflow from the caller workflow. For more information about the `workflow_call` keyword, see "[Events that trigger workflows](/actions/learn-github-actions/events-that-trigger-workflows#workflow-reuse-events)."
使用 `workflow_call` 关键字时,可以选择指定从调用方工作流程传递到被调用工作流程的输入。 有关 `workflow_call` 关键字的更多信息,请参阅“[触发工作流程的事件](/actions/learn-github-actions/events-that-trigger-workflows#workflow-reuse-events)”。
In addition to the standard input parameters that are available, `on.workflow_call.inputs` requires a `type` parameter. 更多信息请参阅 [`on.workflow_call.inputs.<input_id>.type`](#onworkflow_callinputsinput_idtype)。
除了可用的标准输入参数外,`on.workflow_call.inputs` 还需要 `type` 参数。 更多信息请参阅 [`on.workflow_call.inputs.<input_id>.type`](#onworkflow_callinputsinput_idtype)。
If a `default` parameter is not set, the default value of the input is `false` for a boolean, `0` for a number, and `""` for a string.
如果未设置 `default` 参数,则输入的默认值对于布尔值为 `false` ,对于数字为 `0`,对于字符串为 `""`
Within the called workflow, you can use the `inputs` context to refer to an input.
在被调用的工作流程中,可以使用 `inputs` 上下文来引用输入。
If a caller workflow passes an input that is not specified in the called workflow, this results in an error.
如果调用方工作流程传递的输入未在被调用工作流程中指定,则会导致错误。
#### 示例
@@ -99,13 +99,13 @@ For more information, see "[Reusing workflows](/actions/learn-github-actions/reu
#### `on.workflow_call.inputs.<input_id>.type`
Required if input is defined for the `on.workflow_call` keyword. The value of this parameter is a string specifying the data type of the input. This must be one of: `boolean`, `number`, or `string`.
在为 `on.workflow_call` 关键字定义了输入时必需。 此参数的值是指定输入的数据类型的字符串。 这必须是以下之一:`boolean``number` `string`
### `on.workflow_call.outputs`
A map of outputs for a called workflow. Called workflow outputs are available to all downstream jobs in the caller workflow. Each output has an identifier, an optional `description,` and a `value.` The `value` must be set to the value of an output from a job within the called workflow.
被调用工作流程的输出映射。 调用的工作流程输出可用于调用方工作流程中的所有下游作业。 每个输出都有标识符、可选的 `description` `value`。必须将 `value` 设置为被调用工作流程中作业的输出值。
In the example below, two outputs are defined for this reusable workflow: `workflow_output1` and `workflow_output2`. These are mapped to outputs called `job_output1` and `job_output2`, both from a job called `my_job`.
在下面的示例中,为此可重用工作流定义了两个输出:`workflow_output1` `workflow_output2`。 它们映射到名为 `job_output1` `job_output2` 的输出,两者都来自名为 `my_job` 的作业。
#### 示例
@@ -124,15 +124,15 @@ on:
```
{% endraw %}
For information on how to reference a job output, see [`jobs.<job_id>.outputs`](#jobsjob_idoutputs). For more information, see "[Reusing workflows](/actions/learn-github-actions/reusing-workflows)."
有关如何引用作业输出的信息,请参阅 [`jobs.<job_id>.outputs`](#jobsjob_idoutputs) For more information, see "[Reusing workflows](/actions/learn-github-actions/reusing-workflows)."
### `on.workflow_call.secrets`
A map of the secrets that can be used in the called workflow.
可在被调用工作流程中使用的机密的映射。
Within the called workflow, you can use the `secrets` context to refer to a secret.
在被调用的工作流程中,可以使用 `secrets` 上下文来引用机密。
If a caller workflow passes a secret that is not specified in the called workflow, this results in an error.
如果调用方工作流程传递的机密未在被调用的工作流程中指定,则会导致错误。
#### 示例
@@ -159,11 +159,11 @@ jobs:
#### `on.workflow_call.secrets.<secret_id>`
A string identifier to associate with the secret.
要与机密关联的字符串标识符。
#### `on.workflow_call.secrets.<secret_id>.required`
A boolean specifying whether the secret must be supplied.
指定是否必须提供机密的布尔值。
{% endif %}
## `on.workflow_run.<branches|branches-ignore>`
@@ -185,7 +185,7 @@ A boolean specifying whether the secret must be supplied.
环境变量的 `map` 可用于工作流程中所有作业的步骤。 您还可以设置仅适用于单个作业的步骤或单个步骤的环境变量。 更多信息请参阅 [`jobs.<job_id>.env`](#jobsjob_idenv) and [`jobs.<job_id>.steps[*].env`](#jobsjob_idstepsenv)。
Variables in the `env` map cannot be defined in terms of other variables in the map.
`env` 映射中的变量不能根据映射中的其他变量进行定义。
{% data reusables.repositories.actions-env-var-note %}
@@ -342,11 +342,11 @@ steps:
uses: actions/heroku@1.0.0
```
#### Example: Using secrets
#### 示例:使用机密
Secrets cannot be directly referenced in `if:` conditionals. Instead, consider setting secrets as job-level environment variables, then referencing the environment variables to conditionally run steps in the job.
无法直接在 `if:` 条件中引用机密。 而应考虑将机密设置为作业级环境变量,然后引用环境变量以有条件地运行作业中的步骤。
If a secret has not been set, the return value of an expression referencing the secret (such as {% raw %}`${{ secrets.SuperSecret }}`{% endraw %} in the example) will be an empty string.
如果尚未设置机密,则引用该机密的表达式(例如示例中的 {% raw %}`${{ secrets.SuperSecret }}`{% endraw %})的返回值将为空字符串。
{% raw %}
```yaml
@@ -365,7 +365,7 @@ jobs:
```
{% endraw %}
For more information, see "[Context availability](/actions/learn-github-actions/contexts#context-availability)" and "[Encrypted secrets](/actions/security-guides/encrypted-secrets)."
更多信息请参阅“[上下文可用性](/actions/learn-github-actions/contexts#context-availability)”和“[加密密码](/actions/security-guides/encrypted-secrets)”。
### `jobs.<job_id>.steps[*].name`
@@ -516,7 +516,7 @@ jobs:
使用操作系统 shell 运行命令行程序。 如果不提供 `name`,步骤名称将默认为 `run` 命令中指定的文本。
命令默认使用非登录 shell 运行。 您可以选择不同的 shell也可以自定义用于运行命令的 shell。 For more information, see [`jobs.<job_id>.steps[*].shell`](#jobsjob_idstepsshell).
命令默认使用非登录 shell 运行。 您可以选择不同的 shell也可以自定义用于运行命令的 shell。 更多信息请参阅 [`jobs.<job_id>.steps[*].shell`](#jobsjob_idstepsshell)
每个 `run` 关键词代表运行器环境中一个新的进程和 shell。 当您提供多行命令时,每行都在同一个 shell 中运行。 例如:
@@ -546,7 +546,7 @@ jobs:
### `jobs.<job_id>.steps[*].shell`
您可以使用 `shell` 关键词覆盖运行器操作系统中默认的 shell 设置。 您可以使用内置的 `shell` 关键词,也可以自定义 shell 选项集。 The shell command that is run internally executes a temporary file that contains the commands specified in the `run` keyword.
您可以使用 `shell` 关键词覆盖运行器操作系统中默认的 shell 设置。 您可以使用内置的 `shell` 关键词,也可以自定义 shell 选项集。 内部运行的 shell 命令执行一个临时文件,其中包含 `run` 关键词中指定的命令。
| 支持的平台 | `shell` 参数 | 描述 | 内部运行命令 |
| ------------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- |
@@ -710,7 +710,7 @@ steps:
{% data reusables.repositories.actions-env-var-note %}
公共操作可在自述文件中指定预期的环境变量。 如果要在环境变量中设置密码,必须使用 `secrets` 上下文进行设置。 For more information, see "[Using environment variables](/actions/automating-your-workflow-with-github-actions/using-environment-variables)" and "[Contexts](/actions/learn-github-actions/contexts)."
公共操作可在自述文件中指定预期的环境变量。 如果要在环境变量中设置密码,必须使用 `secrets` 上下文进行设置。 更多信息请参阅“[使用环境变量](/actions/automating-your-workflow-with-github-actions/using-environment-variables)”和“[上下文](/actions/learn-github-actions/contexts)”。
#### 示例
@@ -737,11 +737,11 @@ steps:
在 {% data variables.product.prodname_dotcom %} 自动取消运行之前可让作业运行的最大分钟数。 默认值360
如果超时超过运行器的作业执行时限,作业将在达到执行时限时取消。 For more information about job execution time limits, see {% ifversion fpt or ghec or ghes %}"[Usage limits and billing](/actions/reference/usage-limits-billing-and-administration#usage-limits)" for {% data variables.product.prodname_dotcom %}-hosted runners and {% endif %}"[About self-hosted runners](/actions/hosting-your-own-runners/about-self-hosted-runners/#usage-limits){% ifversion fpt or ghec or ghes %}" for self-hosted runner usage limits.{% elsif ghae %}."{% endif %}
如果超时超过运行器的作业执行时限,作业将在达到执行时限时取消。 有关作业执行时间限制的更多信息,请参阅 {% ifversion fpt or ghec or ghes %}“[使用限制和计费](/actions/reference/usage-limits-billing-and-administration#usage-limits)”(对于 {% data variables.product.prodname_dotcom %} 托管的运行器)和 {% endif %}“[关于自托管的运行器](/actions/hosting-your-own-runners/about-self-hosted-runners/#usage-limits){% ifversion fpt or ghec or ghes %}”(对于自托管运行器使用限制)。{% elsif ghae %}。”{% endif %}
{% note %}
**Note:** {% data reusables.actions.github-token-expiration %} For self-hosted runners, the token may be the limiting factor if the job timeout is greater than 24 hours. For more information on the `GITHUB_TOKEN`, see "[About the `GITHUB_TOKEN` secret](/actions/security-guides/automatic-token-authentication#about-the-github_token-secret)."
**注意:** {% data reusables.actions.github-token-expiration %} 对于自托管运行器,如果作业超时大于 24 小时,则令牌可能是限制因素。 有关 `GITHUB_TOKEN` 的更多信息,请参阅“[关于 `GITHUB_TOKEN` 机密](/actions/security-guides/automatic-token-authentication#about-the-github_token-secret)”。
{% endnote %}
@@ -767,7 +767,7 @@ steps:
### 示例:防止特定失败的矩阵作业无法运行工作流程
您可以允许作业矩阵中的特定任务失败,但工作流程运行不失败。 For example, if you wanted to only allow an experimental job with `node` set to `15` to fail without failing the workflow run.
您可以允许作业矩阵中的特定任务失败,但工作流程运行不失败。 例如, 只允许 `node` 设置为 `15` 的实验性作业失败,而不允许工作流程运行失败。
{% raw %}
```yaml
@@ -848,7 +848,7 @@ services:
### `jobs.<job_id>.services.<service_id>.image`
要用作运行操作的服务容器的 Docker 图像。 The value can be the Docker Hub image name or a registry name.
要用作运行操作的服务容器的 Docker 图像。 值可以是 Docker Hub 映像名称或注册表名称。
### `jobs.<job_id>.services.<service_id>.credentials`
@@ -914,7 +914,7 @@ volumes:
{% data reusables.actions.reusable-workflows-ghes-beta %}
The location and version of a reusable workflow file to run as a job. {% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-6000 %}Use one of the following syntaxes:{% endif %}
要作为作业运行的可重用工作流程文件的位置和版本。 {% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-6000 %}使用下列语法之一:{% endif %}
{% data reusables.actions.reusable-workflow-calling-syntax %}
@@ -926,11 +926,11 @@ For more information, see "[Reusing workflows](/actions/learn-github-actions/reu
### `jobs.<job_id>.with`
When a job is used to call a reusable workflow, you can use `with` to provide a map of inputs that are passed to the called workflow.
当作业用于调用可重用工作流程时,可以使用 `with` 来提供传递到被调用工作流程的输入的映射。
Any inputs that you pass must match the input specifications defined in the called workflow.
传递的任何输入都必须与被调用工作流程中定义的输入规范匹配。
Unlike [`jobs.<job_id>.steps[*].with`](#jobsjob_idstepswith), the inputs you pass with `jobs.<job_id>.with` are not be available as environment variables in the called workflow. Instead, you can reference the inputs by using the `inputs` context.
[`jobs.<job_id>.steps[*].with`](#jobsjob_idstepswith)不同,通过 `jobs.<job_id>.with` 传递的输入不能作为被调用工作流程中的环境变量使用。 但您可以通过使用 `inputs` 上下文来引用输入。
#### 示例
@@ -944,15 +944,15 @@ jobs:
### `jobs.<job_id>.with.<input_id>`
A pair consisting of a string identifier for the input and the value of the input. The identifier must match the name of an input defined by [`on.workflow_call.inputs.<inputs_id>`](/actions/creating-actions/metadata-syntax-for-github-actions#inputsinput_id) in the called workflow. The data type of the value must match the type defined by [`on.workflow_call.inputs.<input_id>.type`](#onworkflow_callinputsinput_idtype) in the called workflow.
由输入的字符串标识符和输入的值组成的对。 标识符必须与被调用工作流程中的 [`on.workflow_call.inputs.<inputs_id>`](/actions/creating-actions/metadata-syntax-for-github-actions#inputsinput_id) 定义的输入名称匹配。 该值的数据类型必须与被调用工作流程中的 [`on.workflow_call.inputs.<input_id>.type`](#onworkflow_callinputsinput_idtype) 定义的类型匹配。
Allowed expression contexts: `github`, and `needs`.
允许的表达式上下文: `github` `needs`
### `jobs.<job_id>.secrets`
When a job is used to call a reusable workflow, you can use `secrets` to provide a map of secrets that are passed to the called workflow.
当作业用于调用可重用工作流程时,可以使用 `secrets` 来提供传递给被调用工作流程的机密映射。
Any secrets that you pass must match the names defined in the called workflow.
传递的任何机密都必须与被调用工作流程中定义的名称匹配。
#### 示例
@@ -968,9 +968,9 @@ jobs:
### `jobs.<job_id>.secrets.<secret_id>`
A pair consisting of a string identifier for the secret and the value of the secret. The identifier must match the name of a secret defined by [`on.workflow_call.secrets.<secret_id>`](#onworkflow_callsecretssecret_id) in the called workflow.
由机密的字符串标识符和机密的值组成的对。 标识符必须与被调用工作流程中的 [`on.workflow_call.secrets.<secret_id>`](#onworkflow_callsecretssecret_id) 定义的机密名称匹配。
Allowed expression contexts: `github`, `needs`, and `secrets`.
允许的表达式上下文:`github``needs` `secrets`
{% endif %}
## 过滤器模式备忘清单
@@ -995,7 +995,7 @@ Allowed expression contexts: `github`, `needs`, and `secrets`.
- **/README.md
```
For more information about branch, tag, and path filter syntax, see "[`on.<push>.<branches|tags>`](#onpushbranchestagsbranches-ignoretags-ignore)", "[`on.<pull_request>.<branches|tags>`](#onpull_requestpull_request_targetbranchesbranches-ignore)", and "[`on.<push|pull_request>.paths`](#onpushpull_requestpull_request_targetpathspaths-ignore)."
有关分支、标记和路径筛选器语法的更多信息,请参阅“[`on.<push>.<branches|tags>`](#onpushbranchestagsbranches-ignoretags-ignore)”、“[`on.<pull_request>.<branches|tags>`](#onpull_requestpull_request_targetbranchesbranches-ignore)”和“[`on.<push|pull_request>.paths`](#onpushpull_requestpull_request_targetpathspaths-ignore)”。
### 匹配分支和标记的模式

View File

@@ -5,6 +5,7 @@ intro: 'You can build security into your developers'' workflow with features tha
versions:
ghes: '*'
ghec: '*'
ghae: issue-4864
topics:
- Enterprise
children:

View File

@@ -13,7 +13,7 @@ topics:
- Dependency graph
---
You can allow users to identify their projects' dependencies by enabling the dependency graph for {% data variables.product.product_location %}. For more information, see "[Enabling the dependency graph for your enterprise](/admin/code-security/managing-supply-chain-security-for-your-enterprise/enabling-the-dependency-graph-for-your-enterprise)."
You can allow users to identify their projects' dependencies by {% ifversion ghes %}enabling{% elsif ghae %}using{% endif %} the dependency graph for {% data variables.product.product_location %}. For more information, see "{% ifversion ghes %}[Enabling the dependency graph for your enterprise](/admin/code-security/managing-supply-chain-security-for-your-enterprise/enabling-the-dependency-graph-for-your-enterprise){% elsif ghae %}[About the dependency graph](/code-security/supply-chain-security/understanding-your-software-supply-chain/about-the-dependency-graph){% endif %}."
You can also allow users on {% data variables.product.product_location %} to find and fix vulnerabilities in their code dependencies by enabling {% data variables.product.prodname_dependabot_alerts %}{% ifversion ghes > 3.2 %} and {% data variables.product.prodname_dependabot_updates %}{% endif %}. For more information, see "[Enabling {% data variables.product.prodname_dependabot %} for your enterprise](/admin/configuration/configuring-github-connect/enabling-dependabot-for-your-enterprise)."

View File

@@ -11,7 +11,6 @@ topics:
- Fundamentals
shortTitle: Configure custom footers
---
Enterprise owners can configure {% data variables.product.product_name %} to show custom footers with up to five additional links.
![Custom footer](/assets/images/enterprise/custom-footer/octodemo-footer.png)
@@ -30,8 +29,11 @@ The custom footer is displayed above the {% data variables.product.prodname_dotc
![Enterprise profile settings](/assets/images/enterprise/custom-footer/enterprise-profile-ghes.png)
{%- endif %}
1. At the top of the Profile section, click **Custom footer**. ![Custom footer section](/assets/images/enterprise/custom-footer/custom-footer-section.png)
1. At the top of the Profile section, click **Custom footer**.
![Custom footer section](/assets/images/enterprise/custom-footer/custom-footer-section.png)
1. Add up to five links in the fields shown. ![Add footer links](/assets/images/enterprise/custom-footer/add-footer-links.png)
1. Add up to five links in the fields shown.
![Add footer links](/assets/images/enterprise/custom-footer/add-footer-links.png)
1. Click **Update custom footer** to save the content and display the custom footer. ![Update custom footer](/assets/images/enterprise/custom-footer/update-custom-footer.png)
1. Click **Update custom footer** to save the content and display the custom footer.
![Update custom footer](/assets/images/enterprise/custom-footer/update-custom-footer.png)

View File

@@ -45,7 +45,7 @@ If subdomain isolation is disabled for your enterprise, you should also disable
{% data reusables.enterprise_site_admin_settings.access-settings %}
{% data reusables.enterprise_site_admin_settings.management-console %}
{% data reusables.enterprise_management_console.pages-tab %}
4. Unselect **Enable Pages**.
1. Unselect **Enable Pages**.
![Checkbox to disable {% data variables.product.prodname_pages %}](/assets/images/enterprise/management-console/pages-select-button.png)
{% data reusables.enterprise_management_console.save-settings %}
@@ -56,12 +56,35 @@ If subdomain isolation is disabled for your enterprise, you should also disable
{% data reusables.enterprise-accounts.access-enterprise %}
{% data reusables.enterprise-accounts.policies-tab %}
{% data reusables.enterprise-accounts.pages-tab %}
5. Under "Pages policies", deselect **Enable {% data variables.product.prodname_pages %}**.
1. Under "Pages policies", deselect **Enable {% data variables.product.prodname_pages %}**.
![Checkbox to disable {% data variables.product.prodname_pages %}](/assets/images/enterprise/business-accounts/enable-github-pages-checkbox.png)
{% data reusables.enterprise-accounts.pages-policies-save %}
{% endif %}
{% ifversion ghes > 3.4 %}
## Configuring {% data variables.product.prodname_pages %} response headers for your enterprise
You can add or override response headers for {% data variables.product.prodname_pages %} sites hosted by {% data variables.product.product_location %}.
{% warning %}
**Warning:** Ensure that your response headers are properly configured before saving. Improper configurations may negatively impact the security of {% data variables.product.product_location %}.
{% endwarning %}
{% data reusables.enterprise_site_admin_settings.access-settings %}
{% data reusables.enterprise_site_admin_settings.management-console %}
{% data reusables.enterprise_management_console.pages-tab %}
1. Type the headers settings, then click **Add headers**.
- In the **Http Header Name** field, type the header name. The length of header name should less than 128 characters.
- In the **Http Header Value** field, type the header value. The length of header value should less than 300 characters.
![The {% data variables.product.prodname_pages %} response header name and value fields in the {% data variables.enterprise.management_console %}](/assets/images/enterprise/management-console/pages-override-header-section.png)
{% data reusables.enterprise_management_console.save-settings %}
{% endif %}
{% ifversion ghes %}
## Further reading

View File

@@ -1,7 +1,7 @@
---
title: Managing GitHub Mobile for your enterprise
intro: 'You can decide whether authenticated users can connect to {% data variables.product.product_location %} with {% data variables.product.prodname_mobile %}.'
permissions: 'Enterprise owners can manage {% data variables.product.prodname_mobile %} for an enterprise on {% data variables.product.product_name %}.'
title: 管理企业的 GitHub Mobile
intro: 'You can decide whether people can use {% data variables.product.prodname_mobile %} to connect to {% data variables.product.product_location %}.'
permissions: 'Enterprise owners can manage {% data variables.product.prodname_mobile %} for a {% data variables.product.product_name %} instance.'
versions:
ghes: '*'
type: how_to
@@ -11,25 +11,28 @@ topics:
redirect_from:
- /admin/configuration/configuring-your-enterprise/managing-github-for-mobile-for-your-enterprise
- /admin/configuration/managing-github-for-mobile-for-your-enterprise
shortTitle: Manage GitHub Mobile
shortTitle: 管理 GitHub Mobile
---
{% ifversion ghes %}
{% data reusables.mobile.ghes-release-phase %}
## 关于 {% data variables.product.prodname_mobile %}
{% data variables.product.prodname_mobile %} allows people to triage, collaborate, and manage work on {% data variables.product.product_location %} from a mobile device after successful authentication. {% data reusables.mobile.about-mobile %} 更多信息请参阅“[{% data variables.product.prodname_mobile %}](/get-started/using-github/github-mobile)”。
You can allow or disallow people from using {% data variables.product.prodname_mobile %} to authenticate to {% data variables.product.product_location %} and access your instance's data. By default, {% data variables.product.prodname_mobile %} is{% ifversion ghes > 3.3 %} enabled for people who use {% data variables.product.product_location %}.{% else %} not enabled for people who use {% data variables.product.product_location %}. To allow connection to your instance with {% data variables.product.prodname_mobile %}, you must enable the feature for your instance.{% endif %}
{% ifversion ghes < 3.6 and ghes > 3.1 %}
{% note %}
**Note:** If you upgrade to {% data variables.product.prodname_ghe_server %} 3.4.0 or later and have not previously disabled or enabled {% data variables.product.prodname_mobile %}, {% data variables.product.prodname_mobile %} will be enabled by default. If you previously disabled or enabled {% data variables.product.prodname_mobile %} for your instance, your preference will be preserved upon upgrade. For more information about upgrading your instance, see "[Upgrading {% data variables.product.product_name %}](/admin/enterprise-management/updating-the-virtual-machine-and-physical-resources/upgrading-github-enterprise-server)."
{% endnote %}
{% endif %}
## About {% data variables.product.prodname_mobile %}
{% data reusables.mobile.about-mobile %} For more information, see "[{% data variables.product.prodname_mobile %}](/get-started/using-github/github-mobile)."
Members of your enterprise can use {% data variables.product.prodname_mobile %} to triage, collaborate, and manage work on {% data variables.product.product_location %} from a mobile device. By default, {% data variables.product.prodname_mobile %} is enabled for {% data variables.product.product_location %}. You can allow or disallow enterprise members from using {% data variables.product.prodname_mobile %} to authenticate to {% data variables.product.product_location %} and access your enterprise's data.
## Enabling or disabling {% data variables.product.prodname_mobile %}
## 启用或禁用 {% data variables.product.prodname_mobile %}
{% data reusables.enterprise_site_admin_settings.access-settings %}
{% data reusables.enterprise_site_admin_settings.management-console %}
{% data reusables.enterprise_management_console.type-management-console-password %}
1. In the left sidebar, click **Mobile**.
!["Mobile" in the left sidebar for the {% data variables.product.prodname_ghe_server %} management console](/assets/images/enterprise/management-console/click-mobile.png)
1. Under "GitHub Mobile", select or deselect **Enable GitHub Mobile Apps**.
![Checkbox for "Enable GitHub Mobile Apps" in the {% data variables.product.prodname_ghe_server %} management console](/assets/images/enterprise/management-console/select-enable-github-mobile-apps.png)
1. 在左侧边栏中,单击 **Mobile移动**。 ![{% data variables.product.prodname_ghe_server %} 管理控制台左侧边栏中的"Mobile移动"](/assets/images/enterprise/management-console/click-mobile.png)
1. 在“GitHub Mobile”下选择或取消选择 **Enable GitHub Mobile Apps启用 GitHub Mobile App**。 ![{% data variables.product.prodname_ghe_server %} 管理控制台中的"Enable GitHub Mobile Apps启用 GitHub 手机 App"复选框](/assets/images/enterprise/management-console/select-enable-github-mobile-apps.png)
{% data reusables.enterprise_management_console.save-settings %}

View File

@@ -1,6 +1,6 @@
---
title: About repository caching
intro: You can increase the performance of Git read operations for distributed teams and CI farms with repository caching.
title: 关于存储库缓存
intro: 您可以使用存储库缓存提高分散的团队和 CI 服务器场的 Git 读取操作性能。
versions:
ghes: '>=3.3'
type: overview
@@ -10,12 +10,12 @@ topics:
{% data reusables.enterprise.repository-caching-release-phase %}
If you have teams and CI farms located around the world, you may experience reduced performance on your primary {% data variables.product.prodname_ghe_server %} instance. While active geo-replicas can improve the performance of read requests, this comes at the cost of limiting write throughput. To reduce load on your primary instance and improve write throughput performance, you can configure a repository cache, an asynchronous read-only mirror of repositories located near these geographically-distributed clients.
如果您的团队和 CI 服务器场位于世界各地,则主要 {% data variables.product.prodname_ghe_server %} 实例的性能可能会降低。 虽然活动异地副本可以提高读取请求的性能,但这是以限制写入吞吐量为代价的。 要减少主实例上的负载并提高写入吞吐量性能,您可以配置存储库缓存,这是位于这些地理位置分散的客户端附近的存储库的异步只读镜像。
A repository cache eliminates the need for {% data variables.product.product_name %} to transmit the same Git data over a long-haul network link multiple times to serve multiple clients, by serving your repository data close to CI farms and distributed teams. For instance, if your primary instance is in North America and you also have a large presence in Asia, you will benefit from setting up the repository cache in Asia for use by CI runners there.
存储库缓存通过在 CI 场和分散的团队附近提供存储库数据,不再需要 {% data variables.product.product_name %} 通过长途网络链路多次传输相同的 Git 数据以服务于多个客户端。 例如,如果您的主实例位于北美,并且您在亚洲也拥有大量业务,那么在亚洲设置存储库缓存以供 CI 运行者使用将很有益。
The repository cache listens to the primary instance, whether that's a single instance or a geo-replicated set of instances, for changes to Git data. CI farms and other read-heavy consumers clone and fetch from the repository cache instead of the primary instance. Changes are propagated across the network, at periodic intervals, once per cache instance rather than once per client. Git data will typically be visible on the repository cache within several minutes after the data is pushed to the primary instance. {% ifversion ghes > 3.3 %}The [`cache_sync` webhook](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#cache_sync) can be used by CI systems to react to data being available in the cache.{% endif %}
存储库缓存侦听主实例(无论是单个实例还是异地复制的实例集),以查找对 Git 数据的更改。 CI 场和其他读取量大的使用者克隆并从存储库缓存(而不是主实例)中提取。 更改以定期间隔在网络上传播,每个缓存实例一次,而不是每个客户端一次。 Git 数据通常会在数据推送到主实例后的几分钟内在存储库缓存中可见。 {% ifversion ghes > 3.3 %}CI 系统可以使用 [`cache_sync` web 挂钩](/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#cache_sync)对缓存中可用的数据做出反应。{% endif %}
You have fine-grained control over which repositories are allowed to sync to the repository cache.
您可以精细控制允许哪些存储库同步到存储库缓存。 Git data will only be replicated to the locations you specify.
{% data reusables.enterprise.repository-caching-config-summary %} For more information, see "[Configuring a repository cache](/admin/enterprise-management/caching-repositories/configuring-a-repository-cache)."
{% data reusables.enterprise.repository-caching-config-summary %} 更多信息请参阅“[配置存储库缓存](/admin/enterprise-management/caching-repositories/configuring-a-repository-cache)”。

View File

@@ -1,6 +1,6 @@
---
title: Configuring a repository cache
intro: 'You can configure a repository cache by creating a new appliance, connecting the repository cache to your primary appliance, and configuring replication of repository networks to the repository cache.'
title: 配置存储库缓存
intro: 您可以通过创建新设备、将存储库缓存连接到主设备以及配置存储库网络到存储库缓存的副本来配置存储库缓存。
versions:
ghes: '>=3.3'
type: how_to
@@ -10,38 +10,38 @@ topics:
{% data reusables.enterprise.repository-caching-release-phase %}
## About configuration for repository caching
## 关于存储库缓存的配置
{% data reusables.enterprise.repository-caching-config-summary %} Then, you can set data location policies that govern which repository networks are replicated to the repository cache.
{% data reusables.enterprise.repository-caching-config-summary %} 然后,您可以设置数据位置策略来控制将哪些存储库网络复制到存储库缓存。
Repository caching is not supported with clustering.
群集不支持存储库缓存。
## DNS for repository caches
## 存储库缓存的 DNS
The primary instance and repository cache should have different DNS names. For example, if your primary instance is at `github.example.com`, you might decide to name a cache `europe-ci.github.example.com` or `github.asia.example.com`.
主实例和存储库缓存应具有不同的 DNS 名称。 例如,如果您的主实例位于 `github.example.com`,则可以决定将缓存命名为 `europe-ci.github.example.com` `github.asia.example.com`
To have your CI machines fetch from the repository cache instead of the primary instance, you can use Git's `url.<base>.insteadOf` configuration setting. For more information, see [`git-config`](https://git-scm.com/docs/git-config#Documentation/git-config.txt-urlltbasegtinsteadOf) in the Git documentation.
要让 CI 计算机从存储库缓存(而不是主实例)中提取,您可以使用 Git 的 `url.<base>.insteadOf` 配置设置。 更多信息请参阅 Git 文档中的 [`git-config`](https://git-scm.com/docs/git-config#Documentation/git-config.txt-urlltbasegtinsteadOf) 主题。
For example, the global `.gitconfig` for the CI machine would include these lines.
例如CI 计算机的全局 `.gitconfig` 将包含这些行。
```
[url "https://europe-ci.github.example.com/"]
insteadOf = https://github.example.com/
```
Then, when told to fetch `https://github.example.com/myorg/myrepo`, Git will instead fetch from `https://europe-ci.github.example.com/myorg/myrepo`.
然后,被告知要获取 `https://github.example.com/myorg/myrepo` 时,Git 将从 `https://europe-ci.github.example.com/myorg/myrepo` 获取。
## Configuring a repository cache
## 配置存储库缓存
1. During the beta, you must enable the feature flag for repository caching on your primary {% data variables.product.prodname_ghe_server %} appliance.
1. 在测试期间,您必须为主 {% data variables.product.prodname_ghe_server %} 设备上的存储库缓存启用功能标志。
```
$ ghe-config cluster.cache-enabled true
```
1. 在所需平台上设置新的 {% data variables.product.prodname_ghe_server %} 设备。 This appliance will be your repository cache. 更多信息请参阅“[设置 {% data variables.product.prodname_ghe_server %} 实例](/admin/guides/installation/setting-up-a-github-enterprise-server-instance)”。
1. 在所需平台上设置新的 {% data variables.product.prodname_ghe_server %} 设备。 此设备将是您的存储库缓存。 更多信息请参阅“[设置 {% data variables.product.prodname_ghe_server %} 实例](/admin/guides/installation/setting-up-a-github-enterprise-server-instance)”。
{% data reusables.enterprise_installation.replica-steps %}
1. Connect to the repository cache's IP address using SSH.
1. 使用 SSH 连接到存储库缓存的 IP 地址。
```shell
$ ssh -p 122 admin@<em>REPLICA IP</em>
@@ -49,13 +49,13 @@ Then, when told to fetch `https://github.example.com/myorg/myrepo`, Git will ins
{% data reusables.enterprise_installation.generate-replication-key-pair %}
{% data reusables.enterprise_installation.add-ssh-key-to-primary %}
1. To verify the connection to the primary and enable replica mode for the repository cache, run `ghe-repl-setup` again.
1. 要验证与主缓存的连接并为存储库缓存启用副本模式,请再次运行 `ghe-repl-setup`
```shell
$ ghe-repl-setup <em>PRIMARY IP</em>
```
1. Set a `cache_location` for the repository cache, replacing *CACHE-LOCATION* with an alphanumeric identifier, such as the region where the cache is deployed.
1. 为存储库缓存设置 `cache_location`,将 *CACHE-LOCATION* 替换为字母数字标识符,例如部署缓存的区域。
```shell
$ ghe-repl-node --cache <em>CACHE-LOCATION</em>
@@ -63,28 +63,36 @@ Then, when told to fetch `https://github.example.com/myorg/myrepo`, Git will ins
{% data reusables.enterprise_installation.replication-command %}
{% data reusables.enterprise_installation.verify-replication-channel %}
1. To enable replication of repository networks to the repository cache, set a data location policy. For more information, see "[Data location policies](#data-location-policies)."
1. 要启用存储库网络到存储库缓存的复制,请设置数据位置策略。 更多信息请参阅“[数据位置策略](#data-location-policies)”。
## Data location policies
## 数据位置策略
You can control data locality by configuring data location policies for your repositories with the `spokesctl cache-policy` command. Data location policies determine which repository networks are replicated on which repository caches. By default, no repository networks will be replicated on any repository caches until a data location policy is configured.
通过使用 `spokesctl cache-policy` 命令为存储库配置数据位置策略,可以控制数据局部性。 数据位置策略确定在哪些存储库缓存上复制哪些存储库网络。 默认情况下,在配置数据位置策略之前,不会在任何存储库缓存上复制任何存储库网络。
You can configure a policy to replicate all networks with the `--default` flag. For example, this command will create a policy to replicate a single copy of every repository network to the set of repository caches whose `cache_location` is "kansas".
Data location policies affect only Git content. Content in the database, such as issues and pull request comments, will be replicated to all nodes regardless of policy.
{% note %}
**Note:** Data location policies are not the same as access control. You must use repository roles to control which users may access a repository. For more information about repository roles, see "[Repository roles for an organization](/organizations/managing-access-to-your-organizations-repositories/repository-roles-for-an-organization)."
{% endnote %}
您可以配置策略以复制具有 `--default` 标志的所有网络。 例如,此命令将创建一个策略,以将每个存储库网络的单个副本复制到 `cache_location` 为“kansas”的存储库缓存集。
```
$ ghe-spokesctl cache-policy set --default 1 kansas
```
To configure replication for a repository network, specify the repository that is the root of the network. A repository network includes a repository and all of the repository's forks. You cannot replicate part of a network without replicating the whole network.
要为存储库网络配置复制,请指定作为网络根目录的存储库。 存储库网络包括一个存储库和存储库的所有分支。 如果不复制整个网络,则无法复制网络的一部分。
```
$ ghe-spokesctl cache-policy set <owner/repository> 1 kansas
```
You can override a policy that replicates all networks and exclude specific networks by specifying a replica count of zero for the network. For example, this command specifies that any repository cache in location "kansas" cannot contain any copies of that network.
您可以通过为网络指定副本计数为零来覆盖复制所有网络并排除特定网络的策略。 例如此命令指定位置“kansas”中的任何存储库缓存都不能包含该网络的任何副本。
```
$ ghe-spokesctl cache-policy set <owner/repository> 0 kansas
```
Replica counts greater than one in a given cache location are not supported.
不支持给定缓存位置中大于 1 的副本计数。

View File

@@ -1,6 +1,6 @@
---
title: Caching repositories
intro: 'You can improve performance for your geographically-distributed team with repository caching, which provides read-only mirrors close to your users and CI clients.'
title: 缓存存储库
intro: 您可以使用存储库缓存来提高地理位置分散团队的性能,存储库缓存可提供靠近用户和 CI 客户端的只读镜像。
versions:
ghes: '>=3.3'
topics:

View File

@@ -28,7 +28,7 @@ Alternatively, you can use runner machines that {% data variables.product.compan
This guide shows you how to apply a centralized management approach to self-hosted runners for {% data variables.product.prodname_actions %} in your enterprise. In the guide, you'll complete the following tasks.
1. Configure a limited policy to restrict the actions that can run within your enterprise
1. Configure a limited policy to restrict the actions{% if actions-workflow-policy %} and reusable workflows{% endif %} that can run within your enterprise
1. Deploy a self-hosted runner for your enterprise
1. Create a group to manage access to the runners available to your enterprise
1. Optionally, further restrict the repositories that can use the runner
@@ -48,7 +48,7 @@ After you finish the guide, {% ifversion ghec or ghae %}members of your enterpri
## 1. Configure policies for {% data variables.product.prodname_actions %}
First, enable {% data variables.product.prodname_actions %} for all organizations, and configure a policy to restrict the actions that can run {% ifversion ghec or ghae%}within your enterprise on {% data variables.product.product_name %}{% elsif ghes %}on {% data variables.product.product_location %}{% endif %}. Optionally, organization owners can further restrict these policies for each organization.
First, enable {% data variables.product.prodname_actions %} for all organizations, and configure a policy to restrict the actions{% if actions-workflow-policy %} and reusable workflows{% endif %} that can run {% ifversion ghec or ghae%}within your enterprise on {% data variables.product.product_name %}{% elsif ghes %}on {% data variables.product.product_location %}{% endif %}. Optionally, organization owners can further restrict these policies for each organization.
{% data reusables.enterprise-accounts.access-enterprise %}
{% data reusables.enterprise-accounts.policies-tab %}
@@ -56,9 +56,13 @@ First, enable {% data variables.product.prodname_actions %} for all organization
1. Under "Policies", select **Enable for all organizations**.
![Screenshot of "Enable for all organizations" policy for {% data variables.product.prodname_actions %}](/assets/images/help/settings/actions-policy-enable-for-all-organizations.png)
1. Select **Allow select actions** and **Allow actions created by GitHub** to allow local actions and actions created by {% data variables.product.company_short %}.
1. Select {% data reusables.actions.policy-label-for-select-actions-workflows %} and **Allow actions created by GitHub** to allow local actions{% if actions-workflow-policy %} and reusable workflows{% endif %}, and actions created by {% data variables.product.company_short %}.
{% if actions-workflow-policy %}
![Screenshot of "Allow select actions" and "Allow actions created by {% data variables.product.company_short %}" for {% data variables.product.prodname_actions %}](/assets/images/help/settings/actions-policy-allow-select-actions-and-actions-from-github-with-workflows.png)
{%- else %}
![Screenshot of "Allow select actions" and "Allow actions created by {% data variables.product.company_short %}" for {% data variables.product.prodname_actions %}](/assets/images/help/settings/actions-policy-allow-select-actions-and-actions-from-github.png)
{%- endif %}
1. 单击 **Save保存**
You can configure additional policies to restrict the actions available to {% ifversion ghec or ghae %}enterprise members{% elsif ghes %}users of {% data variables.product.product_location %}{% endif %}. 更多信息请参阅“[在企业中执行 {% data variables.product.prodname_actions %} 的策略](/admin/policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-github-actions-in-your-enterprise#allowing-select-actions-to-run)”。
@@ -130,7 +134,7 @@ Optionally, you can build custom tooling to automatically scale the self-hosted
- You can monitor self-hosted runners and troubleshoot common issues. 更多信息请参阅“[自托管运行器监控和故障排除](/actions/hosting-your-own-runners/monitoring-and-troubleshooting-self-hosted-runners)”。
- {% data variables.product.company_short %} recommends that you review security considerations for self-hosted runner machines. For more information, see "[Security hardening for {% data variables.product.prodname_actions %}](/actions/security-guides/security-hardening-for-github-actions#hardening-for-self-hosted-runners)."
- {% data variables.product.company_short %} recommends that you review security considerations for self-hosted runner machines. 更多信息请参阅“[{% data variables.product.prodname_actions %} 的安全强化](/actions/security-guides/security-hardening-for-github-actions#hardening-for-self-hosted-runners)”。
- {% ifversion ghec %}If you use {% data variables.product.prodname_ghe_server %} or {% data variables.product.prodname_ghe_managed %}, you{% elsif ghes or ghae %}You{% endif %} can manually sync repositories on {% data variables.product.prodname_dotcom_the_website %} containing actions to your enterprise on {% ifversion ghes or ghae %}{% data variables.product.product_name %}{% elsif ghec %}{% data variables.product.prodname_ghe_server %} or {% data variables.product.prodname_ghe_managed %}{% endif %}. Alternatively, you can allow members of your enterprise to automatically access actions from {% data variables.product.prodname_dotcom_the_website %} by using {% data variables.product.prodname_github_connect %}. 更多信息请参阅以下文章。

View File

@@ -1,6 +1,6 @@
---
title: Getting started with GitHub Actions for your enterprise
intro: 'Learn how to adopt {% data variables.product.prodname_actions %} for your enterprise.'
title: 企业 GitHub Actions 使用入门
intro: '了解如何为您的企业采用 {% data variables.product.prodname_actions %}'
versions:
ghec: '*'
ghes: '*'

View File

@@ -26,11 +26,15 @@ Before you introduce {% data variables.product.prodname_actions %} to a large en
You should create a plan to govern your enterprise's use of {% data variables.product.prodname_actions %} and meet your compliance obligations.
Determine which actions your developers will be allowed to use. {% ifversion ghes %}First, decide whether you'll enable access to actions from outside your instance. {% data reusables.actions.access-actions-on-dotcom %} For more information, see "[About using actions in your enterprise](/admin/github-actions/managing-access-to-actions-from-githubcom/about-using-actions-in-your-enterprise)."
Determine which actions {% if actions-workflow-policy %}and reusable workflows{% endif %} your developers will be allowed to use. {% ifversion ghes %}First, decide whether you'll enable access to actions {% if actions-workflow-policy %}and reusable workflows{% endif %} from outside your instance. {% data reusables.actions.access-actions-on-dotcom %} For more information, see "[About using actions in your enterprise](/admin/github-actions/managing-access-to-actions-from-githubcom/about-using-actions-in-your-enterprise)."
Then,{% else %}First,{% endif %} decide whether you'll allow third-party actions that were not created by {% data variables.product.company_short %}. You can configure the actions that are allowed to run at the repository, organization, and enterprise levels and can choose to only allow actions that are created by {% data variables.product.company_short %}. If you do allow third-party actions, you can limit allowed actions to those created by verified creators or a list of specific actions. For more information, see "[Managing {% data variables.product.prodname_actions %} settings for a repository](/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#managing-github-actions-permissions-for-your-repository)", "[Disabling or limiting {% data variables.product.prodname_actions %} for your organization](/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#managing-github-actions-permissions-for-your-organization)", and "[Enforcing policies for {% data variables.product.prodname_actions %} in your enterprise](/admin/policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-github-actions-in-your-enterprise#enforcing-a-policy-to-restrict-the-use-of-actions-in-your-enterprise)."
Then,{% else %}First,{% endif %} decide whether you'll allow third-party actions {% if actions-workflow-policy %}and reusable workflows{% endif %} that were not created by {% data variables.product.company_short %}. You can configure the actions {% if actions-workflow-policy %}and reusable workflows{% endif %} that are allowed to run at the repository, organization, and enterprise levels and can choose to only allow actions that are created by {% data variables.product.company_short %}. If you do allow third-party actions{% if actions-workflow-policy %} and reusable workflows{% endif %}, you can limit allowed actions to those created by verified creators or a list of specific actions{% if actions-workflow-policy %} and reusable workflows{% endif %}. For more information, see "[Managing {% data variables.product.prodname_actions %} settings for a repository](/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#managing-github-actions-permissions-for-your-repository)", "[Disabling or limiting {% data variables.product.prodname_actions %} for your organization](/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#managing-github-actions-permissions-for-your-organization)", and "[Enforcing policies for {% data variables.product.prodname_actions %} in your enterprise](/admin/policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-github-actions-in-your-enterprise#enforcing-a-policy-to-restrict-the-use-of-github-actions-in-your-enterprise)."
{% if actions-workflow-policy %}
![Screenshot of {% data variables.product.prodname_actions %} policies](/assets/images/help/organizations/enterprise-actions-policy-with-workflows.png)
{%- else %}
![Screenshot of {% data variables.product.prodname_actions %} policies](/assets/images/help/organizations/enterprise-actions-policy.png)
{%- endif %}
{% ifversion ghec or ghae-issue-4757 %}
Consider combining OpenID Connect (OIDC) with reusable workflows to enforce consistent deployments across your repository, organization, or enterprise. You can do this by defining trust conditions on cloud roles based on reusable workflows. For more information, see "[Using OpenID Connect with reusable workflows](/actions/deployment/security-hardening-your-deployments/using-openid-connect-with-reusable-workflows)."
@@ -38,9 +42,9 @@ Consider combining OpenID Connect (OIDC) with reusable workflows to enforce cons
You can access information about activity related to {% data variables.product.prodname_actions %} in the audit logs for your enterprise. If your business needs require retaining audit logs for longer than six months, plan how you'll export and store this data outside of {% data variables.product.prodname_dotcom %}. For more information, see {% ifversion ghec %}"[Streaming the audit logs for organizations in your enterprise](/admin/user-management/managing-organizations-in-your-enterprise/streaming-the-audit-logs-for-organizations-in-your-enterprise-account)."{% else %}"[Searching the audit log](/admin/user-management/monitoring-activity-in-your-enterprise/searching-the-audit-log)."{% endif %}
![审核日志条目](/assets/images/help/repository/audit-log-entries.png)
![Audit log entries](/assets/images/help/repository/audit-log-entries.png)
## 安全
## Security
You should plan your approach to security hardening for {% data variables.product.prodname_actions %}.
@@ -56,7 +60,8 @@ You should plan where you'll store your secrets. We recommend storing secrets in
In {% data variables.product.prodname_dotcom %}, you can store secrets at the repository or organization level. Secrets at the repository level can be limited to workflows in certain environments, such as production or testing. For more information, see "[Encrypted secrets](/actions/security-guides/encrypted-secrets)."
![Screenshot of a list of secrets](/assets/images/help/settings/actions-org-secrets-list.png) You should consider adding manual approval protection for sensitive environments, so that workflows must be approved before getting access to the environments' secrets. For more information, see "[Using environments for deployments](/actions/deployment/targeting-different-environments/using-environments-for-deployment)."
![Screenshot of a list of secrets](/assets/images/help/settings/actions-org-secrets-list.png)
You should consider adding manual approval protection for sensitive environments, so that workflows must be approved before getting access to the environments' secrets. For more information, see "[Using environments for deployments](/actions/deployment/targeting-different-environments/using-environments-for-deployment)."
### Security considerations for third-party actions
@@ -89,7 +94,7 @@ You should plan for how you'll manage the resources required to use {% data vari
You may need to upgrade the CPU and memory resources for {% data variables.product.product_location %} to handle the load from {% data variables.product.prodname_actions %} without causing performance loss. For more information, see "[Getting started with {% data variables.product.prodname_actions %} for {% data variables.product.prodname_ghe_server %}](/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/getting-started-with-github-actions-for-github-enterprise-server#review-hardware-requirements)."
{% endif %}
### 运行器
### Runners
{% data variables.product.prodname_actions %} workflows require runners.{% ifversion ghec %} You can choose to use {% data variables.product.prodname_dotcom %}-hosted runners or self-hosted runners. {% data variables.product.prodname_dotcom %}-hosted runners are convenient because they are managed by {% data variables.product.company_short %}, who handles maintenance and upgrades for you. However, you may want to consider self-hosted runners if you need to run a workflow that will access resources behind your firewall or you want more control over the resources, configuration, or geographic location of your runner machines. For more information, see "[About {% data variables.product.prodname_dotcom %}-hosted runners](/actions/using-github-hosted-runners/about-github-hosted-runners)" and "[About self-hosted runners](/actions/hosting-your-own-runners/about-self-hosted-runners)."{% else %} You will need to host your own runners by installing the {% data variables.product.prodname_actions %} self-hosted runner application on your own machines. For more information, see "[About self-hosted runners](/actions/hosting-your-own-runners/about-self-hosted-runners)."{% endif %}
@@ -98,12 +103,12 @@ You may need to upgrade the CPU and memory resources for {% data variables.produ
You also have to decide where to add each runner. You can add a self-hosted runner to an individual repository, or you can make the runner available to an entire organization or your entire enterprise. Adding runners at the organization or enterprise levels allows sharing of runners, which might reduce the size of your runner infrastructure. You can use policies to limit access to self-hosted runners at the organization and enterprise levels by assigning groups of runners to specific repositories or organizations. For more information, see "[Adding self-hosted runners](/actions/hosting-your-own-runners/adding-self-hosted-runners)" and "[Managing access to self-hosted runners using groups](/actions/hosting-your-own-runners/managing-access-to-self-hosted-runners-using-groups)."
{% ifversion ghec or ghes > 3.2 %}
You should consider using autoscaling to automatically increase or decrease the number of available self-hosted runners. 更多信息请参阅“[使用自托管运行器自动缩放](/actions/hosting-your-own-runners/autoscaling-with-self-hosted-runners)”。
You should consider using autoscaling to automatically increase or decrease the number of available self-hosted runners. For more information, see "[Autoscaling with self-hosted runners](/actions/hosting-your-own-runners/autoscaling-with-self-hosted-runners)."
{% endif %}
Finally, you should consider security hardening for self-hosted runners. For more information, see "[Security hardening for {% data variables.product.prodname_actions %}](/actions/security-guides/security-hardening-for-github-actions#hardening-for-self-hosted-runners)."
### 存储器
### Storage
{% data reusables.actions.about-artifacts %} For more information, see "[Storing workflow data as artifacts](/actions/advanced-guides/storing-workflow-data-as-artifacts)."
@@ -122,7 +127,7 @@ You must configure external blob storage for these artifacts. Decide which suppo
If you want to retain logs and artifacts longer than the upper limit you can configure in {% data variables.product.product_name %}, you'll have to plan how to export and store the data.
{% ifversion ghec %}
Some storage is included in your subscription, but additional storage will affect your bill. You should plan for this cost. 更多信息请参阅“[关于 {% data variables.product.prodname_actions %} 的计费](/billing/managing-billing-for-github-actions/about-billing-for-github-actions)”。
Some storage is included in your subscription, but additional storage will affect your bill. You should plan for this cost. For more information, see "[About billing for {% data variables.product.prodname_actions %}](/billing/managing-billing-for-github-actions/about-billing-for-github-actions)."
{% endif %}
## Tracking usage

View File

@@ -1,7 +1,7 @@
---
title: Migrating your enterprise to GitHub Actions
shortTitle: Migrate to Actions
intro: 'Learn how to plan a migration to {% data variables.product.prodname_actions %} for your enterprise from another provider.'
title: 将企业迁移到 GitHub Actions
shortTitle: 迁移到 Actions
intro: '了解如何规划从其他提供商迁移到企业的 {% data variables.product.prodname_actions %}'
versions:
ghec: '*'
ghes: '*'
@@ -12,76 +12,76 @@ topics:
- Enterprise
---
## About enterprise migrations to {% data variables.product.prodname_actions %}
## 关于企业迁移到 {% data variables.product.prodname_actions %}
To migrate your enterprise to {% data variables.product.prodname_actions %} from an existing system, you can plan the migration, complete the migration, and retire existing systems.
要将企业从现有系统迁移到 {% data variables.product.prodname_actions %},您可以规划迁移、完成迁移和停用现有系统。
This guide addresses specific considerations for migrations. For additional information about introducing {% data variables.product.prodname_actions %} to your enterprise, see "[Introducing {% data variables.product.prodname_actions %} to your enterprise](/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/introducing-github-actions-to-your-enterprise)."
本指南介绍了迁移的具体注意事项。 有关向企业介绍 {% data variables.product.prodname_actions %} 的其他信息,请参阅“[向企业介绍 {% data variables.product.prodname_actions %}](/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/introducing-github-actions-to-your-enterprise)”。
## Planning your migration
## 规划迁移
Before you begin migrating your enterprise to {% data variables.product.prodname_actions %}, you should identify which workflows will be migrated and how those migrations will affect your teams, then plan how and when you will complete the migrations.
在开始将企业迁移到 {% data variables.product.prodname_actions %} 之前,应确定将迁移哪些工作流程以及这些迁移将如何影响您的团队,然后规划如何以及何时完成迁移。
### Leveraging migration specialists
### 利用迁移专家
{% data variables.product.company_short %} can help with your migration, and you may also benefit from purchasing {% data variables.product.prodname_professional_services %}. For more information, contact your dedicated representative or {% data variables.contact.contact_enterprise_sales %}.
{% data variables.product.company_short %} 可以帮助您进行迁移,并且您也可以购买 {% data variables.product.prodname_professional_services %}。 更多信息请联系您的专属代表或 {% data variables.contact.contact_enterprise_sales %}
### Identifying and inventorying migration targets
### 确定和清点迁移目标
Before you can migrate to {% data variables.product.prodname_actions %}, you need to have a complete understanding of the workflows being used by your enterprise in your existing system.
在迁移到 {% data variables.product.prodname_actions %} 之前,您需要全面了解企业在现有系统中使用的工作流程。
First, create an inventory of the existing build and release workflows within your enterprise, gathering information about which workflows are being actively used and need to migrated and which can be left behind.
首先,创建企业内现有构建和发布工作流的清单,收集有关哪些工作流程正被使用但需要迁移以及哪些工作流程留在后面迁移的信息。
Next, learn the differences between your current provider and {% data variables.product.prodname_actions %}. This will help you assess any difficulties in migrating each workflow, and where your enterprise might experience differences in features. For more information, see "[Migrating to {% data variables.product.prodname_actions %}](/actions/migrating-to-github-actions)."
接下来,了解当前提供商与 {% data variables.product.prodname_actions %} 之间的区别。 这将帮助您评估迁移每个工作流程时遇到的任何困难,以及您的企业在哪些方面可能会遇到功能差异。 更多信息请参阅“[迁移到 {% data variables.product.prodname_actions %}](/actions/migrating-to-github-actions)”。
With this information, you'll be able to determine which workflows you can and want to migrate to {% data variables.product.prodname_actions %}.
使用此信息,您将能够确定哪些工作流程要迁移到 {% data variables.product.prodname_actions %}
### Determine team impacts from migrations
### 确定迁移对团队的影响
When you change the tools being used within your enterprise, you influence how your team works. You'll need to consider how moving a workflow from your existing systems to {% data variables.product.prodname_actions %} will affect your developers' day-to-day work.
当您更改企业中使用的工具时,会影响团队的工作方式。 您需要考虑将工作流从现有系统迁移到 {% data variables.product.prodname_actions %} 将如何影响开发人员的日常工作。
Identify any processes, integrations, and third-party tools that will be affected by your migration, and make a plan for any updates you'll need to make.
确定将受迁移影响的任何流程、集成和第三方工具,并为需要进行的任何更新制定计划。
Consider how the migration may affect your compliance concerns. For example, will your existing credential scanning and security analysis tools work with {% data variables.product.prodname_actions %}, or will you need to use new tools?
请考虑迁移可能会如何影响您的合规性问题。 例如,您现有的凭据扫描和安全分析工具是与 {% data variables.product.prodname_actions %} 一起使用,还是需要使用新工具?
Identify the gates and checks in your existing system and verify that you can implement them with {% data variables.product.prodname_actions %}.
识别现有系统中的网关和检查,并验证是否可以使用 {% data variables.product.prodname_actions %} 实施它们。
### Identifying and validating migration tools
### 识别和验证迁移工具
Automated migration tools can translate your enterprise's workflows from the existing system's syntax to the syntax required by {% data variables.product.prodname_actions %}. Identify third-party tooling or contact your dedicated representative or {% data variables.contact.contact_enterprise_sales %} to ask about tools that {% data variables.product.company_short %} can provide.
自动迁移工具可以将企业的工作流程从现有系统的语法转换为 {% data variables.product.prodname_actions %} 所需的语法。 确定第三方工具或者联系您的专业代表或 {% data variables.contact.contact_enterprise_sales %},询问 {% data variables.product.company_short %} 可以提供的工具。
After you've identified a tool to automate your migrations, validate the tool by running the tool on some test workflows and verifying that the results are as expected.
确定用于自动执行迁移的工具后,请通过在某些测试工作流程上运行该工具并验证结果是否符合预期来验证该工具。
Automated tooling should be able to migrate the majority of your workflows, but you'll likely need to manually rewrite at least a small percentage. Estimate the amount of manual work you'll need to complete.
自动化工具应该能够迁移大部分工作流程,但您可能需要手动重写至少一小部分。 估计您需要完成的手动工作量。
### Deciding on a migration approach
### 确定迁移方法
Determine the migration approach that will work best for your enterprise. Smaller teams may be able to migrate all their workflows at once, with a "rip-and-replace" approach. For larger enterprises, an iterative approach may be more realistic. You can choose to have a central body manage the entire migration or you can ask individual teams to self serve by migrating their own workflows.
确定最适合您的企业的迁移方法。 较小的团队可以使用“淘汰和替换”方法一次迁移所有工作流程。 对于大型企业,迭代方法可能更现实。 您可以选择让中央机构管理整个迁移过程,也可以要求各个团队通过迁移自己的工作流程进行自助服务。
We recommend an iterative approach that combines active management with self service. Start with a small group of early adopters that can act as your internal champions. Identify a handful of workflows that are comprehensive enough to represent the breadth of your business. Work with your early adopters to migrate those workflows to {% data variables.product.prodname_actions %}, iterating as needed. This will give other teams confidence that their workflows can be migrated, too.
我们建议采用将主动管理与自助服务相结合的迭代方法。 从一小群早期采用者开始,他们可以充当您的内部拥护者。 确定一些足够全面的工作流程,以代表您的业务广度。 与早期采用者合作,将这些工作流程迁移到 {% data variables.product.prodname_actions %},根据需要进行迭代。 这将让其他团队相信他们的工作流程也可以迁移。
Then, make {% data variables.product.prodname_actions %} available to your larger organization. Provide resources to help these teams migrate their own workflows to {% data variables.product.prodname_actions %}, and inform the teams when the existing systems will be retired.
然后,使 {% data variables.product.prodname_actions %} 可供您的大型组织使用。 提供资源以帮助这些团队将自己的工作流程迁移到 {% data variables.product.prodname_actions %},并在现有系统将要停用时通知团队。
Finally, inform any teams that are still using your old systems to complete their migrations within a specific timeframe. You can point to the successes of other teams to reassure them that migration is possible and desirable.
最后,通知仍在使用旧系统的任何团队,以便在特定时间范围内完成迁移。 您可以指出其他团队的成功案例,以向他们保证迁移是可能的,也是可取的。
### Defining your migration schedule
### 定义迁移计划
After you decide on a migration approach, build a schedule that outlines when each of your teams will migrate their workflows to {% data variables.product.prodname_actions %}.
确定迁移方法后,请制定一个计划,说明每个团队何时将其工作流程迁移到 {% data variables.product.prodname_actions %}
First, decide the date you'd like your migration to be complete. For example, you can plan to complete your migration by the time your contract with your current provider ends.
首先,确定您希望迁移完成的日期。 例如,您可以计划在与当前提供商的合同结束时完成迁移。
Then, work with your teams to create a schedule that meets your deadline without sacrificing their team goals. Look at your business's cadence and the workload of each individual team you're asking to migrate. Coordinate with each team to understand their delivery schedules and create a plan that allows the team to migrate their workflows at a time that won't impact their ability to deliver.
然后,与您的团队合作,创建一个符合最后期限又不会牺牲团队目标的时间表。 查看业务的节奏以及您要求迁移的每个团队的工作负载。 与每个团队协调,了解他们的交付时间表,并制定一个计划,允许团队在不影响其交付能力的时间迁移其工作流程。
## Migrating to {% data variables.product.prodname_actions %}
## 迁移到 {% data variables.product.prodname_actions %}
When you're ready to start your migration, translate your existing workflows to {% data variables.product.prodname_actions %} using the automated tooling and manual rewriting you planned for above.
当您准备好开始迁移时,请使用上面计划的自动化工具和手动重写将现有工作流程转换为 {% data variables.product.prodname_actions %}。
You may also want to maintain old build artifacts from your existing system, perhaps by writing a scripted process to archive the artifacts.
您可能还希望维护现有系统中的旧构件,也许是通过编写脚本化进程来存档构件。
## Retiring existing systems
## 停用现有系统
After your migration is complete, you can think about retiring your existing system.
迁移完成后,可以考虑停用现有系统。
You may want to run both systems side-by-side for some period of time, while you verify that your {% data variables.product.prodname_actions %} configuration is stable, with no degradation of experience for developers.
您可能希望在一段时间内并行运行这两个系统,同时验证 {% data variables.product.prodname_actions %} 配置是否稳定,而不会降低开发人员的体验。
Eventually, decommission and shut off the old systems, and ensure that no one within your enterprise can turn the old systems back on.
最终,停用并关闭旧系统,并确保企业内没有人可以重新打开旧系统。

View File

@@ -94,7 +94,7 @@ The "GitHub AE" app in Okta uses the {% data variables.product.product_name %} A
1. For "API Token", type the {% data variables.product.prodname_ghe_managed %} personal access token you generated previously.
1. Click **Test API Credentials**.
1. 单击 **Test API Credentials(测试 API 凭据)**
{% note %}
@@ -150,7 +150,7 @@ Before your Okta users can use their credentials to sign in to {% data variables
### Provisioning access for Okta groups
You can map your Okta group to a team in {% data variables.product.prodname_ghe_managed %}. Members of the Okta group will then automatically become members of the mapped {% data variables.product.prodname_ghe_managed %} team. For more information, see "[Mapping Okta groups to teams](/admin/authentication/configuring-authentication-and-provisioning-with-your-identity-provider/mapping-okta-groups-to-teams)."
You can map your Okta group to a team in {% data variables.product.prodname_ghe_managed %}. Members of the Okta group will then automatically become members of the mapped {% data variables.product.prodname_ghe_managed %} team. 更多信息请参阅“[将 Okta 组映射到团队](/admin/authentication/configuring-authentication-and-provisioning-with-your-identity-provider/mapping-okta-groups-to-teams)”。
## 延伸阅读

View File

@@ -74,7 +74,7 @@ The following IdPs are officially supported for integration with {% data variabl
## Mapping {% data variables.product.prodname_ghe_managed %} teams to Okta groups
If you use Okta as your IdP, you can map your Okta groups to teams on {% data variables.product.prodname_ghe_managed %}. For more information, see "[Mapping Okta groups to teams](/admin/authentication/configuring-authentication-and-provisioning-with-your-identity-provider/mapping-okta-groups-to-teams)."
If you use Okta as your IdP, you can map your Okta groups to teams on {% data variables.product.prodname_ghe_managed %}. 更多信息请参阅“[将 Okta 组映射到团队](/admin/authentication/configuring-authentication-and-provisioning-with-your-identity-provider/mapping-okta-groups-to-teams)”。
{% endif %}

View File

@@ -1,5 +1,5 @@
---
title: Configuring SAML single sign-on for your enterprise using Okta
title: 使用 Okta 为企业配置 SAML 单点登录
intro: '您可以使用安全声明标记语言 (SAML) 单点登录 (SSO) 与 Okta 一起来自动管理对 {% data variables.product.product_name %} 上企业帐户的访问。'
redirect_from:
- /github/setting-up-and-managing-your-enterprise/configuring-single-sign-on-for-your-enterprise-account-using-okta
@@ -13,7 +13,7 @@ topics:
- Authentication
- Enterprise
type: how_to
shortTitle: Configure SAML with Okta
shortTitle: 使用 Okta 配置 SAML
---
{% data reusables.enterprise-accounts.emu-saml-note %}
@@ -26,12 +26,12 @@ SAML SSO 控制并保护对企业帐户资源(如组织、仓库、议题和
{% data reusables.saml.switching-from-org-to-enterprise %} For more information, see "[Switching your SAML configuration from an organization to an enterprise account](/github/setting-up-and-managing-your-enterprise/configuring-identity-and-access-management-for-your-enterprise-account/switching-your-saml-configuration-from-an-organization-to-an-enterprise-account)."
Alternatively, you can also configure SAML SSO using Okta for an organization that uses {% data variables.product.prodname_ghe_cloud %}. 更多信息请参阅“[使用 Okta 配置 SAML 单点登录和 SCIM](/organizations/managing-saml-single-sign-on-for-your-organization/configuring-saml-single-sign-on-and-scim-using-okta)”。
或者,您也可以使用 Okta 配置为使用 {% data variables.product.prodname_ghe_cloud %} 的组织 SAML SSO。 更多信息请参阅“[使用 Okta 配置 SAML 单点登录和 SCIM](/organizations/managing-saml-single-sign-on-for-your-organization/configuring-saml-single-sign-on-and-scim-using-okta)”。
## 在 Okta 中添加 {% data variables.product.prodname_ghe_cloud %} 应用程序
{% data reusables.saml.okta-sign-into-your-account %}
1. Navigate to the [Github Enterprise Cloud - Enterprise Accounts](https://www.okta.com/integrations/github-enterprise-cloud-enterprise-accounts) application in the Okta Integration Network and click **Add Integration**.
1. 导航到 Okta 集成网络中的 [GitHub Enterprise Cloud - 企业帐户](https://www.okta.com/integrations/github-enterprise-cloud-enterprise-accounts)应用程序,然后单击 **Add Integration(添加集成)**
{% data reusables.saml.okta-dashboard-click-applications %}
1. 可选在“Application label应用程序标签”右边输入应用程序的描述性名称。
1. 在“{% data variables.product.prodname_dotcom %} Enterprises”右侧键入企业帐户的名称。 例如,如果企业帐户的 URL 是`https://github.com/enterprises/octo-corp`,请键入 `octo-corp`

View File

@@ -64,7 +64,7 @@ Your contact on the GitHub Sales team will work with you to create your new {% d
After we create your enterprise, you will receive an email from {% data variables.product.prodname_dotcom %} inviting you to choose a password for your enterprise's setup user, which will be the first owner in the enterprise. Use an incognito or private browsing window when setting the password. The setup user is only used to configure SAML single sign-on and SCIM provisioning integration for the enterprise. It will no longer have access to administer the enterprise account once SAML is successfully enabled.
The setup user's username is your enterprise's shortcode suffixed with `_admin`. After you log in to your setup user, you can get started by configuring SAML SSO for your enterprise. For more information, see "[Configuring SAML single sign-on for Enterprise Managed Users](/github/setting-up-and-managing-your-enterprise/managing-your-enterprise-users-with-your-identity-provider/configuring-saml-single-sign-on-for-enterprise-managed-users)."
The setup user's username is your enterprise's shortcode suffixed with `_admin`. After you log in to your setup user, you can get started by configuring SAML SSO for your enterprise. 更多信息请参阅“[为企业托管用户配置 SAML 单点登录](/github/setting-up-and-managing-your-enterprise/managing-your-enterprise-users-with-your-identity-provider/configuring-saml-single-sign-on-for-enterprise-managed-users)”。
{% note %}

View File

@@ -29,13 +29,13 @@ To configure provisioning with Okta, you must set your enterprise's name in the
{% data variables.product.prodname_emus %} supports many provisioning features in Okta.
| 功能 | 描述 |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 推送新用户 | Users that are assigned to the {% data variables.product.prodname_emu_idp_application %} application in Okta are automatically created in the enterprise on {% data variables.product.product_name %}. |
| Push Profile Update | Updates made to the user's profile in Okta will be pushed to {% data variables.product.product_name %}. |
| Push Groups | Groups in Okta that are assigned to the {% data variables.product.prodname_emu_idp_application %} application as Push Groups are automatically created in the enterprise on {% data variables.product.product_name %}. |
| 推送用户停用 | Unassigning the user from the {% data variables.product.prodname_emu_idp_application %} application in Okta will disable the user on {% data variables.product.product_name %}. The user will not be able to sign in, but the user's information is maintained. |
| 重新激活用户 | Users in Okta whose Okta accounts are reactivated and who are assigned back to the {% data variables.product.prodname_emu_idp_application %} application will be enabled. |
| Feature | Description |
| --- | --- |
| Push New Users | Users that are assigned to the {% data variables.product.prodname_emu_idp_application %} application in Okta are automatically created in the enterprise on {% data variables.product.product_name %}. |
| Push Profile Update | Updates made to the user's profile in Okta will be pushed to {% data variables.product.product_name %}. |
| Push Groups | Groups in Okta that are assigned to the {% data variables.product.prodname_emu_idp_application %} application as Push Groups are automatically created in the enterprise on {% data variables.product.product_name %}. |
| Push User Deactivation | Unassigning the user from the {% data variables.product.prodname_emu_idp_application %} application in Okta will disable the user on {% data variables.product.product_name %}. The user will not be able to sign in, but the user's information is maintained. |
| Reactivate Users | Users in Okta whose Okta accounts are reactivated and who are assigned back to the {% data variables.product.prodname_emu_idp_application %} application will be enabled. |
{% note %}
@@ -50,7 +50,8 @@ After your {% data variables.product.prodname_emu_enterprise %} has been created
1. Navigate to your {% data variables.product.prodname_emu_idp_application %} application on Okta.
1. Click the **Sign On** tab.
1. To make changes, click **Edit**.
1. Under "Advanced Sign-on Settings", in the "Enterprise Name" text box, type your enterprise name. For example, if you access your enterprise at `https://github.com/enterprises/octoinc`, your enterprise name would be "octoinc". ![Screenshot of the Enterprise Name field on Okta](/assets/images/help/enterprises/okta-emu-enterprise-name.png)
1. Under "Advanced Sign-on Settings", in the "Enterprise Name" text box, type your enterprise name. For example, if you access your enterprise at `https://github.com/enterprises/octoinc`, your enterprise name would be "octoinc".
![Screenshot of the Enterprise Name field on Okta](/assets/images/help/enterprises/okta-emu-enterprise-name.png)
1. To save your enterprise name, click **Save**.
## Configuring provisioning
@@ -63,18 +64,21 @@ To configure provisioning, the setup user with the **@<em>SHORT-CODE</em>_admin*
1. Click the **Provisioning** tab.
1. In the settings menu, click **Integration**.
1. To make changes, click **Edit**.
1. 选择 **Enable API integration(启用 API 集成)**
1. In the "API Token" field, enter the personal access token with the **admin:enterprise** scope belonging to the setup user. ![Screenshot showing the API Token field on Okta](/assets/images/help/enterprises/okta-emu-token.png)
1. Select **Enable API integration**.
1. In the "API Token" field, enter the personal access token with the **admin:enterprise** scope belonging to the setup user.
![Screenshot showing the API Token field on Okta](/assets/images/help/enterprises/okta-emu-token.png)
1. Click **Test API Credentials**. If the test is successful, a verification message will appear at the top of the screen.
1. To save the token, click **Save**.
1. In the settings menu, click **To App**. ![Screenshot showing the To App menu item on Okta](/assets/images/help/enterprises/okta-emu-to-app-menu.png)
1. In the settings menu, click **To App**.
![Screenshot showing the To App menu item on Okta](/assets/images/help/enterprises/okta-emu-to-app-menu.png)
1. To the right of "Provisioning to App", to allow changes to be made, click **Edit**.
1. Select **Enable** for **Create Users**, **Update User Attributes**, and **Deactivate Users**. ![Screenshot showing provisioning options on Okta](/assets/images/help/enterprises/okta-emu-provisioning-to-app.png)
1. Select **Enable** for **Create Users**, **Update User Attributes**, and **Deactivate Users**.
![Screenshot showing provisioning options on Okta](/assets/images/help/enterprises/okta-emu-provisioning-to-app.png)
1. To finish configuring provisioning, click **Save**.
## Assigning users and groups
After you have configured SAML SSO and provisioning, you will be able provision new users on {% data variables.product.prodname_dotcom_the_website %} by assigning users to the {% data variables.product.prodname_emu_idp_application %} application.
After you have configured SAML SSO and provisioning, you will be able provision new users on {% data variables.product.prodname_dotcom_the_website %} by assigning users to the {% data variables.product.prodname_emu_idp_application %} application.
{% data reusables.scim.emu-scim-rate-limit %}

View File

@@ -23,7 +23,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 single-sign on. For more information, see "[Configuring SAML single sign-on for Enterprise Managed Users](/github/setting-up-and-managing-your-enterprise/managing-your-enterprise-users-with-your-identity-provider/configuring-saml-single-sign-on-for-enterprise-managed-users)."
Before you can configure provisioning for {% data variables.product.prodname_emus %}, you must configure SAML single-sign on. 更多信息请参阅“[为企业托管用户配置 SAML 单点登录](/github/setting-up-and-managing-your-enterprise/managing-your-enterprise-users-with-your-identity-provider/configuring-saml-single-sign-on-for-enterprise-managed-users)”。
## 创建个人访问令牌

View File

@@ -1,6 +1,6 @@
---
title: Creating an enterprise account
intro: 'If you''re currently using {% data variables.product.prodname_ghe_cloud %} with a single organization, you can create an enterprise account to centrally manage multiple organizations.'
title: 创建企业帐户
intro: '如果您当前在单个组织中使用 {% data variables.product.prodname_ghe_cloud %} ,则可以创建企业帐户来集中管理多个组织。'
versions:
ghec: '*'
type: how_to
@@ -9,40 +9,40 @@ topics:
- Enterprise
- Fundamentals
permissions: Organization owners can create an enterprise account.
shortTitle: Create enterprise account
shortTitle: 创建企业帐户
---
## About enterprise account creation
## 关于企业帐户创建
{% data variables.product.prodname_ghe_cloud %} includes the option to create an enterprise account, which enables collaboration between multiple organizations and gives administrators a single point of visibility and management. 更多信息请参阅“[关于企业帐户](/admin/overview/about-enterprise-accounts)”。
{% data variables.product.prodname_ghe_cloud %} 包括创建企业帐户的选项,该选项支持多个组织之间的协作,并为管理员提供单一的可见性和管理点。 更多信息请参阅“[关于企业帐户](/admin/overview/about-enterprise-accounts)”。
{% data reusables.enterprise.create-an-enterprise-account %} If you pay by invoice, you can create an enterprise account yourself on {% data variables.product.prodname_dotcom %}. If not, you can [contact our sales team](https://github.com/enterprise/contact?ref_page=/pricing&ref_cta=Contact%20Sales&ref_loc=cards) to move to invoicing.
{% data reusables.enterprise.create-an-enterprise-account %} 如果您通过发票付款,则可以在 {% data variables.product.prodname_dotcom %} 上自行创建企业帐户。 如果不是,您可以[联系我们的销售团队](https://github.com/enterprise/contact?ref_page=/pricing&ref_cta=Contact%20Sales&ref_loc=cards)转到发票。
An enterprise account is included in {% data variables.product.prodname_ghe_cloud %}, so creating one will not affect your bill.
企业帐户包含在 {% data variables.product.prodname_ghe_cloud %} 中,因此创建一个帐户不会影响您的帐单。
When you create an enterprise account, your existing organization will automatically be owned by the enterprise account. All current owners of your organization will become owners of the enterprise account. All current billing managers of the organization will become billing managers of the new enterprise account. The current billing details of the organization, including the organization's billing email address, will become billing details of the new enterprise account.
创建企业帐户时,现有组织将自动归企业帐户所有。 组织的所有当前所有者都将成为企业帐户的所有者。 组织的所有当前帐单管理员都将成为新企业帐户的帐单管理员。 组织的当前帐单详细信息(包括组织的帐单电子邮件地址)将成为新企业帐户的帐单详细信息。
## Creating an enterprise account on {% data variables.product.prodname_dotcom %}
## {% data variables.product.prodname_dotcom %} 上创建企业帐户
To create an enterprise account on {% data variables.product.prodname_dotcom %}, your organization must be using {% data variables.product.prodname_ghe_cloud %} and paying by invoice.
若要在 {% data variables.product.prodname_dotcom %} 上创建企业帐户,您的组织必须使用 {% data variables.product.prodname_ghe_cloud %} 并通过发票付款。
{% data reusables.organizations.billing-settings %}
1. Click **Upgrade to enterprise account**.
1. 单击 **Upgrade to enterprise account(升级到企业帐户)**
![Screenshot of the "Upgrade to an enterprise account" button](/assets/images/help/business-accounts/upgrade-to-enterprise-account.png)
1. Under "Enterprise name", type a name for your enterprise account.
!["升级到企业帐户" 按钮的屏幕截图](/assets/images/help/business-accounts/upgrade-to-enterprise-account.png)
1. 在“Enterprise name(企业名称)”下,键入企业帐户的名称。
![Screenshot of the "Enterprise name" field](/assets/images/help/business-accounts/enterprise-name-field.png)
1. Under "Enterprise URL slug", type a slug for your enterprise account. This slug will be used in the URL for your enterprise. For example, if you choose `octo-enterprise`, the URL for your enterprise will be `https://github.com/enterprises/octo-enterprise`.
!["企业名称" 字段的屏幕截图](/assets/images/help/business-accounts/enterprise-name-field.png)
1. 在“Enterprise URL slug(企业 URL 辅助信息域)”下,键入企业帐户的辅助信息。 此数据辅助信息将在企业的 URL 中使用。 例如,如果您选择 `octo-enterprise`,则企业的 URL 将为 `https://github.com/enterprises/octo-enterprise`
![Screenshot of the "Enterprise URL slug" field](/assets/images/help/business-accounts/enterprise-slug-field.png)
1. Click **Confirm and upgrade**.
!["企业 URL 辅助信息域" 字段的屏幕截图](/assets/images/help/business-accounts/enterprise-slug-field.png)
1. 单击 **Confirm and upgrade(确认并升级)**
![Screenshot of the "Confirm and upgrade" button](/assets/images/help/business-accounts/confirm-and-upgrade-button.png)
1. Read the warnings, then click **Create enterprise account**.
!["确认并升级" 按钮的屏幕截图](/assets/images/help/business-accounts/confirm-and-upgrade-button.png)
1. 阅读警告,然后单击 **Create enterprise account(创建企业帐户)**
![Screenshot of the "Create enterprise account" button](/assets/images/help/business-accounts/create-enterprise-account-button.png)
!["创建企业帐户" 按钮的屏幕截图](/assets/images/help/business-accounts/create-enterprise-account-button.png)
## 后续步骤
After your enterprise account is created, we recommend learning more about how enterprise accounts work and configuring settings and policies. For more information, follow the "[Get started with your enterprise account](/admin/guides#get-started-with-your-enterprise-account)" learning path.
创建企业帐户后,我们建议详细了解企业帐户的工作原理以及配置设置和策略。 有关详细信息,请遵循“[开始使用您的企业帐户](/admin/guides#get-started-with-your-enterprise-account)”学习路径。

View File

@@ -33,34 +33,44 @@ shortTitle: GitHub Actions policies
{% ifversion ghes %}If you enable {% data variables.product.prodname_actions %}, any{% else %}Any{% endif %} organization on {% data variables.product.product_location %} can use {% data variables.product.prodname_actions %}. You can enforce policies to control how members of your enterprise on {% data variables.product.product_name %} use {% data variables.product.prodname_actions %}. By default, organization owners can manage how members use {% data variables.product.prodname_actions %}. For more information, see "[Disabling or limiting {% data variables.product.prodname_actions %} for your organization](/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization)."
## Enforcing a policy to restrict the use of actions in your enterprise
## Enforcing a policy to restrict the use of {% data variables.product.prodname_actions %} in your enterprise
You can choose to disable {% data variables.product.prodname_actions %} for all organizations in your enterprise, or only allow specific organizations. You can also limit the use of public actions, so that people can only use local actions that exist in your enterprise.
You can choose to disable {% data variables.product.prodname_actions %} for all organizations in your enterprise, or only allow specific organizations. You can also limit the use of public actions {% if actions-workflow-policy %}and reusable workflows{% endif %}, so that people can only use local actions {% if actions-workflow-policy %}and reusable workflows{% endif %} that exist in your enterprise.
{% data reusables.enterprise-accounts.access-enterprise %}
{% data reusables.enterprise-accounts.policies-tab %}
{% data reusables.enterprise-accounts.actions-tab %}
{% data reusables.actions.enterprise-actions-permissions %}
1. Under "Policies", select your options.
{% indented_data_reference reusables.actions.actions-use-policy-settings spaces=3 %}
{%- ifversion ghes or ghae %}
{% note %}
**Note:** To enable access to public actions{% if actions-workflow-policy %} and reusable workflows{% endif %}, you must first configure {% data variables.product.product_location %} to connect to {% data variables.product.prodname_dotcom_the_website %}. For more information, see "[Enabling automatic access to GitHub.com actions using GitHub Connect](/admin/github-actions/enabling-automatic-access-to-githubcom-actions-using-github-connect)."
{% endnote %}
{%- endif %}
{% if actions-workflow-policy %}
![Enable, disable, or limits actions for this enterprise account](/assets/images/help/organizations/enterprise-actions-policy-with-workflows.png)
{%- else %}
![Enable, disable, or limits actions for this enterprise account](/assets/images/help/organizations/enterprise-actions-policy.png)
{%- endif %}
1. Click **Save**.
{% ifversion ghec or ghes or ghae %}
### Allowing select actions to run
{% data reusables.actions.allow-specific-actions-intro %}
{% data reusables.enterprise-accounts.access-enterprise %}
{% data reusables.enterprise-accounts.policies-tab %}
{% data reusables.enterprise-accounts.actions-tab %}
1. Under **Policies**, select **Allow select actions** and add your required actions to the list.
{%- ifversion ghes or ghae-issue-5094 %}
![Add actions to allow list](/assets/images/help/organizations/enterprise-actions-policy-allow-list.png)
1. Under "Policies", select {% data reusables.actions.policy-label-for-select-actions-workflows %} and add your required actions{% if actions-workflow-policy %} and reusable workflows{% endif %} to the list.
{% if actions-workflow-policy %}
![Add actions and reusable workflows to the allow list](/assets/images/help/organizations/enterprise-actions-policy-allow-list-with-workflows.png)
{%- elsif ghes or ghae-issue-5094 %}
![Add actions to the allow list](/assets/images/help/organizations/enterprise-actions-policy-allow-list.png)
{%- elsif ghae %}
![Add actions to allow list](/assets/images/enterprise/github-ae/enterprise-actions-policy-allow-list.png)
![Add actions to the allow list](/assets/images/enterprise/github-ae/enterprise-actions-policy-allow-list.png)
{%- endif %}
{% endif %}
{% ifversion ghec or ghes or ghae %}
## Enforcing a policy for artifact and log retention in your enterprise
@@ -73,8 +83,6 @@ You can choose to disable {% data variables.product.prodname_actions %} for all
{% data reusables.enterprise-accounts.actions-tab %}
{% data reusables.actions.change-retention-period-for-artifacts-logs %}
{% endif %}
## Enforcing a policy for fork pull requests in your enterprise
You can enforce policies to control how {% data variables.product.prodname_actions %} behaves for {% data variables.product.product_location %} when members of your enterprise{% ifversion ghec %} or outside collaborators{% endif %} run workflows from forks.
@@ -94,8 +102,6 @@ You can enforce policies to control how {% data variables.product.prodname_actio
{% endif %}
{% ifversion ghec or ghes or ghae %}
### Enforcing a policy for fork pull requests in private repositories
{% data reusables.actions.private-repository-forks-overview %}
@@ -109,8 +115,6 @@ If a policy is enabled for an enterprise, the policy can be selectively disabled
{% data reusables.enterprise-accounts.actions-tab %}
{% data reusables.actions.private-repository-forks-configure %}
{% endif %}
{% ifversion ghec or ghes > 3.1 or ghae %}
## Enforcing a policy for workflow permissions in your enterprise

View File

@@ -1,28 +1,28 @@
---
title: Removing organizations from your enterprise
intro: 'If an organization should no longer be a part of your enterprise, you can remove the organization.'
title: 从企业中删除组织
intro: 如果某个组织不应再成为企业的一部分,则可以删除该组织。
permissions: Enterprise owners can remove any organization from their enterprise.
versions:
ghec: '*'
type: how_to
topics:
- Enterprise
shortTitle: Removing organizations
shortTitle: 删除组织
---
{% warning %}
**Warning**: When you remove an organization from your enterprise:
- Billing, identity management, 2FA requirements, and other policies for the organization will no longer be governed by your enterprise.
- The organization will be downgraded to the free plan.
- The organization will be governed by our standard Terms of Service.
- Any internal repositories within the organization will be converted to private repositories.
**警告**:从企业中删除某个组织时:
- 该组织的计费、身份管理、2FA 要求和其他策略将不再受企业管理。
- 该组织将降级为免费计划。
- 该组织将受我们的标准服务条款的约束。
- 该组织内的任何内部存储库都将转换为私有存储库。
{% endwarning %}
## Removing an organization from your Enterprise
## 从企业中删除组织
{% data reusables.enterprise-accounts.access-enterprise %}
2. Under "Organizations", in the search bar, begin typing the organization's name until the organization appears in the search results. ![Screenshot of the search field for organizations](/assets/images/help/enterprises/organization-search.png)
3. To the right of the organization's name, select the {% octicon "gear" aria-label="The gear icon" %} drop-down menu and click **Remove organization**. ![Screenshot of an organization in search results](/assets/images/help/enterprises/remove-organization.png)
4. Review the warnings, then click **Remove organization**. ![Screenshot of a warning message and button to remove organization](/assets/images/help/enterprises/remove-organization-warning.png)
2. 在搜索栏中的“Organizations(组织)”下,开始键入组织的名称,直到该组织显示在搜索结果中。 ![组织的搜索字段屏幕截图](/assets/images/help/enterprises/organization-search.png)
3. 在组织名称的右侧,选择 {% octicon "gear" aria-label="The gear icon" %} 下拉菜单,然后单击 **Remove organization(删除组织)** ![搜索结果中组织的屏幕截图](/assets/images/help/enterprises/remove-organization.png)
4. 查看警告,然后单击 **Remove organization(删除组织)** ![用于删除组织的警告消息和按钮的屏幕截图](/assets/images/help/enterprises/remove-organization-warning.png)

View File

@@ -1,6 +1,6 @@
---
title: Impersonating a user
intro: 'You can impersonate users and perform actions on their behalf, for troubleshooting, unblocking, and other legitimate reasons.'
title: 模拟用户
intro: 您可以出于故障排除、取消阻止和其他合法原因而模拟用户并代表用户执行操作。
permissions: Enterprise owners can impersonate users within their enterprise.
versions:
ghes: '>3.2'
@@ -10,31 +10,31 @@ topics:
- Administrator
- Enterprise
- User account
shortTitle: Impersonate a user
shortTitle: 模拟用户
---
## About user impersonation
## 关于用户模拟
If you need to temporarily take over a user account, for example when troubleshooting a user problem, or when the user is unavailable and urgent action is required, you can start an impersonation session to act on their behalf.
如果需要临时接管用户帐户(例如,在解决用户问题时),或者在用户不可用且需要采取紧急操作时,可以启动模拟会话以代表他们执行操作。
For each impersonation session, you need to provide a reason for the impersonation. A session is limited to one hour, and you will have the same access as the user being impersonated.
对于每个模拟会话,您需要提供模拟的原因。 会话限制为一小时,您将拥有与被模拟用户相同的访问权限。
Actions you perform during an impersonation session are recorded as events in the enterprise audit log, as well as the impersonated user's security log. The person being impersonated is sent an email notification when the impersonation session starts. For more information, see "[Audited actions](/admin/user-management/monitoring-activity-in-your-enterprise/audited-actions)" and "[Reviewing your security log](/authentication/keeping-your-account-and-data-secure/reviewing-your-security-log)."
在模拟会话期间执行的操作将记录为企业审核日志以及模拟用户的安全日志中的事件。 当模拟会话开始时,被模拟的人员将收到电子邮件通知。 更多信息请参阅“[已审核的操作](/admin/user-management/monitoring-activity-in-your-enterprise/audited-actions)”和“[查看安全日志](/authentication/keeping-your-account-and-data-secure/reviewing-your-security-log)”。
## Impersonating a user
## 模拟用户
{% data reusables.enterprise_site_admin_settings.access-settings %}
{% data reusables.enterprise_site_admin_settings.search-user %}
{% data reusables.enterprise_site_admin_settings.click-user %}
4. In the top left of the page, click **User info**.
4. 在页面的左上角,单击 **User info(用户信息)**
![User info](/assets/images/enterprise/stafftools/user-info.png)
5. Under "Danger Zone", click **Sign in to GitHub as @username**
![用户信息](/assets/images/enterprise/stafftools/user-info.png)
5. 在“Danger Zone(危险区域)”下,单击 **登录到 GitHub as @username**
![Impersonate user](/assets/images/enterprise/stafftools/impersonate.png)
6. Select a reason from the dropdown list. If you select **Other** you will need to provide additional context in the **Notes** section. Click **Begin impersonation** to begin the session.
![模拟用户](/assets/images/enterprise/stafftools/impersonate.png)
6. 从下拉列表中选择一个原因。 如果选择 **Other(其他)**,则需要在 **Notes注释**部分提供其他上下文。 单击 **Begin impersonation开始模拟**以开始会话。
![Impersonation reason](/assets/images/enterprise/stafftools/impersonation-reason.png)
7. When you are ready to end the impersonation session, click the **Return to your mundane life as username** banner at the top of the page.
![模拟的原因](/assets/images/enterprise/stafftools/impersonation-reason.png)
7. 当您准备好结束模拟会话时,请单击页面顶部的 **Return to your mundane life as username(以用户名返回平凡生活)**横幅。
![End impersonation](/assets/images/enterprise/stafftools/end-impersonation.png)
![结束模拟](/assets/images/enterprise/stafftools/end-impersonation.png)

View File

@@ -236,16 +236,16 @@ shortTitle: 安全日志
### `user` 类操作
| 操作 | 描述 |
| ----------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `add_email` | 当您 |
| {% ifversion not ghae %}[添加新电子邮件地址](/articles/changing-your-primary-email-address){% else %}添加新电子邮件地址{% endif %}时触发。{% ifversion fpt or ghec %} | |
| `codespaces_trusted_repo_access_granted` | 当您[允许为某个仓库创建的代码空间访问您的用户帐户拥有的其他仓库]时触发(/github/developing-online-with-codespaces/managing-access-and-security-for-codespaces)。 |
| `codespaces_trusted_repo_access_revoked` | 当您[禁止为某个仓库创建的代码空间访问您的用户帐户拥有的其他仓库]时触发(/github/developing-online-with-codespaces/managing-access-and-security-for-codespaces)。 |{% endif %}
| 操作 | 描述 |
| ----------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `add_email` | 当您 |
| {% ifversion not ghae %}[添加新电子邮件地址](/articles/changing-your-primary-email-address){% else %}添加新电子邮件地址{% endif %}时触发。{% ifversion fpt or ghec %} | |
| `codespaces_trusted_repo_access_granted` | Triggered when you [allow the codespaces you create for a repository to access other repositories owned by your user account](/github/developing-online-with-codespaces/managing-access-and-security-for-codespaces). |
| `codespaces_trusted_repo_access_revoked` | Triggered when you [disallow the codespaces you create for a repository to access other repositories owned by your user account](/github/developing-online-with-codespaces/managing-access-and-security-for-codespaces). |{% endif %}
| `create` | 在创建新帐户时触发。{% ifversion not ghae %}
| `change_password` | 当您更改密码时触发。 |
| `change_password` | 当您更改密码时触发。 |
| `forgot_password` | 在您要求[重置密码](/articles/how-can-i-reset-my-password)时触发。{% endif %}
| `hide_private_contributions_count` | 当您[在个人资料中隐藏私有贡献](/articles/publicizing-or-hiding-your-private-contributions-on-your-profile)时触发。 |
| `hide_private_contributions_count` | 当您[在个人资料中隐藏私有贡献](/articles/publicizing-or-hiding-your-private-contributions-on-your-profile)时触发。 |
| `login` | 当您登录到 {% data variables.product.product_location %} 时触发。{% ifversion ghes or ghae %}

View File

@@ -35,7 +35,7 @@ shortTitle: 查看 Actions 使用情况
{% data reusables.organizations.billing-settings %}
{% data reusables.dotcom_billing.actions-minutes %}
{% data reusables.dotcom_billing.actions-packages-storage %}
{% data reusables.dotcom_billing.actions-packages-report-download %}
{% data reusables.dotcom_billing.actions-packages-report-download-org-account %}
## 查看企业帐户的 {% data variables.product.prodname_actions %} 使用情况

View File

@@ -15,7 +15,7 @@ topics:
## {% data variables.product.prodname_codespaces %} 定价
{% data variables.product.prodname_codespaces %} 的使用将针对团队和企业计划中的所有帐户计费,并且不包括任何权利。 个人帐户目前不为 {% data variables.product.prodname_codespaces %} 使用付费。
{% data variables.product.prodname_codespaces %} usage is billed for all organization and enterprise accounts on {% data variables.product.prodname_team %} and {% data variables.product.prodname_enterprise %}, which do not include any free minutes or storage. Personal accounts are not currently billed for {% data variables.product.prodname_codespaces %} usage.
{% data variables.product.prodname_codespaces %} 使用按下表中的计量单位计费:
@@ -58,7 +58,7 @@ topics:
用户在创建代码空间时选择的计算机类型会影响该代码空间的每分钟费用,如上所示。
组织所有者可以创建策略来限制用户可用的计算机类型。 For more information, see "[Restricting access to machine types](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)."
组织所有者可以创建策略来限制用户可用的计算机类型。 更多信息请参阅“[限制对机器类型的访问](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)”。
## 如何处理复刻的存储库的计费

View File

@@ -19,7 +19,7 @@ topics:
{% data reusables.organizations.billing-settings %}
{% data reusables.dotcom_billing.codespaces-minutes %}
{% data reusables.dotcom_billing.codespaces-report-download %}
{% data reusables.dotcom_billing.actions-packages-report-download-org-account %}
## 查看企业帐户的 {% data variables.product.prodname_codespaces %} 使用情况
@@ -29,3 +29,5 @@ topics:
{% data reusables.enterprise-accounts.settings-tab %}
{% data reusables.enterprise-accounts.billing-tab %}
1. 在“{% data variables.product.prodname_codespaces %}”下,查看企业帐户中每个组织的使用详细信息。
{% data reusables.enterprise-accounts.actions-packages-report-download-enterprise-accounts %}

View File

@@ -34,7 +34,7 @@ shortTitle: 查看使用情况
{% data reusables.organizations.billing-settings %}
{% data reusables.dotcom_billing.packages-data %}
{% data reusables.dotcom_billing.actions-packages-storage %}
{% data reusables.dotcom_billing.actions-packages-report-download %}
{% data reusables.dotcom_billing.actions-packages-report-download-org-account %}
## 查看企业帐户的 {% data variables.product.prodname_registry %} 使用情况

View File

@@ -1,6 +1,6 @@
---
title: Managing licenses for Visual Studio subscriptions with GitHub Enterprise
shortTitle: Visual Studio & GitHub Enterprise
title: 管理包含 GitHub Enterprise 的 Visual Studio 订阅的许可证
shortTitle: Visual Studio GitHub Enterprise
intro: '{% data reusables.enterprise-accounts.vss-ghe-description %}'
versions:
ghec: '*'

View File

@@ -1,13 +1,13 @@
---
title: Setting up Visual Studio subscriptions with GitHub Enterprise
intro: 'Your team''s subscription to {% data variables.product.prodname_vs %} can also provide access to {% data variables.product.prodname_enterprise %}.'
intro: "Your team's subscription to {% data variables.product.prodname_vs %} can also provide access to {% data variables.product.prodname_enterprise %}."
versions:
ghec: '*'
type: how_to
topics:
- Enterprise
- Licensing
shortTitle: 设置
shortTitle: Set up
---
## About setup of {% data variables.product.prodname_vss_ghe %}
@@ -16,33 +16,35 @@ shortTitle: 设置
This guide shows you how your team can get {% data variables.product.prodname_vs %} subscribers licensed and started with {% data variables.product.prodname_enterprise %}.
If you prefer video, you can watch [Setting up your {% data variables.product.prodname_enterprise %} licenses with {% data variables.product.prodname_vs %} subscriptions](https://www.youtube.com/watch?v=P_zBgp_BE_I) on Microsoft Visual Studio's YouTube channel.
If you prefer video, you can watch [Setting up your {% data variables.product.prodname_enterprise %} licenses with {% data variables.product.prodname_vs %} subscriptions](https://www.youtube.com/watch?v=P_zBgp_BE_I) on
Microsoft Visual Studio's YouTube channel.
## Roles for {% data variables.product.prodname_vss_ghe %}
Before setting up {% data variables.product.prodname_vss_ghe %}, it's important to understand the roles for this combined offering.
| Role | 服务 | 描述 | 更多信息 |
|:----------------------- |:----------------------------------------------------- |:------------------------------------------------------------------------------------------------------------------------------------------- |:------------------------------------------------------------------------------------------------------------------------------------------ |
| **Subscriptions admin** | {% data variables.product.prodname_vs %} subscription | Person who assigns licenses for {% data variables.product.prodname_vs %} subscription | [Overview of admin responsibilities](https://docs.microsoft.com/en-us/visualstudio/subscriptions/admin-responsibilities) in Microsoft Docs |
| **Subscriber** | {% data variables.product.prodname_vs %} subscription | Person who uses a license for {% data variables.product.prodname_vs %} subscription | [Visual Studio Subscriptions documentation](https://docs.microsoft.com/en-us/visualstudio/subscriptions/) in Microsoft Docs |
| **企业所有者** | {% data variables.product.prodname_dotcom %} | Person who has a user account that's an administrator of an enterprise on {% data variables.product.product_location %} | "[企业中的角色](/admin/user-management/managing-users-in-your-enterprise/roles-in-an-enterprise#enterprise-owner)" |
| **Organization owner** | {% data variables.product.prodname_dotcom %} | Person who has a user account that's an owner of an organization in your team's enterprise on {% data variables.product.product_location %} | "[组织中的角色](/organizations/managing-peoples-access-to-your-organization-with-roles/roles-in-an-organization#organization-owners)" |
| **Enterprise member** | {% data variables.product.prodname_dotcom %} | Person who has a user account that's a member of an enterprise on {% data variables.product.product_location %} | "[企业中的角色](/admin/user-management/managing-users-in-your-enterprise/roles-in-an-enterprise#enterprise-members)" |
| Role | Service | Description | More information |
| :- | :- | :- | :- |
| **Subscriptions admin** | {% data variables.product.prodname_vs %} subscription | Person who assigns licenses for {% data variables.product.prodname_vs %} subscription | [Overview of admin responsibilities](https://docs.microsoft.com/en-us/visualstudio/subscriptions/admin-responsibilities) in Microsoft Docs |
| **Subscriber** | {% data variables.product.prodname_vs %} subscription | Person who uses a license for {% data variables.product.prodname_vs %} subscription | [Visual Studio Subscriptions documentation](https://docs.microsoft.com/en-us/visualstudio/subscriptions/) in Microsoft Docs |
| **Enterprise owner** | {% data variables.product.prodname_dotcom %} | Person who has a user account that's an administrator of an enterprise on {% data variables.product.product_location %} | "[Roles in an enterprise](/admin/user-management/managing-users-in-your-enterprise/roles-in-an-enterprise#enterprise-owner)" |
| **Organization owner** | {% data variables.product.prodname_dotcom %} | Person who has a user account that's an owner of an organization in your team's enterprise on {% data variables.product.product_location %} | "[Roles in an organization](/organizations/managing-peoples-access-to-your-organization-with-roles/roles-in-an-organization#organization-owners)" |
| **Enterprise member** | {% data variables.product.prodname_dotcom %} | Person who has a user account that's a member of an enterprise on {% data variables.product.product_location %} | "[Roles in an enterprise](/admin/user-management/managing-users-in-your-enterprise/roles-in-an-enterprise#enterprise-members)" |
## 基本要求
## Prerequisites
- Your team's {% data variables.product.prodname_vs %} subscription must include {% data variables.product.prodname_enterprise %}. For more information, see [{% data variables.product.prodname_vs %} Subscriptions and Benefits](https://visualstudio.microsoft.com/subscriptions/) on the {% data variables.product.prodname_vs %} website and [Overview of admin responsibilities](https://docs.microsoft.com/en-us/visualstudio/subscriptions/admin-responsibilities) in Microsoft Docs.
- Your team's {% data variables.product.prodname_vs %} subscription must include {% data variables.product.prodname_enterprise %}. For more information, see [{% data variables.product.prodname_vs %} Subscriptions and Benefits](https://visualstudio.microsoft.com/subscriptions/) on the {% data variables.product.prodname_vs %} website and
[Overview of admin responsibilities](https://docs.microsoft.com/en-us/visualstudio/subscriptions/admin-responsibilities) in Microsoft Docs.
- Your team must have an enterprise on {% data variables.product.product_location %}. If you're not sure whether your team has an enterprise, contact your {% data variables.product.prodname_dotcom %} administrator. If you're not sure who on your team is responsible for {% data variables.product.prodname_dotcom %}, contact {% data variables.contact.contact_enterprise_sales %}. For more information, see "[About enterprise accounts](/admin/overview/about-enterprise-accounts)."
- Your team must have an enterprise on {% data variables.product.product_location %}. If you're not sure whether your team has an enterprise, contact your {% data variables.product.prodname_dotcom %} administrator. If you're not sure who on your team is responsible for {% data variables.product.prodname_dotcom %}, contact {% data variables.contact.contact_enterprise_sales %}. 更多信息请参阅“[关于企业帐户](/admin/overview/about-enterprise-accounts)”。
## 设置 {% data variables.product.prodname_vss_ghe %}
## Setting up {% data variables.product.prodname_vss_ghe %}
To set up {% data variables.product.prodname_vss_ghe %}, members of your team must complete the following tasks.
One person may be able to complete the tasks because the person has all of the roles, but you may need to coordinate the tasks with multiple people. For more information, see "[Roles for {% data variables.product.prodname_vss_ghe %}](#roles-for-visual-studio-subscriptions-with-github-enterprise)."
1. An enterprise owner must create at least one organization in your enterprise on {% data variables.product.product_location %}. 更多信息请参阅“[将组织添加到企业](/admin/user-management/managing-organizations-in-your-enterprise/adding-organizations-to-your-enterprise)”。
1. An enterprise owner must create at least one organization in your enterprise on {% data variables.product.product_location %}. For more information, see "[Adding organizations to your enterprise](/admin/user-management/managing-organizations-in-your-enterprise/adding-organizations-to-your-enterprise)."
1. The subscription admin must assign a license for {% data variables.product.prodname_vs %} to a subscriber in {% data variables.product.prodname_vss_admin_portal_with_url %}. For more information, see [Overview of the {% data variables.product.prodname_vs %} Subscriptions Administrator Portal](https://docs.microsoft.com/en-us/visualstudio/subscriptions/using-admin-portal) and [Assign {% data variables.product.prodname_vs %} Licenses in the {% data variables.product.prodname_vs %} Subscriptions Administration Portal](https://docs.microsoft.com/en-us/visualstudio/subscriptions/assign-license) in Microsoft Docs.
@@ -50,20 +52,20 @@ One person may be able to complete the tasks because the person has all of the r
1. If the subscription admin has not disabled email notifications, the subscriber will receive two confirmation emails. For more information, see [{% data variables.product.prodname_vs %} subscriptions with {% data variables.product.prodname_enterprise %}](https://docs.microsoft.com/en-us/visualstudio/subscriptions/access-github#what-is-the-visual-studio-subscription-with-github-enterprise-setup-process) in Microsoft Docs.
1. An organization owner must invite the subscriber to the organization on {% data variables.product.product_location %} from step 1. 订阅者可以使用 {% data variables.product.prodname_dotcom_the_website %} 上的现有用户帐户或创建一个新帐户来接受邀请。 After the subscriber joins the organization, the subscriber becomes an enterprise member. 更多信息请参阅“[邀请用户加入组织](/organizations/managing-membership-in-your-organization/inviting-users-to-join-your-organization)”。
1. An organization owner must invite the subscriber to the organization on {% data variables.product.product_location %} from step 1. The subscriber can accept the invitation with an existing user account on {% data variables.product.prodname_dotcom_the_website %} or create a new account. After the subscriber joins the organization, the subscriber becomes an enterprise member. For more information, see "[Inviting users to join your organization](/organizations/managing-membership-in-your-organization/inviting-users-to-join-your-organization)."
{% tip %}
**提示**
**Tips**:
- While not required, we recommend that the organization owner sends an invitation to the same email address used for the subscriber's User Primary Name (UPN). When the email address on {% data variables.product.product_location %} matches the subscriber's UPN, you can ensure that another enterprise does not claim the subscriber's license.
- If the subscriber accepts the invitation to the organization with an existing user account on {% data variables.product.product_location %}, we recommend that the subscriber add the email address they use for {% data variables.product.prodname_vs %} to their user account on {% data variables.product.product_location %}. 更多信息请参阅“[添加电子邮件地址到 {% data variables.product.prodname_dotcom %} 帐户](/account-and-profile/setting-up-and-managing-your-github-user-account/managing-email-preferences/adding-an-email-address-to-your-github-account)”。
- If the subscriber accepts the invitation to the organization with an existing user account on {% data variables.product.product_location %}, we recommend that the subscriber add the email address they use for {% data variables.product.prodname_vs %} to their user account on {% data variables.product.product_location %}. For more information, see "[Adding an email address to your {% data variables.product.prodname_dotcom %} account](/account-and-profile/setting-up-and-managing-your-github-user-account/managing-email-preferences/adding-an-email-address-to-your-github-account)."
- If the organization owner must invite a large number of subscribers, a script may make the process faster. For more information, see [the sample PowerShell script](https://github.com/github/platform-samples/blob/master/api/powershell/invite_members_to_org.ps1) in the `github/platform-samples` repository.
{% endtip %}
After {% data variables.product.prodname_vss_ghe %} is set up for subscribers on your team, enterprise owners can review licensing information on {% data variables.product.product_location %}. 更多信息请参阅"[查看企业帐户的订阅和使用](/billing/managing-billing-for-your-github-account/viewing-the-subscription-and-usage-for-your-enterprise-account)"
After {% data variables.product.prodname_vss_ghe %} is set up for subscribers on your team, enterprise owners can review licensing information on {% data variables.product.product_location %}. For more information, see "[Viewing the subscription and usage for your enterprise account](/billing/managing-billing-for-your-github-account/viewing-the-subscription-and-usage-for-your-enterprise-account)."
## 延伸阅读
## Further reading
- "[开始使用 {% data variables.product.prodname_ghe_cloud %}](/get-started/onboarding/getting-started-with-github-enterprise-cloud)"
- "[Getting started with {% data variables.product.prodname_ghe_cloud %}](/get-started/onboarding/getting-started-with-github-enterprise-cloud)"

View File

@@ -16,17 +16,16 @@ topics:
- Integration
- CI
---
You can set up {% data variables.product.prodname_codeql %} on {% data variables.product.prodname_actions %} or on an external CI system. {% data variables.product.prodname_codeql %} is fully compatible with {% data variables.product.prodname_dotcom %}-hosted runners on {% data variables.product.prodname_actions %}.
If you're using an external CI system, or self-hosted runners on {% data variables.product.prodname_actions %} for private repositories, you're responsible for configuring your own hardware. The optimal hardware configuration for running {% data variables.product.prodname_codeql %} may vary based on the size and complexity of your codebase, the programming languages and build systems being used, and your CI workflow setup.
The table below provides recommended hardware specifications for running {% data variables.product.prodname_codeql %} analysis, based on the size of your codebase. Use these as a starting point for determining your choice of hardware or virtual machine. A machine with greater resources may improve analysis performance, but may also be more expensive to maintain.
| Codebase size | RAM | CPU |
| ----------------------------------- | --------------- | ------------ |
| Small (<100 K lines of code) | 8 GB or higher | 2 cores |
| Codebase size | RAM | CPU |
|--------|--------|--------|
| Small (<100 K lines of code) | 8 GB or higher | 2 cores |
| Medium (100 K to 1 M lines of code) | 16 GB or higher | 4 or 8 cores |
| Large (>1 M lines of code) | 64 GB or higher | 8 cores |
| Large (>1 M lines of code) | 64 GB or higher | 8 cores |
For all codebase sizes, we recommend using an SSD with 14 GB or more of disk space. There must be enough disk space to check out and build your code, plus additional space for data produced by {% data variables.product.prodname_codeql %}.

View File

@@ -1,7 +1,7 @@
---
title: Tracking code scanning alerts in issues using task lists
shortTitle: Track alerts in issues
intro: You can add code scanning alerts to issues using task lists. This makes it easy to create a plan for development work that includes fixing alerts.
title: 使用任务列表跟踪问题中的代码扫描警报
shortTitle: 跟踪议题中的警报
intro: 您可以使用任务列表将代码扫描警报添加到议题中。 这样可以轻松创建包括修复警报在内的开发工作计划。
product: '{% data reusables.gated-features.code-scanning %}'
permissions: 'If you have write permission to a repository you can track {% data variables.product.prodname_code_scanning %} alerts in issues using task lists.'
versions:
@@ -17,72 +17,72 @@ topics:
{% data reusables.code-scanning.beta-alert-tracking-in-issues %}
## About tracking {% data variables.product.prodname_code_scanning %} alerts in issues
## 关于跟踪议题中的 {% data variables.product.prodname_code_scanning %} 警报
{% data reusables.code-scanning.github-issues-integration %}
You can also create a new issue to track an alert:
- From a {% data variables.product.prodname_code_scanning %} alert, which automatically adds the code scanning alert to a task list in the new issue. For more information, see "[Creating a tracking issue from a {% data variables.product.prodname_code_scanning %} alert](#creating-a-tracking-issue-from-a-code-scanning-alert)" below.
您还可以创建新议题来跟踪警报:
- {% data variables.product.prodname_code_scanning %} 警报创建,这会自动将代码扫描警报添加到新议题的任务列表中。 更多信息请参阅下面的“[ {% data variables.product.prodname_code_scanning %} 警报创建跟踪议题](#creating-a-tracking-issue-from-a-code-scanning-alert)”。
- Via the API as you normally would, and then provide the code scanning link within the body of the issue. You must use the task list syntax to create the tracked relationship:
- 像往常一样通过 API 创建,然后在议题正文中提供代码扫描链接。 您必须使用任务列表语法来创建跟踪关系:
- `- [ ] <full-URL- to-the-code-scanning-alert>`
- For example, if you add `- [ ] https://github.com/octocat-org/octocat-repo/security/code-scanning/17` to an issue, the issue will track the code scanning alert that has an ID number of 17 in the "Security" tab of the `octocat-repo` repository in the `octocat-org` organization.
- 例如,如果将 `- [ ] https://github.com/octocat-org/octocat-repo/security/code-scanning/17` 添加到议题中,则该议题将跟踪在 `octocat-org` 组织中 `octocat-repo` 存储库的“Security安全”选项卡中 ID 号为 17 的代码扫描警报。
You can use more than one issue to track the same {% data variables.product.prodname_code_scanning %} alert, and issues can belong to different repositories from the repository where the {% data variables.product.prodname_code_scanning %} alert was found.
您可以使用多个议题来跟踪同一 {% data variables.product.prodname_code_scanning %} 警报,并且议题可属于找到 {% data variables.product.prodname_code_scanning %} 警报的存储库中的不同存储库。
{% data variables.product.product_name %} provides visual cues in different locations of the user interface to indicate when you are tracking {% data variables.product.prodname_code_scanning %} alerts in issues.
{% data variables.product.product_name %} 在用户界面的不同位置提供视觉提示,以指示何时跟踪议题中的 {% data variables.product.prodname_code_scanning %} 警报。
- The code scanning alerts list page will show which alerts are tracked in issues so that you can view at a glance which alerts still require processing.
- 代码扫描警报列表页将显示在议题中跟踪的警报,以便您可以一目了然地查看哪些警报仍需要处理。
![Tracked in pill on code scanning alert page](/assets/images/help/repository/code-scanning-alert-list-tracked-issues.png)
![代码扫描警报页面上的跟踪片](/assets/images/help/repository/code-scanning-alert-list-tracked-issues.png)
- A "tracked in" section will also show in the corresponding alert page.
- tracked in(跟踪)”部分也会显示在相应的警报页面中。
{% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-6249 %}
![Tracked in section on code scanning alert page](/assets/images/help/repository/code-scanning-alert-tracked-in-pill.png)
![代码扫描警报页面上的跟踪部分](/assets/images/help/repository/code-scanning-alert-tracked-in-pill.png)
{% else %}
![Tracked in section on code scanning alert page](/assets/images/enterprise/3.4/repository/code-scanning-alert-tracked-in-pill.png)
![代码扫描警报页面上的跟踪部分](/assets/images/enterprise/3.4/repository/code-scanning-alert-tracked-in-pill.png)
{% endif %}
- On the tracking issue, {% data variables.product.prodname_dotcom %} displays a security badge icon in the task list and on the hovercard.
- 在跟踪议题上,{% data variables.product.prodname_dotcom %} 会在任务列表和悬停卡上显示安全徽章图标。
{% note %}
Only users with write permissions to the repository will see the unfurled URL to the alert in the issue, as well as the hovercard. For users with read permissions to the repository, or no permissions at all, the alert will appear as a plain URL.
只有对存储库具有写入权限的用户才能看到议题中警报的展开 URL 以及悬停卡片。 对于对存储库具有读取权限或根本没有权限的用户,警报将显示为纯 URL
{% endnote %}
The color of the icon is grey because an alert has a status of "open" or "closed" on every branch. The issue tracks an alert, so the alert cannot have a single open/closed state in the issue. If the alert is closed on one branch, the icon color will not change.
图标的颜色为灰色,因为警报在每个分支上的状态为“打开”或“关闭”。 议题跟踪警报,因此警报在议题中不能具有单个打开/关闭状态。 如果一个分支上的警报已关闭,则图标颜色不变。
![Hovercard in tracking issue](/assets/images/help/repository/code-scanning-tracking-issue-hovercard.png)
![跟踪议题中的悬停卡](/assets/images/help/repository/code-scanning-tracking-issue-hovercard.png)
The status of the tracked alert won't change if you change the checkbox state of the corresponding task list item (checked/unchecked) in the issue.
如果更改议题中相应任务列表项的复选框状态(选中/未选中),则跟踪的警报状态不会更改。
## Creating a tracking issue from a code scanning alert
## 从代码扫描警报创建跟踪议题
{% data reusables.repositories.navigate-to-repo %}
{% data reusables.repositories.sidebar-security %}
{% data reusables.repositories.sidebar-code-scanning-alerts %}
{% ifversion fpt or ghes or ghae %}
{% data reusables.code-scanning.explore-alert %}
1. Optionally, to find the alert to track, you can use the free-text search or the drop-down menus to filter and locate the alert. 更多信息请参阅“[管理仓库的代码扫描警报](/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/managing-code-scanning-alerts-for-your-repository#filtering-code-scanning-alerts)”。
1. (可选)若要查找要跟踪的警报,可以使用自由文本搜索或下拉菜单来筛选和定位警报。 更多信息请参阅“[管理仓库的代码扫描警报](/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/managing-code-scanning-alerts-for-your-repository#filtering-code-scanning-alerts)”。
{% endif %}
1. Towards the top of the page, on the right side, click **Create issue**.
1. 在页面顶部的右侧,单击 **Create issue(创建议题)**
{% ifversion fpt or ghec or ghes > 3.4 or ghae-issue-6249 %}
![Create a tracking issue for the code scanning alert](/assets/images/help/repository/code-scanning-create-issue-for-alert.png)
![为代码扫描警报创建跟踪议题](/assets/images/help/repository/code-scanning-create-issue-for-alert.png)
{% else %}
![Create a tracking issue for the code scanning alert](/assets/images/enterprise/3.4/repository/code-scanning-create-issue-for-alert.png)
![为代码扫描警报创建跟踪议题](/assets/images/enterprise/3.4/repository/code-scanning-create-issue-for-alert.png)
{% endif %}
{% data variables.product.prodname_dotcom %} automatically creates an issue to track the alert and adds the alert as a task list item.
{% data variables.product.prodname_dotcom %} prepopulates the issue:
- The title contains the name of the {% data variables.product.prodname_code_scanning %} alert.
- The body contains the task list item with the full URL to the {% data variables.product.prodname_code_scanning %} alert.
2. Optionally, edit the title and the body of the issue.
{% data variables.product.prodname_dotcom %} 会自动创建一个议题来跟踪警报,并将警报添加为任务列表项。
{% data variables.product.prodname_dotcom %} 会预填议题:
- 标题包含 {% data variables.product.prodname_code_scanning %} 警报的名称。
- 正文包含任务列表项,其中包含 {% data variables.product.prodname_code_scanning %} 警报的完整 URL。
2. (可选)编辑议题的标题和正文。
{% warning %}
**Warning:** You may want to edit the title of the issue as it may expose security information. You can also edit the body of the issue, but do not edit the task list item or the issue will no longer track the alert.
**警告:** 您可能需要编辑议题的标题,因为它可能会暴露安全信息。 您还可以编辑议题的正文,但不要编辑任务列表项,否则议题将不再跟踪警报。
{% endwarning %}
![New tracking issue for the code scanning alert](/assets/images/help/repository/code-scanning-new-tracking-issue.png)
3. Click **Submit new issue**.
![代码扫描警报的新跟踪议题](/assets/images/help/repository/code-scanning-new-tracking-issue.png)
3. 单击 **Submit new issue(提交新议题)**

View File

@@ -45,8 +45,8 @@ redirect_from:
依赖项审查支持与依赖关系图相同的语言和包管理生态系统。 更多信息请参阅“[关于依赖关系图](/github/visualizing-repository-data-with-graphs/about-the-dependency-graph#supported-package-ecosystems)”。
{% ifversion ghec or ghes or ghae %}
{% ifversion ghec or ghes %}
## 启用依赖项审查
启用依赖关系图时,依赖项审查功能可用。 {% ifversion ghec %}更多信息请参阅“[启用依赖关系图](/code-security/supply-chain-security/understanding-your-software-supply-chain/about-the-dependency-graph#enabling-the-dependency-graph)”。{% endif %}{% ifversion ghes or ghae %}更多信息请参阅“[为企业启用依赖关系图](/admin/code-security/managing-supply-chain-security-for-your-enterprise/enabling-the-dependency-graph-for-your-enterprise)”。{% endif %}
启用依赖关系图时,依赖项审查功能可用。 For more information, see "{% ifversion ghec %}[Enabling the dependency graph](/code-security/supply-chain-security/understanding-your-software-supply-chain/about-the-dependency-graph#enabling-the-dependency-graph){% elsif ghes %}[Enabling the dependency graph for your enterprise](/admin/code-security/managing-supply-chain-security-for-your-enterprise/enabling-the-dependency-graph-for-your-enterprise){% endif %}."
{% endif %}

View File

@@ -62,9 +62,9 @@ You can use the dependency graph to:
{% ifversion fpt or ghec %}To generate a dependency graph, {% data variables.product.product_name %} needs read-only access to the dependency manifest and lock files for a repository. The dependency graph is automatically generated for all public repositories and you can choose to enable it for private repositories. For information about enabling or disabling it for private repositories, see "[Exploring the dependencies of a repository](/github/visualizing-repository-data-with-graphs/exploring-the-dependencies-of-a-repository)."{% endif %}
{% ifversion ghes or ghae %}If the dependency graph is not available in your system, your enterprise owner can enable the dependency graph. For more information, see "[Enabling the dependency graph for your enterprise](/admin/code-security/managing-supply-chain-security-for-your-enterprise/enabling-the-dependency-graph-for-your-enterprise)."{% endif %}
{% ifversion ghes %}If the dependency graph is not available in your system, your enterprise owner can enable the dependency graph. For more information, see "[Enabling the dependency graph for your enterprise](/admin/code-security/managing-supply-chain-security-for-your-enterprise/enabling-the-dependency-graph-for-your-enterprise)."{% endif %}
When the dependency graph is first enabled, any manifest and lock files for supported ecosystems are parsed immediately. The graph is usually populated within minutes but this may take longer for repositories with many dependencies. Once enabled, the graph is automatically updated with every push to the repository{% ifversion fpt or ghec %} and every push to other repositories in the graph{% endif %}.
{% ifversion fpt or ghec or ghes %}When the dependency graph is first enabled, {% endif %}{% data variables.product.product_name %} immediately parses manifest and lock files for supported ecosystems. The graph is usually populated within minutes but this may take longer for repositories with many dependencies. Once enabled, the graph is automatically updated with every push to the repository{% ifversion fpt or ghec %} and every push to other repositories in the graph{% endif %}.
## Supported package ecosystems

View File

@@ -33,7 +33,7 @@ shortTitle: 探索依赖项
{% data reusables.repositories.click-dependency-graph %}{% ifversion fpt or ghec %}
4. (可选)在 "Dependency graph"(依赖关系图)下,单击 **Dependents依赖项**。 ![Dependents tab on the dependency graph page](/assets/images/help/graphs/dependency-graph-dependents-tab.png){% endif %}
{% ifversion ghes or ghae-issue-4864 %}
{% ifversion ghes %}
企业所有者可以在企业级别配置依赖关系图。 For more information, see "[Enabling the dependency graph for your enterprise](/admin/code-security/managing-supply-chain-security-for-your-enterprise/enabling-the-dependency-graph-for-your-enterprise)."
{% endif %}

View File

@@ -22,11 +22,11 @@ topics:
{% data reusables.codespaces.codespaces-machine-types %}
You can choose a machine type either when you create a codespace or you can change the machine type at any time after you've created a codespace.
You can choose a machine type either when you create a codespace or you can change the machine type at any time after you've created a codespace.
For information on choosing a machine type when you create a codespace, see "[Creating a codespace](/codespaces/developing-in-codespaces/creating-a-codespace#creating-a-codespace)." For information on changing the machine type within {% data variables.product.prodname_vscode %}, see "[Using {% data variables.product.prodname_codespaces %} in {% data variables.product.prodname_vscode %}](/codespaces/developing-in-codespaces/using-codespaces-in-visual-studio-code#changing-the-machine-type-in-visual-studio-code)."
## {% data variables.product.prodname_dotcom %} 中更改机器类型
## Changing the machine type in {% data variables.product.prodname_dotcom %}
{% data reusables.codespaces.your-codespaces-procedure-step %}
@@ -45,7 +45,7 @@ For information on choosing a machine type when you create a codespace, see "[Cr
{% data reusables.codespaces.codespaces-machine-type-availability %}
2. Click **Update codespace**.
2. Click **Update codespace**.
The change will take effect the next time your codespace restarts.
@@ -53,7 +53,7 @@ For information on choosing a machine type when you create a codespace, see "[Cr
If you change the machine type of a codespace you are currently using, and you want to apply the changes immediately, you can force the codespace to restart.
1. At the bottom left of your codespace window, click **{% data variables.product.prodname_codespaces %}**.
1. At the bottom left of your codespace window, click **{% data variables.product.prodname_codespaces %}**.
![Click '{% data variables.product.prodname_codespaces %}'](/assets/images/help/codespaces/codespaces-button.png)

View File

@@ -20,4 +20,7 @@ If you want to use {% data variables.product.prodname_vscode %} as your default
{% data reusables.user-settings.access_settings %}
{% data reusables.user-settings.codespaces-tab %}
1. Under "Editor preference", select the option you want. ![Setting your editor](/assets/images/help/codespaces/select-default-editor.png) If you choose **{% data variables.product.prodname_vscode %}**, {% data variables.product.prodname_codespaces %} will automatically open in the desktop application when you next create a codespace. You may need to allow access to both your browser and {% data variables.product.prodname_vscode %} for it to open successfully. ![Setting your editor](/assets/images/help/codespaces/launch-default-editor.png)
1. Under "Editor preference", select the option you want.
![Setting your editor](/assets/images/help/codespaces/select-default-editor.png)
If you choose **{% data variables.product.prodname_vscode %}**, {% data variables.product.prodname_codespaces %} will automatically open in the desktop application when you next create a codespace. You may need to allow access to both your browser and {% data variables.product.prodname_vscode %} for it to open successfully.
![Setting your editor](/assets/images/help/codespaces/launch-default-editor.png)

View File

@@ -1,6 +1,6 @@
---
title: Setting your default region for Codespaces
intro: 'You can set your default region in the {% data variables.product.prodname_github_codespaces %} profile settings page to personalize where your data is held.'
title: 设置 Codespaces 的默认区域
intro: '您可以在 {% data variables.product.prodname_github_codespaces %} 配置文件设置页面中设置默认地区,以个性化您的数据保存位置。'
product: '{% data reusables.gated-features.codespaces %}'
versions:
fpt: '*'
@@ -9,14 +9,14 @@ redirect_from:
- /codespaces/managing-your-codespaces/setting-your-default-region-for-codespaces
topics:
- Codespaces
shortTitle: Set the default region
shortTitle: 设置默认区域
---
You can manually select the region that your codespaces will be created in, allowing you to meet stringent security and compliance requirements. By default, your region is set automatically, based on your location.
您可以手动选择将在其中创建代码空间的区域,从而满足严格的安全性和合规性要求。 默认情况下,系统会根据您的位置自动设置您的区域。
## Setting your default region
## 设置默认区域
{% data reusables.user-settings.access_settings %}
{% data reusables.user-settings.codespaces-tab %}
1. Under "Region", select the setting you want.
2. If you chose "Set manually", select your region in the drop-down list. ![Selecting your region](/assets/images/help/codespaces/select-default-region.png)
1. 在“Region区域”下选择所需的设置。
2. 如果选择“Set manually手动设置请在下拉列表中选择您的区域。 ![选择您的区域](/assets/images/help/codespaces/select-default-region.png)

View File

@@ -1,45 +1,45 @@
---
title: Setting your timeout period for Codespaces
intro: 'You can set your default timeout for {% data variables.product.prodname_codespaces %} in your personal settings page.'
title: 设置 Codespaces 超时时间
intro: '您可以在个人设置页面中设置 {% data variables.product.prodname_codespaces %} 的默认超时。'
product: '{% data reusables.gated-features.codespaces %}'
versions:
fpt: '*'
ghec: '*'
topics:
- Codespaces
shortTitle: Set the timeout
shortTitle: 设置超时
---
A codespace will stop running after a period of inactivity. You can specify the length of this timeout period. The updated setting will apply to any newly created codespace.
代码空间将在一段时间不活动后停止运行。 您可以指定此超时期限的长度。 更新后的设置将应用于任何新创建的代码空间。
{% warning %}
**Warning**: Codespaces are billed per minute. If you are not actively using a codespace but the codespace has not yet timed out, you are still billed for the time that the codespace is running. For more information, see "[About billing for Codespaces](/billing/managing-billing-for-github-codespaces/about-billing-for-codespaces#codespaces-pricing)."
**警告**:代码空间按分钟计费。 如果您未主动使用代码空间,但代码空间尚未超时,则仍需为代码空间运行的时间付费。 更多信息请参阅“[关于代码空间的计费](/billing/managing-billing-for-github-codespaces/about-billing-for-codespaces#codespaces-pricing)”。
{% endwarning %}
{% webui %}
## Setting your default timeout
## 设置默认超时
{% data reusables.user-settings.access_settings %}
{% data reusables.user-settings.codespaces-tab %}
1. Under "Default idle timeout", enter the time that you want, then click **Save**. The time must be between 5 minutes and 240 minutes (4 hours). ![Selecting your timeout](/assets/images/help/codespaces/setting-default-timeout.png)
1. 在“Default idle timeout(默认空闲超时)”下,输入所需的时间,然后单击 **Save(保存)**。 时间必须在 5 分钟到 240 分钟4 小时)之间。 ![选择超时](/assets/images/help/codespaces/setting-default-timeout.png)
{% endwebui %}
{% cli %}
## Setting your timeout period
## 设置超时期限
{% data reusables.cli.cli-learn-more %}
To set the timeout period when you create a codespace, use the `idle-timeout` argument with the `codespace create` subcommand. Specify the time in minutes, followed by `m`. The time must be between 5 minutes and 240 minutes (4 hours).
要在创建代码空间时设置超时期限,请将 `idle-timeout` 参数与 `codespace create` 子命令结合使用。 指定时间(以分钟为单位),后跟 `m`。 时间必须在 5 分钟到 240 分钟4 小时)之间。
```shell
gh codespace create --idle-timeout 90m
```
If you don't specify a timeout period when you create a codespace, then the default timeout period will be used. For information about setting a default timeout period, click the "Web browser" tab on this page. You can't currently specify a default timeout period through {% data variables.product.prodname_cli %}.
如果在创建代码空间时未指定超时期限,则将使用默认超时期限。 有关设置默认超时期限的信息请单击此页面上的“Web browserWeb 浏览器)”选项卡。 您当前无法通过 {% data variables.product.prodname_cli %} 指定默认超时期限。
{% endcli %}

View File

@@ -1,6 +1,6 @@
---
title: 代码空间生命周期
intro: 'You can develop in a {% data variables.product.prodname_codespaces %} environment and maintain your data throughout the entire codespace lifecycle.'
intro: '您可以在 {% data variables.product.prodname_codespaces %} 环境中进行开发,并在整个代码空间生命周期中维护数据。'
versions:
fpt: '*'
ghec: '*'
@@ -11,39 +11,39 @@ topics:
product: '{% data reusables.gated-features.codespaces %}'
---
## About the lifecycle of a codespace
## 关于代码空间的生命周期
The lifecycle of a codespace begins when you create a codespace and ends when you delete it. You can disconnect and reconnect to an active codespace without affecting its running processes. You may stop and restart a codespace without losing changes that you have made to your project.
代码空间的生命周期从创建代码空间时开始,到删除代码空间时结束。 您可以断开连接并重新连接到活动代码空间,而不会影响其正在运行的进程。 您可以停止并重新启动代码空间,而不会丢失对项目所做的更改。
## 创建代码空间
When you want to work on a project, you can choose to create a new codespace or open an existing codespace. You might want to create a new codespace from a branch of your project each time you develop in {% data variables.product.prodname_codespaces %} or keep a long-running codespace for a feature.
当您要处理项目时,可以选择创建新代码空间或打开现有代码空间。 您可能希望每次在 {% data variables.product.prodname_codespaces %} 中开发时,都希望从项目的分支创建新的代码空间,或者为功能保留长时间运行的代码空间。
If you choose to create a new codespace each time you work on a project, you should regularly push your changes so that any new commits are on {% data variables.product.prodname_dotcom %}. You can have up to 10 codespaces at a time. Once you have 10 codespaces, you must delete a codespace before you can create a new one. 更多信息请参阅“[创建代码空间](/codespaces/developing-in-codespaces/creating-a-codespace)”。
如果选择在每次处理项目时都创建新的代码空间,则应定期推送更改,以便任何新提交都位于 {% data variables.product.prodname_dotcom %} 上。 一次最多可以有 10 个代码空间。 当您有了 10 个代码空间后,如要创建新代码空间,必须先删除一个代码空间。 更多信息请参阅“[创建代码空间](/codespaces/developing-in-codespaces/creating-a-codespace)”。
If you choose to use a long-running codespace for your project, you should pull from your repository's default branch each time you start working in your codespace so that your environment has the latest commits. This workflow is very similar to if you were working with a project on your local machine.
如果选择对项目使用长时间运行的代码空间,则每次开始在代码空间中工作时,都应从存储库的默认分支中提取代码空间,以便您的环境具有最新的提交。 此工作流程与在本地计算机上处理项目时非常相似。
{% data reusables.codespaces.prebuilds-crossreference %}
## Saving changes in a codespace
## 在代码空间中保存更改
When you connect to a codespace through the web, auto-save is enabled automatically for the web editor and configured to save changes after a delay. When you connect to a codespace through {% data variables.product.prodname_vscode %} running on your desktop, you must enable auto-save. For more information, see [Save/Auto Save](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save) in the {% data variables.product.prodname_vscode %} documentation.
当您通过 Web 连接到代码空间时,将自动为 Web 编辑器启用自动保存,并配置为在延迟后保存更改。 当您通过桌面上运行的 {% data variables.product.prodname_vscode %} 连接到代码空间时,必须启用自动保存。 更多信息请参阅 {% data variables.product.prodname_vscode %} 文档中的[保存/自动保存](https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save)
If you want to save your changes in the git repository on the codespace's file system, commit them and push them to a remote branch.
如果要将更改保存在代码空间文件系统上的 git 存储库中,请提交这些更改并将其推送到远程分支。
If you have unsaved changes, your editor will prompt you to save them before exiting.
如果您有未保存的更改,编辑器将在退出之前提示您保存这些更改。
## Codespaces timeouts
## 代码空间超时
If you leave your codespace running without interaction, or if you exit your codespace without explicitly stopping it, the codespace will timeout after a period of inactivity and stop running. By default, a codespace will timeout after 30 minutes of inactivity, but you can customize the duration of the timeout period for new codespaces that you create. For more information about setting the default timeout period for your codespaces, see "[Setting your timeout period for Codespaces](/codespaces/customizing-your-codespace/setting-your-timeout-period-for-codespaces)." For more information about stopping a codespace, see "[Stopping a codespace](#stopping-a-codespace)."
如果使代码空间在没有交互的情况下保持运行状态,或者退出代码空间而不显式停止它,则代码空间将在一段时间不活动后超时并停止运行。 默认情况下,代码空间将在处于非活动状态 30 分钟后超时,但您可以自定义所创建的新代码空间的超时期限的持续时间。 有关为代码空间设置默认超时期限的详细信息,请参阅“[为代码空间设置超时期限](/codespaces/customizing-your-codespace/setting-your-timeout-period-for-codespaces)”。 有关停止代码空间的详细信息,请参阅“[停止代码空间](#stopping-a-codespace)”。
When a codespace times out, your data is preserved from the last time your changes were saved. For more information, see "[Saving changes in a codespace](#saving-changes-in-a-codespace)."
当代码空间超时时,将保留上次保存更改时的数据。 更多信息请参阅“[在代码空间中保存更改](#saving-changes-in-a-codespace)”。
## 重建代码空间
You can rebuild your codespace to restore a clean state as if you had created a new codespace. For most uses, you can create a new codespace as an alternative to rebuilding a codespace. You are most likely to rebuild a codespace to implement changes to your dev container. When you rebuild a codespace, any Docker containers, images, volumes, and caches are cleaned, then the codespace is rebuilt.
您可以重新构建代码空间以还原干净状态,就像创建新代码空间一样。 对于大多数使用,可以创建新的代码空间作为重新构建代码空间的替代方法。 你最有可能重新构建代码空间来实施对开发容器的更改。 重新构建代码空间时,将清除所有 Docker 容器、映像、卷和缓存,然后重新构建代码空间。
If you need any of this data to persist over a rebuild, you can create, at the desired location in the container, a symbolic link (symlink) to the persistent directory. For example, in your `.devcontainer` directory, you can create a `config` directory that will be preserved across a rebuild. You can then symlink the `config` directory and its contents as a `postCreateCommand` in your `devcontainer.json` file.
如果需要在重新构建过程中保留任何此类数据,则可以在容器中的所需位置创建指向持久性目录的符号链接 (symlink)。 例如,在 `.devcontainer` 目录中,可以创建在重新构建过程中会保留的 `config` 目录。 然后,您可以将 `config` 目录及其内容作为 `postCreateCommand` `devcontainer.json` 文件进行符号链接。
```json
{
@@ -52,33 +52,33 @@ If you need any of this data to persist over a rebuild, you can create, at the d
}
```
In the example `postCreate.sh` file below, the contents of the `config` directory are symbolically linked to the home directory.
在下面的示例 `postCreate.sh` 文件中,`config` 目录的内容以符号链接到主目录。
```bash
#!/bin/bash
ln -sf $PWD/.devcontainer/config $HOME/config && set +x
```
## Stopping a codespace
## 停止代码空间
You can stop a codespace at any time. When you stop a codespace, any running processes are stopped and the terminal history is cleared. Any saved changes in your codespace will still be available when you next start it. If you do not explicitly stop a codespace, it will continue to run until it times out from inactivity. For more information, see "[Codespaces timeouts](#codespaces-timeouts)."
您可以随时停止代码空间。 停止代码空间时,将停止所有正在运行的进程并清除终端历史记录。 下次启动代码空间时,代码空间中的任何已保存更改仍将可用。 如果未明确停止代码空间,它将继续运行,直到它因非活动而超时。 更多信息请参阅“[代码空间超时](#codespaces-timeouts)”。
Only running codespaces incur CPU charges; a stopped codespace incurs only storage costs.
只有运行的代码空间才会产生 CPU 费用;停止的代码空间仅产生存储成本。
You may want to stop and restart a codespace to apply changes to it. For example, if you change the machine type used for your codespace, you will need to stop and restart it for the change to take effect. You can also stop your codespace and choose to restart or delete it if you encounter an error or something unexpected. 更多信息请参阅“[暂停或停止代码空间](/codespaces/codespaces-reference/using-the-command-palette-in-codespaces#suspending-or-stopping-a-codespace)”。
您可能希望停止并重新启动代码空间以对其应用更改。 例如,如果更改用于代码空间的计算机类型,则需要停止并重新启动它才能使更改生效。 您还可以停止代码空间,并在遇到错误或意外情况时选择重新启动或删除它。 更多信息请参阅“[暂停或停止代码空间](/codespaces/codespaces-reference/using-the-command-palette-in-codespaces#suspending-or-stopping-a-codespace)”。
## 删除代码空间
You can create a codespace for a particular task and then safely delete the codespace after you push your changes to a remote branch.
您可以为特定任务创建代码空间,然后在将更改推送到远程分支后安全地删除该代码空间。
If you try to delete a codespace with unpushed git commits, your editor will notify you that you have changes that have not been pushed to a remote branch. You can push any desired changes and then delete your codespace, or continue to delete your codespace and any uncommitted changes. You can also export your code to a new branch without creating a new codespace. For more information, see "[Exporting changes to a branch](/codespaces/troubleshooting/exporting-changes-to-a-branch)."
如果您尝试删除包含未填充 git 提交的代码空间,编辑器将通知您有尚未推送到远程分支的更改。 您可以推送任何所需的更改,然后删除代码空间,或继续删除代码空间和任何未提交的更改。 还可以将代码导出到新分支,而无需创建新的代码空间。 更多信息请参阅“[将更改导出到分支](/codespaces/troubleshooting/exporting-changes-to-a-branch)”。
You will be charged for the storage of all your codespaces. When you delete a codespace, you will no longer be charged.
您将需要支付所有代码空间的存储费用。 删除代码空间后,将不再向您收费。
For more information on deleting a codespace, see "[Deleting a codespace](/codespaces/developing-in-codespaces/deleting-a-codespace)."
有关删除代码空间的详细信息,请参阅“[删除代码空间](/codespaces/developing-in-codespaces/deleting-a-codespace)”。
## Losing the connection while using Codespaces
## 使用代码空间时丢失连接
{% data variables.product.prodname_codespaces %} is a cloud-based development environment and requires an internet connection. If you lose connection to the internet while working in a codespace, you will not be able to access your codespace. However, any uncommitted changes will be saved. When you have access to an internet connection again, you can connect to your codespace in the exact same state that it was left in. If you have an unstable internet connection, you should commit and push your changes often.
{% data variables.product.prodname_codespaces %} 是一个基于云的开发环境,需要连接互联网。 如果您在代码空间中工作时失去互联网连接,您将无法访问代码空间。 但是,任何未提交的更改将保存。 当您再次接入互联网时,可以按离开时完全相同的状态连接到代码空间。 如果您的互联网连接不稳定,则应经常提交并推送更改。
If you know that you will often be working offline, you can use your `devcontainer.json` file with the ["{% data variables.product.prodname_vscode %} Remote - Containers" extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) to build and attach to a local development container for your repository. For more information, see [Developing inside a container](https://code.visualstudio.com/docs/remote/containers) in the {% data variables.product.prodname_vscode %} documentation.
如果您知道自己经常脱机工作,则可以使用扩展名为 ["{% data variables.product.prodname_vscode %} Remote - Containers"](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) 的 `devcontainer.json` 文件,以构建并附加到存储库的本地开发容器。 更多信息请参阅 {% data variables.product.prodname_vscode %} 文档中的[在容器内开发](https://code.visualstudio.com/docs/remote/containers)。

View File

@@ -1,6 +1,6 @@
---
title: Connecting to a private network
intro: 'You can connect {% data variables.product.prodname_codespaces %} to resources on a private network, including package registries, license servers, and on-premises databases.'
title: 连接到专用网络
intro: '可以将 {% data variables.product.prodname_codespaces %} 连接到专用网络上的资源,包括包注册表、许可证服务器和本地数据库。'
product: '{% data reusables.gated-features.codespaces %}'
versions:
fpt: '*'
@@ -12,34 +12,34 @@ topics:
- Developer
---
## About codespace networking
## 关于代码空间网络
By default, your codespaces have access to all resources on the public internet, including package managers, license servers, databases, and cloud platform APIs, but they have no access to resources on private networks.
默认情况下,您的代码空间有权访问公共 Internet 上的所有资源,包括包管理器、许可证服务器、数据库和云平台 API但它们无权访问专用网络上的资源。
## Connecting to resources on a private network
## 连接到专用网络上的资源
The currently supported method of accessing resources on a private network is to use a VPN. It is currently not recommended to allowlist codespaces IPs as this would allow all codespaces (both yours and those of other customers) access to the network protected resources.
当前支持的访问专用网络上资源的方法是使用 VPN。 目前不建议允许列表代码空间 IP因为这将允许所有代码空间包括您和其他客户的代码空间访问受保护的网络资源。
### Using a VPN to access resources behind a private network
### 使用 VPN 访问专用网络后面的资源
The easiest way to access resources behind a private network is to VPN into that network from within your codespace.
要访问专用网络后面的资源,最简单方法是从代码空间内通过 VPN 进入该网络。
We recommend VPN tools like [OpenVPN](https://openvpn.net/) to access resources on a private network. For more information, see "[Using the OpenVPN client from GitHub Codespaces](https://github.com/codespaces-contrib/codespaces-openvpn)."
我们建议使用 [OpenVPN](https://openvpn.net/) 等 VPN工具访问专用网络上的资源。 更多信息请参阅“[ GitHub Codespaces 使用 OpenVPN 客户端](https://github.com/codespaces-contrib/codespaces-openvpn)”。
There are also a number of third party solutions that, while not explicitly endorsed by {% data variables.product.prodname_dotcom %}, have provided examples of how to integrate with {% data variables.product.prodname_codespaces %}.
还有一些第三方解决方案虽然没有得到 {% data variables.product.prodname_dotcom %} 的明确认可,但提供了如何与 {% data variables.product.prodname_codespaces %} 集成的示例。
These third party solutions include:
这些第三方解决方案包括:
- [Tailscale](https://tailscale.com/kb/1160/github-codespaces/)
### Allowlisting private resources for codespaces
### 将代码空间的私有资源列入允许列表
While {% data variables.product.prodname_dotcom %} publishes IP ranges for several products on its Meta API, codespaces IPs are dynamically assigned, meaning your codespace is not guaranteed to have the same IP address day to day. We highly discourage users from allowlisting an entire IP range, as this would give overly broad access to all codespaces (including users not affiliated with your codespaces).
虽然 {% data variables.product.prodname_dotcom %} 在其 Meta API 上发布多个产品的 IP 范围,但代码空间 IP 是动态分配的,这意味着您的代码空间不能保证每天具有相同的 IP 地址。 我们强烈建议用户不要允许列出整个 IP 范围,因为这样用户能够过于宽泛地访问所有代码空间(包括与您的代码空间无关的用户)。
For more information about the Meta API, see "[Meta](/rest/reference/meta)."
有关 Meta API 的详细信息,请参阅“[ Meta](/rest/reference/meta)”。
## Restricting access to the public internet
## 限制对公共互联网的访问
At present, there is no way to restrict codespaces from accessing the public internet, or to restrict appropriately authenticated users from accessing a forwarded port.
目前,没有办法限制代码空间访问公共互联网,或者限制经过适当身份验证的用户访问转发端口。
For more information on how to secure your codespaces, see "[Security in Codespaces](/codespaces/codespaces-reference/security-in-codespaces)."
有关如何保护代码空间的详细信息,请参阅“[代码空间中的安全性](/codespaces/codespaces-reference/security-in-codespaces)”。

View File

@@ -1,9 +1,9 @@
---
title: Default environment variables for your codespace
title: 代码空间的默认环境变量
shortTitle: 默认环境变量
product: '{% data reusables.gated-features.codespaces %}'
permissions: '{% data reusables.codespaces.availability %}'
intro: '{% data variables.product.prodname_dotcom %} sets default environment variables for each codespace.'
intro: '{% data variables.product.prodname_dotcom %} 为每个代码空间设置默认环境变量。'
versions:
fpt: '*'
ghec: '*'
@@ -14,27 +14,27 @@ topics:
- Developer
---
## About default environment variables
## 关于默认环境变量
{% data variables.product.prodname_dotcom %} sets default environment variables for every codespace. Commands run in codespaces can create, read, and modify environment variables.
{% data variables.product.prodname_dotcom %} 为每个代码空间设置默认环境变量。 在代码空间中运行的命令可以创建、读取和修改环境变量。
{% note %}
**Note**: Environment variables are case-sensitive.
**注意**:环境变量区分大小写。
{% endnote %}
## List of default environment variables
## 默认环境变量列表
| 环境变量 | 描述 |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `CODESPACE_NAME` | The name of the codespace For example, `monalisa-github-hello-world-2f2fsdf2e` |
| `CODESPACES` | Always `true` while in a codespace |
| `GIT_COMMITTER_EMAIL` | The email for the "author" field of future `git` commits. |
| `GIT_COMMITTER_NAME` | The name for the "committer" field of future `git` commits. |
| `GITHUB_API_URL` | 返回 API URL。 For example, `{% data variables.product.api_url_code %}`. |
| `GITHUB_GRAPHQL_URL` | 返回 GraphQL API URL。 For example, `{% data variables.product.graphql_url_code %}`. |
| `GITHUB_REPOSITORY` | 所有者和仓库名称。 例如 `octocat/Hello-World` |
| `GITHUB_SERVER_URL` | 返回 {% data variables.product.product_name %} 服务器的 URL。 For example, `https://{% data variables.product.product_url %}`. |
| `GITHUB_TOKEN` | A signed auth token representing the user in the codespace. You can use this to make authenticated calls to the GitHub API. For more information, see "[Authentication](/codespaces/codespaces-reference/security-in-codespaces#authentication)." |
| `GITHUB_USER` | The name of the user that initiated the codespace. 例如 `octocat` |
| 环境变量 | 描述 |
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `CODESPACE_NAME` | 代码空间的名称,例如 `monalisa-github-hello-world-2f2fsdf2e` |
| `CODESPACES` | 在代码空间中始终为 `true` |
| `GIT_COMMITTER_EMAIL` | 未来 `git` 提交的“作者”字段的电子邮件。 |
| `GIT_COMMITTER_NAME` | 未来 `git` 提交的“提交者”字段的名称。 |
| `GITHUB_API_URL` | 返回 API URL。 例如 `{% data variables.product.api_url_code %}` |
| `GITHUB_GRAPHQL_URL` | 返回 GraphQL API URL。 例如 `{% data variables.product.graphql_url_code %}` |
| `GITHUB_REPOSITORY` | 所有者和仓库名称。 例如 `octocat/Hello-World`。 |
| `GITHUB_SERVER_URL` | 返回 {% data variables.product.product_name %} 服务器的 URL。 例如 `https://{% data variables.product.product_url %}` |
| `GITHUB_TOKEN` | 代表代码空间中用户的签名身份验证令牌。 您可以使用它对 GitHub API 进行经过身份验证的调用。 更多信息请参阅“[身份验证](/codespaces/codespaces-reference/security-in-codespaces#authentication)”。 |
| `GITHUB_USER` | 启动代码空间的用户的名称。 例如 `octocat` |

View File

@@ -37,7 +37,7 @@ topics:
您还可以限制可以使用 {% data variables.product.prodname_codespaces %} 的单个用户。 更多信息请参阅“[管理组织的用户权限](/codespaces/managing-codespaces-for-your-organization/managing-user-permissions-for-your-organization)”。
您可以限制可用于组织拥有的存储库的计算机类型选择。 这使您可以防止人们使用资源过多的计算机作为其代码空间。 For more information, see "[Restricting access to machine types](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)."
您可以限制可用于组织拥有的存储库的计算机类型选择。 这使您可以防止人们使用资源过多的计算机作为其代码空间。 更多信息请参阅“[限制对机器类型的访问](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)”。
## 删除未使用的代码空间

View File

@@ -1,7 +1,7 @@
---
title: Restricting access to machine types
shortTitle: Machine type access
intro: You can set constraints on the types of machines users can choose when they create codespaces in your organization.
title: 限制对计算机类型的访问
shortTitle: 计算机类型访问
intro: 您可以对用户在组织中创建代码空间时可以选择的计算机类型设置约束。
product: '{% data reusables.gated-features.codespaces %}'
permissions: 'To manage access to machine types for the repositories in an organization, you must be an organization owner.'
versions:
@@ -14,77 +14,77 @@ topics:
## 概览
Typically, when you create a codespace you are offered a choice of specifications for the machine that will run your codespace. You can choose the machine type that best suits your needs. 更多信息请参阅“[创建代码空间](/codespaces/developing-in-codespaces/creating-a-codespace#creating-a-codespace)”。 If you pay for using {% data variables.product.prodname_github_codespaces %} then your choice of machine type will affect how much your are billed. For more information about pricing, see "[About billing for Codespaces](/billing/managing-billing-for-github-codespaces/about-billing-for-codespaces)."
通常,在创建代码空间时,系统会为将运行代码空间的计算机提供一系列规范。 您可以选择最适合您需求的计算机类型。 更多信息请参阅“[创建代码空间](/codespaces/developing-in-codespaces/creating-a-codespace#creating-a-codespace)”。 如果您为使用 {% data variables.product.prodname_github_codespaces %} 付费,那么您选择的计算机类型将影响您的账单金额。 有关计价的更多信息,请参阅“[关于代码空间的计费](/billing/managing-billing-for-github-codespaces/about-billing-for-codespaces)”。
As an organization owner, you may want to configure constraints on the types of machine that are available. For example, if the work in your organization doesn't require significant compute power or storage space, you can remove the highly resourced machines from the list of options that people can choose from. You do this by defining one or more policies in the {% data variables.product.prodname_codespaces %} settings for your organization.
作为组织所有者,您可能希望对可用的计算机类型配置约束。 例如,如果组织中的工作不需要大量的计算能力或存储空间,则可以从用户可以选择的选项列表中删除资源丰富的计算机。 为此,您可以在组织的 {% data variables.product.prodname_codespaces %} 设置中定义一个或多个策略。
### Behavior when you set a machine type constraint
### 设置计算机类型约束时的行为
If there are existing codespaces that no longer conform to a policy you have defined, these codespaces will continue to operate until they time out. When the user attempts to resume the codespace they are shown a message telling them that the currenly selected machine type is no longer allowed for this organization and prompting them to choose an alternative machine type.
如果存在不再符合已定义的策略的现有代码空间,则这些代码空间将继续运行,直到超时。 当用户尝试恢复代码空间时,将显示一条消息,告知他们此组织不再允许当前选择的计算机类型,并提示他们选择备用计算机类型。
If you remove higher specification machine types that are required by the {% data variables.product.prodname_codespaces %} configuration for an individual repository in your organization, then it won't be possible to create a codespace for that repository. When someone attempts to create a codespace they will see a message telling them that there are no valid machine types available that meet the requirements of the repository's {% data variables.product.prodname_codespaces %} configuration.
如果删除组织中单个存储库的 {% data variables.product.prodname_codespaces %} 配置所需的更高规范的计算机类型,则无法为该存储库创建代码空间。 当有人尝试创建代码空间时,他们将看到一条消息,告诉他们没有有效的计算机类型可以满足存储库 {% data variables.product.prodname_codespaces %} 配置的要求。
{% note %}
**Note**: Anyone who can edit the `devcontainer.json` configuration file in a repository can set a minimum specification for machines that can be used for codespaces for that repository. For more information, see "[Setting a minimum specification for codespace machines](/codespaces/setting-up-your-project-for-codespaces/setting-a-minimum-specification-for-codespace-machines)."
**注意**:任何可以在存储库中编辑 `devcontainer.json` 配置文件的人都可以为计算机设置可用于该存储库代码空间的最低规范。 更多信息请参阅“[为代码空间计算机设置最低规范](/codespaces/setting-up-your-project-for-codespaces/setting-a-minimum-specification-for-codespace-machines)”。
{% endnote %}
If setting a policy for machine types prevents people from using {% data variables.product.prodname_codespaces %} for a particular repository there are two options:
如果为计算机类型设置策略会阻止用户对特定存储库使用 {% data variables.product.prodname_codespaces %} ,则有两种选择:
* You can adjust your policies to specifically remove the restrictions from the affected repository.
* Anyone who has a codespace that they can no longer access, because of the new policy, can export their codespace to a branch. This branch will contain all of their changes from the codespace. They can then open a new codespace on this branch with a compliant machine type or work on this branch locally. For more information, see "[Exporting changes to a branch](/codespaces/troubleshooting/exporting-changes-to-a-branch)."
* 您可以调整策略以专门从受影响的存储库中删除限制。
* 由于新策略,任何拥有无法再访问的代码空间的人都可以将其代码空间导出到分支。 此分支将包含它们从代码空间所做的所有更改。 然后,他们可以使用兼容的计算机类型在此分支上打开新的代码空间,或者在本地处理此分支。 更多信息请参阅“[将更改导出到分支](/codespaces/troubleshooting/exporting-changes-to-a-branch)”。
### Setting organization-wide and repository-specific policies
### 设置组织范围和存储库特定的策略
When you create a policy you choose whether it applies to all repositories in your organization, or only to specified repositories. If you set an organization-wide policy then any policies you set for individual repositories must fall within the restriction set at the organization level. Adding policies makes the choice of machine more, not less, restrictive.
创建策略时,您可以选择是将其应用于组织中的所有存储库,还是仅应用于指定的存储库。 如果设置了组织范围的策略,则为各个存储库设置的任何策略都必须在组织级别设置的限制范围内。 添加策略会使计算机的选择受到限制更多,而不是更少。
For example, you could create an organization-wide policy that restricts the machine types to either 2 or 4 cores. You can then set a policy for Repository A that restricts it to just 2-core machines. Setting a policy for Repository A that restricted it to machines with 2, 4, or 8 cores would result in a choice of 2-core and 4-core machines only, because the organization-wide policy prevents access to 8-core machines.
例如,您可以创建一个组织范围的策略,将计算机类型限制为 2 核或 4 核。 然后,您可以为存储库 A 设置一个策略,将其限制为仅 2 核计算机。 为存储库 A 设置策略以将其限制为具有 2、4 或 8 核的计算机将导致仅选择 2 核和 4 核计算机,因为组织范围的策略会阻止访问 8 核计算机。
If you add an organization-wide policy, you should set it to the largest choice of machine types that will be available for any repository in your organization. You can then add repository-specific policies to further restrict the choice.
如果添加组织范围的策略,则应将其设置为可用于组织中任何存储库的最大计算机类型选择范围。 然后,您可以添加特定于存储库的策略以进一步限制选择。
## Adding a policy to limit the available machine types
## 添加策略以限制可用的计算机类型
{% data reusables.profile.access_org %}
{% data reusables.profile.org_settings %}
1. In the "Code, planning, and automation" section of the sidebar, select **{% octicon "codespaces" aria-label="The codespaces icon" %} {% data variables.product.prodname_codespaces %}** then click **Policy**.
2. On the "Codespace policies" page, click **Create Policy**.
3. Enter a name for your new policy.
4. Click **Add constraint** and choose **Machine types**.
1. 在边栏的“Code, planning, and automation(代码、规划和自动化)”部分中,选择 **{% octicon "codespaces" aria-label="The codespaces icon" %}{% data variables.product.prodname_codespaces %}**,然后单击 **Policy(策略)**
2. 在“Codespace policies(代码空间策略)”页面上,单击 **Create Policy(创建策略)**
3. 输入新策略的名称。
4. 单击 **Add constraint(添加约束)** ,然后选择 **Machine types(计算机类型)**
![Add a constraint for machine types](/assets/images/help/codespaces/add-constraint-dropdown.png)
![为计算机类型添加约束](/assets/images/help/codespaces/add-constraint-dropdown.png)
5. Click {% octicon "pencil" aria-label="The edit icon" %} to edit the constraint, then clear the selection of any machine types that you don't want to be available.
5. 单击 {% octicon "pencil" aria-label="The edit icon" %} 以编辑约束,然后清除您不希望可用的任何计算机类型的选择。
![Edit the machine type constraint](/assets/images/help/codespaces/edit-machine-constraint.png)
![编辑计算机类型约束](/assets/images/help/codespaces/edit-machine-constraint.png)
6. In the "Change policy target" area, click the dropdown button.
7. Choose either **All repositories** or **Selected repositories** to determine which repositories this policy will apply to.
6. 在“Change policy target(更改策略目标)”区域中,单击下拉按钮。
7. 选择 **All repositories(所有存储库)** **Selected repositories(选定的存储库)**,以确定此策略将应用于哪些存储库。
8. 如果选择了 **Selected repositories所选仓库**
1. 单击 {% octicon "gear" aria-label="The settings icon" %}。
![Edit the settings for the policy](/assets/images/help/codespaces/policy-edit.png)
![编辑策略的设置](/assets/images/help/codespaces/policy-edit.png)
2. Select the repositories you want this policy to apply to.
3. At the bottom of the repository list, click **Select repositories**.
2. 选择要应用此策略的存储库。
3. 在存储库列表的底部,单击 **Select repositories(选择存储库)**
![Select repositories for this policy](/assets/images/help/codespaces/policy-select-repos.png)
![为此策略选择存储库](/assets/images/help/codespaces/policy-select-repos.png)
9. 单击 **Save保存**
## Editing a policy
## 编辑策略
1. Display the "Codespace policies" page. For more information, see "[Adding a policy to limit the available machine types](#adding-a-policy-to-limit-the-available-machine-types)."
1. Click the name of the policy you want to edit.
1. Make the required changes then click **Save**.
1. 显示“Codespace policies(代码空间策略)”页。 更多信息请参阅“[添加策略以限制可用计算机类型](#adding-a-policy-to-limit-the-available-machine-types)”。
1. 单击要编辑的策略的名称。
1. 进行所需的更改,然后单击 **Save(保存)**
## Deleting a policy
## 删除策略
1. Display the "Codespace policies" page. For more information, see "[Adding a policy to limit the available machine types](#adding-a-policy-to-limit-the-available-machine-types)."
1. Click the delete button to the right of the policy you want to delete.
1. 显示“Codespace policies(代码空间策略)”页。 更多信息请参阅“[添加策略以限制可用计算机类型](#adding-a-policy-to-limit-the-available-machine-types)”。
1. 单击要删除的策略右侧的删除按钮。
![The delete button for a policy](/assets/images/help/codespaces/policy-delete.png)
![策略的删除按钮](/assets/images/help/codespaces/policy-delete.png)
## 延伸阅读
- "[Managing spending limits for Codespaces](/billing/managing-billing-for-github-codespaces/managing-spending-limits-for-codespaces)"
- "[管理代码空间的支出限制](/billing/managing-billing-for-github-codespaces/managing-spending-limits-for-codespaces)"

View File

@@ -1,5 +1,5 @@
---
title: Introduction to dev containers
title: 开发容器简介
intro: '您可以使用 `devcontainer.json` 文件来定义仓库的 {% data variables.product.prodname_codespaces %} 环境。'
allowTitleToDifferFromFilename: true
permissions: People with write permissions to a repository can create or edit the codespace configuration.
@@ -23,9 +23,9 @@ product: '{% data reusables.gated-features.codespaces %}'
## 关于开发容器
开发容器是 {% data variables.product.prodname_codespaces %} 用于提供项目开发所需的工具和运行时的环境。 If your project does not already have a dev container defined, {% data variables.product.prodname_codespaces %} will use the default configuration, which contains many of the common tools that your team might need for development with your project. For more information, see "[Using the default configuration](#using-the-default-configuration)."
开发容器是 {% data variables.product.prodname_codespaces %} 用于提供项目开发所需的工具和运行时的环境。 如果您的项目尚未定义开发容器,{% data variables.product.prodname_codespaces %} 将使用默认配置,其中包含团队在使用项目进行开发时可能需要的许多常用工具。 更多信息请参阅“[使用默认配置](#using-the-default-configuration)”。
If you want all users of your project to have a consistent environment that is tailored to your project, you can add a dev container to your repository. You can use a predefined configuration to select a common configuration for various project types with the option to further customize your project or you can create your own custom configuration. For more information, see "[Using a predefined container configuration](#using-a-predefined-container-configuration)" and "[Creating a custom codespace configuration](#creating-a-custom-codespace-configuration)." 您选择的选项取决于用户在项目中取得成功可能需要使用的工具、运行时、依赖项和工作流程。
如果希望项目的所有用户都具有为项目量身定制的一致环境,则可以将开发容器添加到存储库。 您可以使用预定义的配置为各种项目类型选择通用配置,并选择进一步自定义项目,也可以创建自己的自定义配置。 更多信息请参阅“[使用预定义的容器配置](#using-a-predefined-container-configuration)”和“[创建自定义代码空间配置](#creating-a-custom-codespace-configuration)”。 您选择的选项取决于用户在项目中取得成功可能需要使用的工具、运行时、依赖项和工作流程。
{% data variables.product.prodname_codespaces %} 允许使用 `devcontainer.json` 文件针对每个项目和每个分支进行自定义。 此配置文件通过定义可包括框架、工具、扩展和端口转发的开发容器,确定任何人为仓库创建的每个新代码空间的环境。 Dockerfile 还可与 `.devcontainer` 文件夹中的 `devcontainer.json` 文件一起使用,以定义创建容器映像所需的所有要素。
@@ -86,27 +86,27 @@ FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-14
{% data reusables.codespaces.command-palette-container %}
1. 单击要使用的定义。 ![预定义容器定义列表](/assets/images/help/codespaces/predefined-container-definitions-list.png)
1. 按照提示自定义您的定义。 For more information on the options to customize your definition, see "[Adding additional features to your `devcontainer.json` file](#adding-additional-features-to-your-devcontainerjson-file)."
1. 按照提示自定义您的定义。 有关自定义定义的选项的详细信息,请参阅“[ `devcontainer.json` 文件添加其他功能](#adding-additional-features-to-your-devcontainerjson-file)”。
1. 单击 **OK确定**。 ![确定按钮](/assets/images/help/codespaces/prebuilt-container-ok-button.png)
1. 要应用更改,请在屏幕右下角单击 **Rebuild now立即重建**。 有关重建容器的更多信息,请参阅“[应用对配置的更改](#applying-changes-to-your-configuration)”。 !["Codespaces: Rebuild Container" in the {% data variables.product.prodname_vscode_command_palette %}](/assets/images/help/codespaces/rebuild-prompt.png)
1. 要应用更改,请在屏幕右下角单击 **Rebuild now立即重建**。 有关重建容器的更多信息,请参阅“[应用对配置的更改](#applying-changes-to-your-configuration)”。 ![{% data variables.product.prodname_vscode_command_palette %} 中的"Codespaces重新构建容器"](/assets/images/help/codespaces/rebuild-prompt.png)
### Adding additional features to your `devcontainer.json` file
### `devcontainer.json `文件添加其他功能
{% note %}
**Note:** This feature is in beta and subject to change.
**注意:**此功能处于测试阶段,可能会有所变化。
{% endnote %}
You can add features to your predefined container configuration to customize which tools are available and extend the functionality of your workspace without creating a custom codespace configuration. For example, you could use a predefined container configuration and add the {% data variables.product.prodname_cli %} as well. You can make these additional features available for your project by adding the features to your `devcontainer.json` file when you set up your container configuration.
您可以向预定义的容器配置中添加功能,以自定义可用的工具并扩展工作区的功能,而无需创建自定义代码空间配置。 例如,也可以使用预定义的容器配置并添加 {% data variables.product.prodname_cli %}。 在设置容器配置时,可以通过将这些功能添加到 `devcontainer.json` 文件,使这些附加功能可用于项目。
You can add some of the most common features by selecting them when configuring your predefined container. For more information on the available features, see the [script library](https://github.com/microsoft/vscode-dev-containers/tree/main/script-library#scripts) in the `vscode-dev-containers` repository.
您可以通过在配置预定义容器时选择一些最常用的功能来添加这些功能。 有关可用功能的详细信息,请参阅 `vscode-dev-containers` 存储库中的[脚本库](https://github.com/microsoft/vscode-dev-containers/tree/main/script-library#scripts)
![The select additional features menu during container configuration.](/assets/images/help/codespaces/select-additional-features.png)
![容器配置期间的选择其他功能菜单。](/assets/images/help/codespaces/select-additional-features.png)
You can also add or remove features outside of the **Add Development Container Configuration Files** workflow.
1. Access the Command Palette (`Shift + Command + P` / `Ctrl + Shift + P`), then start typing "configure". Select **Codespaces: Configure Devcontainer Features**. ![The Configure Devcontainer Features command in the command palette](/assets/images/help/codespaces/codespaces-configure-features.png)
2. Update your feature selections, then click **OK**. ![The select additional features menu during container configuration.](/assets/images/help/codespaces/select-additional-features.png)
还可以添加或删除**添加开发容器配置文件**工作流程之外的功能。
1. 访问命令面板 (`Shift + Command + P` / `Ctrl + Shift + P`),然后开始键入 "configure"。 选择 **Codespaces: Configure Devcontainer Features(代码空间:配置开发容器功能)** ![命令面板中的 Configure Devcontainer Features 命令](/assets/images/help/codespaces/codespaces-configure-features.png)
2. 更新您的功能选择,然后单击**确定**。 ![容器配置期间的选择其他功能菜单。](/assets/images/help/codespaces/select-additional-features.png)
1. 要应用更改,请在屏幕右下角单击 **Rebuild now立即重建**。 有关重建容器的更多信息,请参阅“[应用对配置的更改](#applying-changes-to-your-configuration)”。 ![命令面板中的"Codespaces重建容器"](/assets/images/help/codespaces/rebuild-prompt.png)
@@ -168,4 +168,4 @@ For more information about the available settings for `devcontainer.json`, see [
## 延伸阅读
- "[Prebuilding your codespaces](/codespaces/prebuilding-your-codespaces)"
- "[预构建代码空间](/codespaces/prebuilding-your-codespaces)"

View File

@@ -1,7 +1,7 @@
---
title: Setting a minimum specification for codespace machines
shortTitle: Set a minimum machine spec
intro: 'You can avoid under-resourced machine types being used for {% data variables.product.prodname_codespaces %} for your repository.'
title: 为代码空间计算机设置最低规范
shortTitle: 设置最低计算机规范
intro: '您可以避免资源不足的计算机类型用于存储库的 {% data variables.product.prodname_codespaces %}'
permissions: People with write permissions to a repository can create or edit the codespace configuration.
versions:
fpt: '*'
@@ -15,20 +15,20 @@ product: '{% data reusables.gated-features.codespaces %}'
## 概览
When you create a codespace for a repository you are typically offered a choice of available machine types. Each machine type has a different level of resources. For more information, see "[Changing the machine type for your codespace](/codespaces/customizing-your-codespace/changing-the-machine-type-for-your-codespace#about-machine-types)."
当您为存储库创建代码空间时,通常会为您提供一系列可用的计算机类型。 每种计算机类型都有不同级别的资源。 更多信息请参阅“[更改代码空间的计算机类型](/codespaces/customizing-your-codespace/changing-the-machine-type-for-your-codespace#about-machine-types)”。
If your project needs a certain level of compute power, you can configure {% data variables.product.prodname_github_codespaces %} so that only machine types that meet these requirements are available for people to select. You configure this in the `devcontainer.json` file.
如果项目需要一定程度的计算能力,则可以配置 {% data variables.product.prodname_github_codespaces %} 以便只有满足这些要求的计算机类型可供用户选择。 您可以在 `devcontainer.json` 文件中配置此参数。
{% note %}
**Important:** Access to some machine types may be restricted at the organization level. Typically this is done to prevent people choosing higher resourced machines that are billed at a higher rate. If your repository is affected by an organization-level policy for machine types you should make sure you don't set a minimum specification that would leave no available machine types for people to choose. For more information, see "[Restricting access to machine types](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)."
**重要提示:**在组织级别可能会限制对某些计算机类型的访问。 通常,这样做是为了防止人们选择以较高费率计费的资源较高的计算机。 如果您的存储库受到组织级计算机类型策略的影响,则应确保不要设置最低规范,因为该规范不会留下任何可用的计算机类型供人们选择。 更多信息请参阅“[限制对机器类型的访问](/codespaces/managing-codespaces-for-your-organization/restricting-access-to-machine-types)”。
{% endnote %}
## Setting a minimum machine specification
## 设置最低计算机规范
1. {% data variables.product.prodname_codespaces %} for your repository are configured in the `devcontainer.json` file. If your repository does not already contain a `devcontainer.json` file, add one now. See "[Add a dev container to your project](/free-pro-team@latest/codespaces/setting-up-your-project-for-codespaces/setting-up-your-project-for-codespaces)."
1. Edit the `devcontainer.json` file, adding a `hostRequirements` property such as this:
1. 存储库的 {% data variables.product.prodname_codespaces %} `devcontainer.json` 文件中配置。 如果您的存储库尚未包含 `devcontainer.json` 文件,请立即添加一个。 请参阅“[将开发容器添加到项目](/free-pro-team@latest/codespaces/setting-up-your-project-for-codespaces/setting-up-your-project-for-codespaces)”。
1. 编辑 `devcontainer.json` 文件,添加 `hostRequirements` 属性,如下所示:
```json{:copy}
"hostRequirements": {
@@ -38,16 +38,16 @@ If your project needs a certain level of compute power, you can configure {% dat
}
```
You can specify any or all of the options: `cpus`, `memory`, and `storage`.
您可以指定任意或所有选项:`cpus``memory` `storage`
To check the specifications of the {% data variables.product.prodname_codespaces %} machine types that are currently available for your repository, step through the process of creating a codespace until you see the choice of machine types. 更多信息请参阅“[创建代码空间](/codespaces/developing-in-codespaces/creating-a-codespace#creating-a-codespace)”。
要检查当前可用于存储库的 {% data variables.product.prodname_codespaces %} 计算机类型的规范,请逐步完成创建代码空间的过程,直到看到选择的计算机类型。 更多信息请参阅“[创建代码空间](/codespaces/developing-in-codespaces/creating-a-codespace#creating-a-codespace)”。
1. Save the file and commit your changes to the required branch of the repository.
1. 保存文件并将更改提交到存储库的所需分支。
Now when you create a codespace for that branch of the repository you will only be able to select machine types that match or exceed the resources you've specified.
现在,当您为存储库的该分支创建代码空间时,只能选择与指定资源匹配或超过您指定的资源的计算机类型。
![Dialog box showing a limited choice of machine types](/assets/images/help/codespaces/machine-types-limited-choice.png)
![显示有限计算机类型选择的对话框](/assets/images/help/codespaces/machine-types-limited-choice.png)
## 延伸阅读
- "[Introduction to dev containers](/codespaces/setting-up-your-project-for-codespaces/configuring-codespaces-for-your-project)"
- "[开发容器简介](/codespaces/setting-up-your-project-for-codespaces/configuring-codespaces-for-your-project)"

View File

@@ -1,8 +1,8 @@
---
title: Adding a dev container to your repository
shortTitle: Add a dev container to your repository
title: 将开发容器添加到存储库
shortTitle: 将开发容器添加到存储库
allowTitleToDifferFromFilename: true
intro: 'Get started with your Node.js, Python, .NET, or Java project in {% data variables.product.prodname_codespaces %} by creating a custom dev container.'
intro: '通过创建自定义开发容器,开始在 {% data variables.product.prodname_codespaces %} 中使用 Node.js、Python、.NET 或 Java 项目。'
product: '{% data reusables.gated-features.codespaces %}'
versions:
fpt: '*'

View File

@@ -12,10 +12,6 @@ topics:
要构建与 GitHub 集成的应用程序? 请注册我们的开发者计划! 无尽可能,享受点赞。 [立即注册](https://github.com/developer/register)
## 信息灵通
第一时间了解 API 变更,在[开发者博客](https://developer.github.com/changes/)中发布新功能之前抢先体验。
## 大显身手
构建自己的工具,与每天推送代码的平台无缝集成。
@@ -24,7 +20,6 @@ topics:
向 <a href="mailto:partnerships@github.com">partnerships@github.com</a> 发送电子邮件,请求开发者许可,以便根据 {% data variables.product.prodname_ghe_server %} 构建和测试应用程序。
## 有适用于 GitHub 的集成?
太棒了! 我们希望您加入计划。 以下是您可以使用的推广方式:</p>

View File

@@ -7,7 +7,7 @@ shortTitle: Docs versions
## About versions of {% data variables.product.prodname_docs %}
{% data variables.product.company_short %} offers different products for storing and collaborating on code. The product you use determines which features are available to you. 更多信息请参阅“[{% data variables.product.company_short %} 的产品](/get-started/learning-about-github/githubs-products)”。
{% data variables.product.company_short %} offers different products for storing and collaborating on code. The product you use determines which features are available to you. For more information, see "[{% data variables.product.company_short %}'s products](/get-started/learning-about-github/githubs-products)."
This website, {% data variables.product.prodname_docs %}, provides documentation for all of {% data variables.product.company_short %}'s products. If the content you're reading applies to more than one product, you can choose the version of the documentation that's relevant to you by selecting the product you're currently using.
@@ -35,7 +35,7 @@ In a wide browser window, there is no text that immediately follows the {% data
![Screenshot of the address bar and the {% data variables.product.prodname_dotcom_the_website %} header in a browser](/assets/images/help/docs/header-dotcom.png)
On {% data variables.product.prodname_dotcom_the_website %}, each account has its own plan. Each personal account has an associated plan that provides access to certain features, and each organization has a different associated plan. If your personal account is a member of an organization on {% data variables.product.prodname_dotcom_the_website %}, you may have access to different features when you use resources owned by that organization than when you use resources owned by your personal account. 更多信息请参阅“[{% data variables.product.prodname_dotcom %} 帐户的类型](/get-started/learning-about-github/types-of-github-accounts)”。
On {% data variables.product.prodname_dotcom_the_website %}, each account has its own plan. Each personal account has an associated plan that provides access to certain features, and each organization has a different associated plan. If your personal account is a member of an organization on {% data variables.product.prodname_dotcom_the_website %}, you may have access to different features when you use resources owned by that organization than when you use resources owned by your personal account. For more information, see "[Types of {% data variables.product.prodname_dotcom %} accounts](/get-started/learning-about-github/types-of-github-accounts)."
If you don't know whether an organization uses {% data variables.product.prodname_ghe_cloud %}, ask an organization owner. For more information, see "[Viewing people's roles in an organization](/account-and-profile/setting-up-and-managing-your-github-user-account/managing-your-membership-in-organizations/viewing-peoples-roles-in-an-organization)."

View File

@@ -12,7 +12,6 @@ redirect_from:
- /github/getting-started-with-github/github-for-mobile
- /github/getting-started-with-github/using-github/github-for-mobile
---
{% data reusables.mobile.ghes-release-phase %}
## About {% data variables.product.prodname_mobile %}

View File

@@ -1,34 +1,34 @@
---
title: Migrating GraphQL global node IDs
intro: Learn about the two global node ID formats and how to migrate from the legacy format to the new format.
title: 迁移 GraphQL 全局节点 ID
intro: 了解两种全局节点 ID 格式以及如何从旧格式迁移到新格式。
versions:
fpt: '*'
ghec: '*'
topics:
- API
shortTitle: Migrating global node IDs
shortTitle: 迁移全局节点 ID
---
## Background
## 背景
The {% data variables.product.product_name %} GraphQL API currently supports two types of global node ID formats. The legacy format will be deprecated and replaced with a new format. This guide shows you how to migrate to the new format, if necessary.
{% data variables.product.product_name %} GraphQL API 目前支持两种类型的全局节点 ID 格式。 旧格式将被弃用,并替换为新格式。 本指南介绍如何在必要时迁移到新格式。
By migrating to the new format, you ensure that the response times of your requests remain consistent and small. You also ensure that your application continues to work once the legacy IDs are fully deprecated.
通过迁移到新格式,可以确保请求的响应时间保持一致且较短。 您还可以确保在完全弃用旧 ID 后,应用程序继续工作。
To learn more about why the legacy global node ID format will be deprecated, see "[New global ID format coming to GraphQL](https://github.blog/2021-02-10-new-global-id-format-coming-to-graphql)."
要详细了解有关旧版全局节点 ID 格式将被弃用的原因,请参阅“[即将引入 GraphQL 的新全局 ID 格式](https://github.blog/2021-02-10-new-global-id-format-coming-to-graphql)”。
## Determining if you need to take action
## 确定是否需要采取措施
You only need to follow the migration steps if you store references to GraphQL global node IDs. These IDs correspond to the `id` field for any object in the schema. If you don't store any global node IDs, then you can continue to interact with the API with no change.
仅在存储对 GraphQL 全局节点 ID 的引用时,才需要遵循迁移步骤。 这些 ID 对应于架构中任何对象的 `id` 字段。 如果不存储任何全局节点 ID则可以继续与 API 交互,而不会发生任何更改。
Additionally, if you currently decode the legacy IDs to extract type information (for example, if you use the first two characters of `PR_kwDOAHz1OX4uYAah` to determine if the object is a pull request), your service will break since the format of the IDs has changed. You should migrate your service to treat these IDs as opaque strings. These IDs will be unique, therefore you can rely on them directly as references.
此外,如果当前对旧 ID 进行解码以提取类型信息(例如,如果使用 `PR_kwDOAHz1OX4uYAah` 的前两个字符来确定对象是否为拉取请求),则由于 ID 的格式已更改,您的服务将中断。 应迁移服务以将这些 ID 视为不透明字符串进行处理。 这些 ID 将是唯一的,因此您可以直接依赖它们作为引用。
## Migrating to the new global IDs
## 迁移到新的全局 ID
To facilitate migration to the new ID format, you can use the `X-Github-Next-Global-ID` header in your GraphQL API requests. The value of the `X-Github-Next-Global-ID` header can be `1` or `0`. Setting the value to `1` will force the response payload to always use the new ID format for any object that you requested the `id` field for. Setting the value to `0` will revert to default behavior, which is to show the legacy ID or new ID depending on the object creation date.
为了便于迁移到新的 ID 格式,您可以在 GraphQL API 请求中使用 `X-Github-Next-Global-ID` 标头。 `X-Github-Next-Global-ID` 标头的值可以是 `1` `0`。 将该值设置为 `1` 将强制响应负载始终对请求 `id` 字段的任何对象使用新的 ID 格式。 将值设置为 `0` 将恢复为默认行为,即根据对象创建日期显示旧 ID 或新 ID。
Here is an example request using cURL:
下面是一个使用 cURL 的示例请求:
```
$ curl \
@@ -38,13 +38,13 @@ $ curl \
-d '{ "query": "{ node(id: \"MDQ6VXNlcjM0MDczMDM=\") { id } }" }'
```
Even though the legacy ID `MDQ6VXNlcjM0MDczMDM=` was used in the query, the response will contain the new ID format:
即使查询中使用了旧 ID `MDQ6VXNlcjM0MDczMDM=`,响应也将包含新的 ID 格式:
```
{"data":{"node":{"id":"U_kgDOADP9xw"}}}
```
With the `X-Github-Next-Global-ID` header, you can find the new ID format for legacy IDs that you reference in your application. You can then update those references with the ID received in the response. You should update all references to legacy IDs and use the new ID format for any subsequent requests to the API. To perform bulk operations, you can use aliases to submit multiple node queries in one API call. For more information, see "[the GraphQL docs](https://graphql.org/learn/queries/#aliases)."
使用 `X-Github-Next-Global-ID` 标头,您可以找到在应用程序中引用的旧 ID 的新 ID 格式。 然后,您可以使用响应中收到的 ID 更新这些引用。 您应更新对旧版 ID 的所有引用,并对 API 的任何后续请求使用新的 ID 格式。 要执行批量操作,您可以使用别名在一次 API 调用中提交多个节点查询。 更多信息请参阅“[GraphQL 文档](https://graphql.org/learn/queries/#aliases)”。
You can also get the new ID for a collection of items. For example, if you wanted to get the new ID for the last 10 repositories in your organization, you could use a query like this:
您还可以为项目集合获取新 ID。 例如,如果要获取组织中最后 10 个存储库的新 ID则可以使用如下所示的查询
```
{
organization(login: "github") {
@@ -61,8 +61,8 @@ You can also get the new ID for a collection of items. For example, if you wante
}
```
Note that setting `X-Github-Next-Global-ID` to `1` will affect the return value of every `id` field in your query. This means that even when you submit a non-`node` query, you will get back the new format ID if you requested the `id` field.
请注意,将 `X-Github-Next-Global-ID` 设置为 `1` 将影响查询中每个 `id` 字段的返回值。 这意味着,即使您提交了非 `node` 查询,只要您请求了 `id` 字段,您也会取回新的格式 ID。
## 分享反馈
If you have any concerns about the rollout of this change impacting your app, please [contact {% data variables.product.product_name %}](https://support.github.com/contact) and include information such as your app name so that we can better assist you.
如果您对这个影响到您的应用的更改有任何顾虑, 请[联系 {% data variables.product.product_name %}](https://support.github.com/contact) 并包含诸如您的应用程序名称等信息,以便我们更好地帮助您。

View File

@@ -12,6 +12,7 @@ topics:
- Organizations
- Teams
shortTitle: 禁用或限制操作
miniTocMaxHeadingLevel: 3
---
{% data reusables.actions.enterprise-beta %}
@@ -23,13 +24,11 @@ shortTitle: 禁用或限制操作
您可以对组织中的所有仓库启用 {% data variables.product.prodname_actions %}。 {% data reusables.actions.enabled-actions-description %} 您可以对组织中的所有仓库禁用 {% data variables.product.prodname_actions %}。 {% data reusables.actions.disabled-actions-description %}
此外,您可以对组织中的所有仓库启用 {% data variables.product.prodname_actions %},但限制工作流程可以运行的操作。 {% data reusables.actions.enabled-local-github-actions %}
Alternatively, you can enable {% data variables.product.prodname_actions %} for all repositories in your organization but limit the actions {% if actions-workflow-policy %}and reusable workflows{% endif %} a workflow can run.
## 管理组织的 {% data variables.product.prodname_actions %} 权限
您可以禁用组织的所有工作流程,或者设置策略来配置哪些操作可用于组织中。
{% data reusables.actions.actions-use-policy-settings %}
You can choose to disable {% data variables.product.prodname_actions %} for all repositories in your organization, or only allow specific repositories. You can also limit the use of public actions{% if actions-workflow-policy %} and reusable workflows{% endif %}, so that people can only use local actions {% if actions-workflow-policy %}and reusable workflows{% endif %} that exist in your {% ifversion ghec or ghes or ghae %}enterprise{% else %}organization{% endif %}.
{% note %}
@@ -40,21 +39,30 @@ shortTitle: 禁用或限制操作
{% data reusables.profile.access_org %}
{% data reusables.profile.org_settings %}
{% data reusables.organizations.settings-sidebar-actions-general %}
1. **Policies策略**下,选择一个选项。 ![设置此组织的操作策略](/assets/images/help/organizations/actions-policy.png)
1. 单击 **Save保存**
1.Policies策略下,选择一个选项。
## 允许特定操作运行
{% indented_data_reference reusables.actions.actions-use-policy-settings spaces=3 %}
{% if actions-workflow-policy %}
![设置此组织的操作策略](/assets/images/help/organizations/actions-policy-with-workflows.png)
{%- else %}
![设置此组织的操作策略](/assets/images/help/organizations/actions-policy.png)
{%- endif %}
1. 单击 **Save保存**
{% data reusables.actions.allow-specific-actions-intro %}
{% data reusables.profile.access_org %}
{% data reusables.profile.org_settings %}
{% data reusables.organizations.settings-sidebar-actions-general %}
1. 在 **Policies(策略)**下,选择 **Allow select actions允许选择操作**并将所需操作添加到列表中。
{%- ifversion ghes %}
![添加操作到允许列表](/assets/images/help/organizations/actions-policy-allow-list.png)
1. Under "Policies", select {% data reusables.actions.policy-label-for-select-actions-workflows %} and add your required actions{% if actions-workflow-policy %} and reusable workflows{% endif %} to the list.
{% if actions-workflow-policy %}
![Add actions and reusable workflows to the allow list](/assets/images/help/organizations/actions-policy-allow-list-with-workflows.png)
{%- elsif ghes %}
![Add actions to the allow list](/assets/images/help/organizations/actions-policy-allow-list.png)
{%- else %}
![添加操作到允许列表](/assets/images/enterprise/github-ae/organizations/actions-policy-allow-list.png)
![Add actions to the allow list](/assets/images/enterprise/github-ae/organizations/actions-policy-allow-list.png)
{%- endif %}
1. 单击 **Save保存**

View File

@@ -20,9 +20,7 @@ redirect_from:
在组织内,您可以在组织、团队和存储库级别分配角色。 有关不同级别角色的更多信息,请参阅“[组织中的角色](/organizations/managing-peoples-access-to-your-organization-with-roles/roles-in-an-organization)”。
如果您的组织使用 {% data variables.product.prodname_ghe_cloud %},则通过创建最多三个自定义存储库角色,可以更精细地控制在存储库级别授予的权限。 自定义存储库角色是一组可配置的权限,具有您选择的自定义名称。 创建自定义角色后,对存储库具有管理员访问权限的任何人都可以将该角色分配给个人或团队。 更多信息请参阅“[管理个人对组织存储库的访问](/organizations/managing-access-to-your-organizations-repositories/managing-an-individuals-access-to-an-organization-repository)”和“[管理团队对组织存储库的访问](/organizations/managing-access-to-your-organizations-repositories/managing-team-access-to-an-organization-repository)”
{% data reusables.enterprise.link-to-ghec-trial %}
You can have more granular control over the permissions you grant at the repository level by creating up to three custom repository roles. 自定义存储库角色是一组可配置的权限,具有您选择的自定义名称。 创建自定义角色后,对存储库具有管理员访问权限的任何人都可以将该角色分配给个人或团队。 更多信息请参阅“[管理个人对组织存储库的访问](/organizations/managing-access-to-your-organizations-repositories/managing-an-individuals-access-to-an-organization-repository)”和“[管理团队对组织存储库的访问](/organizations/managing-access-to-your-organizations-repositories/managing-team-access-to-an-organization-repository)”
## 关于继承的角色
@@ -112,6 +110,14 @@ redirect_from:
要创建新的存储库角色,请向继承的角色添加权限并为自定义角色命名。
{% ifversion ghec %}
{% note %}
**Note:** Only organizations that use {% data variables.product.prodname_ghe_cloud %} can create custom repository roles. {% data reusables.enterprise.link-to-ghec-trial %}
{% endnote %}
{% endif %}
{% data reusables.profile.access_profile %}
{% data reusables.profile.access_org %}
{% data reusables.organizations.org_settings %}

View File

@@ -1,51 +1,51 @@
---
title: Troubleshooting identity and access management
intro: 'Review and resolve common troubleshooting errors for managing your organization''s SAML SSO, team synchronization, or identity provider (IdP) connection.'
title: 身份和访问管理疑难解答
intro: 查看并解决用于管理组织的 SAML SSO、团队同步或身份提供商 (IdP) 连接的常见故障排除错误。
versions:
ghec: '*'
topics:
- Organizations
- Teams
shortTitle: Troubleshooting access
shortTitle: 访问疑难解答
---
## Some users are not provisioned or deprovisioned by SCIM
## 某些用户未由 SCIM 预配或取消预配
When you encounter provisioning issues with users, we recommend that you check if the users are missing SCIM metadata.
遇到用户预配问题时,建议检查用户是否缺少 SCIM 元数据。
{% data reusables.scim.changes-should-come-from-idp %}
If an organization member has missing SCIM metadata, then you can re-provision SCIM for the user manually through your IdP.
如果组织成员缺少 SCIM 元数据,则可以通过 IdP 手动为用户重新配置 SCIM。
### Auditing users for missing SCIM metadata
### 审核用户是否缺少 SCIM 元数据
If you suspect or notice that any users are not provisioned or deprovisioned as expected, we recommend that you audit all users in your organization.
如果您怀疑或注意到任何用户未按预期进行预配或取消预配,我们建议您审核组织中的所有用户。
To check whether users have a SCIM identity (SCIM metadata) in their external identity, you can review SCIM metadata for one organization member at a time on {% data variables.product.prodname_dotcom %} or you can programatically check all organization members using the {% data variables.product.prodname_dotcom %} API.
要检查用户的外部身份中是否具有 SCIM 身份SCIM 元数据),您可以在 {% data variables.product.prodname_dotcom %} 上一次查看一个组织成员的 SCIM 元数据,也可以使用 {% data variables.product.prodname_dotcom %} API 以编程方式检查所有组织成员。
#### Auditing organization members on {% data variables.product.prodname_dotcom %}
#### 审核 {% data variables.product.prodname_dotcom %} 上的组织成员
As an organization owner, to confirm that SCIM metadata exists for a single organization member, visit this URL, replacing `<organization>` and `<username>`:
作为组织所有者,要确认单个组织成员是否存在 SCIM 元数据,请访问此 URL替换 `<organization>` `<username>`
> `https://github.com/orgs/<organization>/people/<username>/sso`
If the user's external identity includes SCIM metadata, the organization owner should see a SCIM identity section on that page. If their external identity does not include any SCIM metadata, the SCIM Identity section will not exist.
如果用户的外部标识包括 SCIM 元数据,则组织所有者应在该页面上看到 SCIM 标识部分。 如果其外部标识不包含任何 SCIM 元数据,则 SCIM 标识部分将不存在。
#### Auditing organization members through the {% data variables.product.prodname_dotcom %} API
#### 通过 {% data variables.product.prodname_dotcom %} API 审核组织成员
As an organization owner, you can also query the SCIM REST API or GraphQL to list all SCIM provisioned identities in an organization.
作为组织所有者,您还可以查询 SCIM REST API GraphQL 以列出组织中的所有 SCIM 预配置标识。
#### 使用 REST API
The SCIM REST API will only return data for users that have SCIM metadata populated under their external identities. We recommend you compare a list of SCIM provisioned identities with a list of all your organization members.
SCIM REST API 仅返回在其外部标识下填充了 SCIM 元数据的用户的数据。 我们建议您将 SCIM 预配置身份列表与组织所有成员的列表进行比较。
更多信息请参阅:
- "[List SCIM provisioned identities](/rest/reference/scim#list-scim-provisioned-identities)"
- "[List organization members](/rest/reference/orgs#list-organization-members)"
- "[列出 SCIM 预配标识](/rest/reference/scim#list-scim-provisioned-identities)"
- "[列出组织成员](/rest/reference/orgs#list-organization-members)"
#### Using GraphQL
#### 使用 GraphQL
This GraphQL query shows you the SAML `NameId`, the SCIM `UserName` and the {% data variables.product.prodname_dotcom %} username (`login`) for each user in the organization. To use this query, replace `ORG` with your organization name.
GraphQL 查询显示组织中每个用户的 SAML `NameId`SCIM `UserName` {% data variables.product.prodname_dotcom %} 用户名 (`login`)。 若使用此查询,请将 `ORG` 替换为您的组织名称。
```graphql
{
@@ -76,14 +76,14 @@ This GraphQL query shows you the SAML `NameId`, the SCIM `UserName` and the {% d
curl -X POST -H "Authorization: Bearer <personal access token>" -H "Content-Type: application/json" -d '{ "query": "{ organization(login: \"ORG\") { samlIdentityProvider { externalIdentities(first: 100) { pageInfo { endCursor startCursor hasNextPage } edges { cursor node { samlIdentity { nameId } scimIdentity {username} user { login } } } } } } }" }' https://api.github.com/graphql
```
For more information on using the GraphQL API, see:
- "[GraphQL guides](/graphql/guides)"
- "[GraphQL explorer](/graphql/overview/explorer)"
有关使用 GraphQL API 的更多信息,请参阅:
- "[GraphQL 指南](/graphql/guides)"
- "[GraphQL 浏览器](/graphql/overview/explorer)"
### Re-provisioning SCIM for users through your identity provider
### 通过身份提供商为用户重新预配 SCIM
You can re-provision SCIM for users manually through your IdP. For example, to resolve provisioning errors for Okta, in the Okta admin portal, you can unassign and reassign users to the {% data variables.product.prodname_dotcom %} app. This should trigger Okta to make an API call to populate the SCIM metadata for these users on {% data variables.product.prodname_dotcom %}. For more information, see "[Unassign users from applications](https://help.okta.com/en/prod/Content/Topics/users-groups-profiles/usgp-unassign-apps.htm)" or "[Assign users to applications](https://help.okta.com/en/prod/Content/Topics/users-groups-profiles/usgp-assign-apps.htm)" in the Okta documentation.
您可以通过 IdP 手动为用户重新预配 SCIM。 例如,要解决 Okta 的预配错误,可以在 Okta 管理门户中取消分配用户并将其重新分配给 {% data variables.product.prodname_dotcom %} 应用。 这应该会触发 Okta 进行 API 调用,以便在 {% data variables.product.prodname_dotcom %} 上为这些用户填充 SCIM 元数据。 更多信息请参阅 Okta 文档中的“[从应用程序取消分配用户](https://help.okta.com/en/prod/Content/Topics/users-groups-profiles/usgp-unassign-apps.htm)”或“[将用户分配到应用程序](https://help.okta.com/en/prod/Content/Topics/users-groups-profiles/usgp-assign-apps.htm)”。
To confirm that a user's SCIM identity is created, we recommend testing this process with a single organization member whom you have confirmed doesn't have a SCIM external identity. After manually updating the users in your IdP, you can check if the user's SCIM identity was created using the SCIM API or on {% data variables.product.prodname_dotcom %}. For more information, see "[Auditing users for missing SCIM metadata](#auditing-users-for-missing-scim-metadata)" or the REST API endpoint "[Get SCIM provisioning information for a user](/rest/reference/scim#get-scim-provisioning-information-for-a-user)."
要确认是否已创建用户的 SCIM 标识,我们建议您使用已确认没有 SCIM 外部标识的单个组织成员来测试此过程。 手动更新 IdP 中的用户后,您可以检查用户的 SCIM 身份是使用 SCIM API 创建的,还是在 {% data variables.product.prodname_dotcom %} 上创建的。 更多信息请参阅“[审核用户是否缺少 SCIM 元数据](#auditing-users-for-missing-scim-metadata)”或 REST API 端点“[获取用户的 SCIM 预配信息](/rest/reference/scim#get-scim-provisioning-information-for-a-user)”。
If re-provisioning SCIM for users doesn't help, please contact {% data variables.product.prodname_dotcom %} Support.
如果为用户重新预配 SCIM 不起作用,请联系 {% data variables.product.prodname_dotcom %} 支持。

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