Skip to content

Commit e9ae252

Browse files
docubotfrancisfuzz
andauthored
New translation batch for cn (#23340)
* Add crowdin translations * Run script/i18n/homogenize-frontmatter.js * Run script/i18n/lint-translation-files.js --check parsing * Run script/i18n/lint-translation-files.js --check rendering * run script/i18n/reset-known-broken-translation-files.js * Check in cn CSV report Co-authored-by: Francis <15894826+francisfuzz@users.noreply.github.com>
1 parent 9189b84 commit e9ae252

14 files changed

Lines changed: 608 additions & 622 deletions

File tree

translations/log/cn-resets.csv

Lines changed: 150 additions & 147 deletions
Large diffs are not rendered by default.

translations/zh-CN/content/actions/creating-actions/metadata-syntax-for-github-actions.md

Lines changed: 96 additions & 230 deletions
Large diffs are not rendered by default.

translations/zh-CN/content/actions/learn-github-actions/contexts.md

Lines changed: 160 additions & 145 deletions
Large diffs are not rendered by default.
Lines changed: 49 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: 环境变量
3-
intro: '{% data variables.product.prodname_dotcom %} 为每个 {% data variables.product.prodname_actions %} 工作流程运行设置默认环境变量。 您也可以在工作流程文件中设置自定义环境变量。'
2+
title: Environment variables
3+
intro: '{% data variables.product.prodname_dotcom %} sets default environment variables for each {% data variables.product.prodname_actions %} workflow run. You can also set custom environment variables in your workflow file.'
44
redirect_from:
55
- /github/automating-your-workflow-with-github-actions/using-environment-variables
66
- /actions/automating-your-workflow-with-github-actions/using-environment-variables
@@ -17,11 +17,11 @@ versions:
1717
{% data reusables.actions.enterprise-github-hosted-runners %}
1818
{% data reusables.actions.ae-beta %}
1919

20-
## 关于环境变量
20+
## About environment variables
2121

22-
{% data variables.product.prodname_dotcom %} 设置适用于工作流程运行中每个步骤的默认环境变量。 环境变量区分大小写。 在操作或步骤中运行的命令可以创建、读取和修改环境变量。
22+
{% data variables.product.prodname_dotcom %} sets default environment variables that are available to every step in a workflow run. Environment variables are case-sensitive. Commands run in actions or steps can create, read, and modify environment variables.
2323

24-
要设置自定义环境变量,您需要在工作流程文件中指定变量。 您可以使用 [`jobs.<job_id>.steps[*].env`](/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepsenv)[`jobs.<job_id>.env`](/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idenv) [`env`](/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#env) 关键字定义步骤、作业或整个工作流程的环境变量。 更多信息请参阅“[{% data variables.product.prodname_dotcom %} 的工作流程语法](/articles/workflow-syntax-for-github-actions/#jobsjob_idstepsenv)”。
24+
To set custom environment variables, you need to specify the variables in the workflow file. You can define environment variables for a step, job, or entire workflow using the [`jobs.<job_id>.steps[*].env`](/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idstepsenv), [`jobs.<job_id>.env`](/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#jobsjob_idenv), and [`env`](/github/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions#env) keywords. For more information, see "[Workflow syntax for {% data variables.product.prodname_dotcom %}](/articles/workflow-syntax-for-github-actions/#jobsjob_idstepsenv)."
2525

2626
{% raw %}
2727
```yaml
@@ -41,51 +41,61 @@ jobs:
4141
```
4242
{% endraw %}
4343
44-
要在工作流程文件中使用环境变量的值,您应该使用 [`env` 上下文](/actions/reference/context-and-expression-syntax-for-github-actions#env-context)。 如果要在运行器中使用环境变量的值,您可以使用运行器操作系统的正常方法来读取环境变量。
45-
46-
如果使用工作流程文件的 `run` 键从运行器操作系统中读取环境变量(如上例所示),则在作业发送到运行器后,该变量将在运行器操作系统中被替换。 对于工作流程文件的其他部分,必须使用 `env` 上下文来读取环境变量;这是因为工作流程键(例如 `if`)需要在发送到运行器之前,在工作流程处理过程中替换变量。
47-
48-
You can also use the `GITHUB_ENV` environment file to set an environment variable that the following steps in a job can use. The environment file can be used directly by an action or as a shell command in a workflow file using the `run` keyword. 更多信息请参阅“[{% data variables.product.prodname_actions %} 的工作流程命令](/actions/reference/workflow-commands-for-github-actions/#setting-an-environment-variable)”。
49-
50-
## 默认环境变量
51-
52-
强烈建议操作使用环境变量访问文件系统,而非使用硬编码的文件路径。 {% data variables.product.prodname_dotcom %} 设置供操作用于所有运行器环境中的环境变量。
53-
54-
| 环境变量 | 描述 |
55-
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
56-
| `CI` | 始终设置为 `true` |
57-
| `GITHUB_WORKFLOW` | 工作流程的名称。 |
58-
| `GITHUB_RUN_ID` | {% data reusables.github-actions.run_id_description %}
59-
| `GITHUB_RUN_NUMBER` | {% data reusables.github-actions.run_number_description %}
60-
| `GITHUB_JOB` | 当前作业的 [job_id](/actions/reference/workflow-syntax-for-github-actions#jobsjob_id) |
61-
| `GITHUB_ACTION` | 操作唯一的标识符 (`id`) |
62-
| `GITHUB_ACTION_PATH` | 您的操作所在的路径。 您可以使用此路径访问与操作位于同一仓库中的文件。 此变量仅在复合操作中才受支持。 |
63-
| `GITHUB_ACTIONS` | 当 {% data variables.product.prodname_actions %} 运行工作流程时,始终设置为 `true`。 您可以使用此变量来区分测试是在本地运行还是通过 {% data variables.product.prodname_actions %} 运行。 |
64-
| `GITHUB_ACTOR` | 发起工作流程的个人或应用程序的名称。 例如 `octocat`。 |
65-
| `GITHUB_REPOSITORY` | 所有者和仓库名称。 例如 `octocat/Hello-World` |
66-
| `GITHUB_EVENT_NAME` | 触发工作流程的 web 挂钩事件的名称。 |
67-
| `GITHUB_EVENT_PATH` | 具有完整 web 挂钩事件有效负载的文件路径。 例如 `/github/workflow/event.json` |
68-
| `GITHUB_WORKSPACE` | {% data variables.product.prodname_dotcom %} 工作空间目录路径,初始为空白。 例如 `/home/runner/work/my-repo-name/my-repo-name`[actions/checkout](https://github.com/actions/checkout) 操作将在此目录内检出文件,默认情况下是仓库的副本。 |
69-
| `GITHUB_SHA` | 触发工作流程的提交 SHA。 例如 `ffac537e6cbbf934b08745a378932722df287a53` |
70-
| `GITHUB_REF` | 触发工作流程的分支或标记参考。 例如 `refs/heads/feature-branch-1`。 如果分支或标记都不适用于事件类型,则变量不会存在。 |
44+
To use the value of an environment variable in a workflow file, you should use the [`env` context](/actions/reference/context-and-expression-syntax-for-github-actions#env-context). If you want to use the value of an environment variable inside a runner, you can use the runner operating system's normal method for reading environment variables.
45+
46+
If you use the workflow file's `run` key to read environment variables from within the runner operating system (as shown in the example above), the variable is substituted in the runner operating system after the job is sent to the runner. For other parts of a workflow file, you must use the `env` context to read environment variables; this is because workflow keys (such as `if`) require the variable to be substituted during workflow processing before it is sent to the runner.
47+
48+
You can also use the `GITHUB_ENV` environment file to set an environment variable that the following steps in a job can use. The environment file can be used directly by an action or as a shell command in a workflow file using the `run` keyword. For more information, see "[Workflow commands for {% data variables.product.prodname_actions %}](/actions/reference/workflow-commands-for-github-actions/#setting-an-environment-variable)."
49+
50+
## Default environment variables
51+
52+
We strongly recommend that actions use environment variables to access the filesystem rather than using hardcoded file paths. {% data variables.product.prodname_dotcom %} sets environment variables for actions to use in all runner environments.
53+
54+
| Environment variable | Description |
55+
| ---------------------|------------ |
56+
| `CI` | Always set to `true`. |
57+
| `GITHUB_WORKFLOW` | The name of the workflow. |
58+
| `GITHUB_RUN_ID` | {% data reusables.github-actions.run_id_description %} |
59+
| `GITHUB_RUN_NUMBER` | {% data reusables.github-actions.run_number_description %} |
60+
| `GITHUB_JOB` | The [job_id](/actions/reference/workflow-syntax-for-github-actions#jobsjob_id) of the current job. |
61+
| `GITHUB_ACTION` | The unique identifier (`id`) of the action. |
62+
| `GITHUB_ACTION_PATH` | The path where your action is located. You can use this path to access files located in the same repository as your action. This variable is only supported in composite actions. |
63+
| `GITHUB_ACTIONS` | Always set to `true` when {% data variables.product.prodname_actions %} is running the workflow. You can use this variable to differentiate when tests are being run locally or by {% data variables.product.prodname_actions %}.
64+
| `GITHUB_ACTOR` | The name of the person or app that initiated the workflow. For example, `octocat`. |
65+
| `GITHUB_REPOSITORY` | The owner and repository name. For example, `octocat/Hello-World`. |
66+
| `GITHUB_EVENT_NAME` | The name of the webhook event that triggered the workflow. |
67+
| `GITHUB_EVENT_PATH` | The path of the file with the complete webhook event payload. For example, `/github/workflow/event.json`. |
68+
| `GITHUB_WORKSPACE` | The {% data variables.product.prodname_dotcom %} workspace directory path, initially empty. For example, `/home/runner/work/my-repo-name/my-repo-name`. The [actions/checkout](https://github.com/actions/checkout) action will check out files, by default a copy of your repository, within this directory. |
69+
| `GITHUB_SHA` | The commit SHA that triggered the workflow. For example, `ffac537e6cbbf934b08745a378932722df287a53`. |
70+
| `GITHUB_REF` | The branch or tag ref that triggered the workflow. For example, `refs/heads/feature-branch-1`. If neither a branch or tag is available for the event type, the variable will not exist. |
7171
{%- ifversion fpt or ghec or ghes > 3.3 or ghae-issue-5338 %}
72-
| `GITHUB_REF_NAME` | {% data reusables.actions.ref_name-description %} | | `GITHUB_REF_PROTECTED` | {% data reusables.actions.ref_protected-description %} | | `GITHUB_REF_TYPE` | {% data reusables.actions.ref_type-description %}
72+
| `GITHUB_REF_NAME` | {% data reusables.actions.ref_name-description %} |
73+
| `GITHUB_REF_PROTECTED` | {% data reusables.actions.ref_protected-description %} |
74+
| `GITHUB_REF_TYPE` | {% data reusables.actions.ref_type-description %} |
7375
{%- endif %}
74-
| `GITHUB_HEAD_REF` | Only set for pull request events. 头部分支的名称。 | `GITHUB_BASE_REF` | Only set for pull request events. 基础分支的名称。 | `GITHUB_SERVER_URL`| Returns the URL of the {% data variables.product.product_name %} server. 例如: `https://{% data variables.product.product_url %}`。 | `GITHUB_API_URL` | Returns the API URL. 例如: `{% data variables.product.api_url_code %}`。 | `GITHUB_GRAPHQL_URL` | Returns the GraphQL API URL. 例如: `{% data variables.product.graphql_url_code %}`。 | `RUNNER_NAME` | {% data reusables.actions.runner-name-description %} | `RUNNER_OS` | {% data reusables.actions.runner-os-description %} | `RUNNER_TEMP` | {% data reusables.actions.runner-temp-directory-description %}
76+
| `GITHUB_HEAD_REF` | Only set for pull request events. The name of the head branch.
77+
| `GITHUB_BASE_REF` | Only set for pull request events. The name of the base branch.
78+
| `GITHUB_SERVER_URL`| Returns the URL of the {% data variables.product.product_name %} server. For example: `https://{% data variables.product.product_url %}`.
79+
| `GITHUB_API_URL` | Returns the API URL. For example: `{% data variables.product.api_url_code %}`.
80+
| `GITHUB_GRAPHQL_URL` | Returns the GraphQL API URL. For example: `{% data variables.product.graphql_url_code %}`.
81+
| `RUNNER_NAME` | {% data reusables.actions.runner-name-description %}
82+
| `RUNNER_OS` | {% data reusables.actions.runner-os-description %}{% if actions-runner-arch-envvars %}
83+
| `RUNNER_ARCH` | {% data reusables.actions.runner-arch-description %}{% endif %}
84+
| `RUNNER_TEMP` | {% data reusables.actions.runner-temp-directory-description %}
7585
{% ifversion not ghae %}| `RUNNER_TOOL_CACHE` | {% data reusables.actions.runner-tool-cache-description %}{% endif %}
7686

7787
{% tip %}
7888

79-
**注:**如果需要在作业中使用工作流程运行的 URL,您可以组合这些环境变量:`$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID`
89+
**Note:** If you need to use a workflow run's URL from within a job, you can combine these environment variables: `$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID`
8090

8191
{% endtip %}
8292

83-
### 确定何时使用默认环境变量或上下文
93+
### Determining when to use default environment variables or contexts
8494

8595
{% data reusables.github-actions.using-context-or-environment-variables %}
8696

87-
## 环境变量命名约定
97+
## Naming conventions for environment variables
8898

89-
设置自定义环境变量时,不能使用上面列出的前缀为 `GITHUB_` 的任何默认环境变量名称。 如果尝试重写其中一个默认环境变量的值,则会忽略赋值。
99+
When you set a custom environment variable, you cannot use any of the default environment variable names listed above with the prefix `GITHUB_`. If you attempt to override the value of one of these default environment variables, the assignment is ignored.
90100

91-
您设置的指向文件系统上某个位置的任何新环境变量都应该有 `_PATH` 后缀。 `HOME` `GITHUB_WORKSPACE` 默认变量例外于此约定,因为 "home" "workspace" 一词已经暗示位置。
101+
Any new environment variables you set that point to a location on the filesystem should have a `_PATH` suffix. The `HOME` and `GITHUB_WORKSPACE` default variables are exceptions to this convention because the words "home" and "workspace" already imply a location.

translations/zh-CN/content/admin/enterprise-management/updating-the-virtual-machine-and-physical-resources/increasing-cpu-or-memory-resources.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,36 @@ It's not possible to add CPU or memory resources to an existing AWS/EC2 instance
5454
3. Start the instance.
5555
{% data reusables.enterprise_installation.configuration-recognized %}
5656

57+
## Adding CPU or memory resources on Microsoft Azure
58+
59+
{% note %}
60+
61+
**Note:** To add CPU or memory resources in Microsoft Azure, you must be familiar with using either the Azure Portal, Azure CLI or Azure Powershell to manage VM instances. For background and details on using the Azure tools of your choice to perform the resize, please refer to the Azure documentation on [changing the size of a virtual machine](https://docs.microsoft.com/en-us/azure/virtual-machines/resize-vm).
62+
63+
{% endnote %}
64+
65+
### Resizing considerations
66+
67+
Before increasing CPU or memory resources for {% data variables.product.product_location %}, review the following recommendations.
68+
69+
- **Scale your memory with CPUs**. {% data reusables.enterprise_installation.increasing-cpus-req %}
70+
- **Assign a static IP address to the instance**. If you haven't assigned a static IP to your instance, you might have to adjust the DNS A records for your {% data variables.product.prodname_ghe_server %} host after the restart to account for the change in IP address.
71+
72+
### Supported Microsoft Azure instance sizes
73+
74+
You need to determine the instance size you would like to upgrade to based on CPU/memory specifications.
75+
76+
{% data reusables.enterprise_installation.warning-on-scaling %}
77+
78+
{% data reusables.enterprise_installation.azure-instance-recommendation %}
79+
80+
### Resizing for Microsoft Azure
81+
82+
You can scale the VM up by changing the VM size. Changing its size will cause it to be restarted. In some cases, you must deallocate the VM first. This can happen if the new size is not available on the hardware cluster that is currently hosting the VM.
83+
84+
1. Refer to the Azure documentation on [changing the size of a virtual machine](https://docs.microsoft.com/en-us/azure/virtual-machines/resize-vm) for the required steps.
85+
{% data reusables.enterprise_installation.configuration-recognized %}
86+
5787
## Adding CPU or memory resources for OpenStack KVM
5888

5989
It's not possible to add CPU or memory resources to an existing OpenStack KVM instance. Instead, you must:

0 commit comments

Comments
 (0)