@@ -16,6 +16,7 @@ translations/zh-CN/content/actions/hosting-your-own-runners/adding-self-hosted-r
|
||||
translations/zh-CN/content/actions/hosting-your-own-runners/monitoring-and-troubleshooting-self-hosted-runners.md,Listed in localization-support#489
|
||||
translations/zh-CN/content/actions/hosting-your-own-runners/monitoring-and-troubleshooting-self-hosted-runners.md,broken liquid tags
|
||||
translations/zh-CN/content/actions/learn-github-actions/usage-limits-billing-and-administration.md,broken liquid tags
|
||||
translations/zh-CN/content/actions/managing-workflow-runs/re-running-workflows-and-jobs.md,rendering error
|
||||
translations/zh-CN/content/actions/managing-workflow-runs/removing-workflow-artifacts.md,broken liquid tags
|
||||
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
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: 示例
|
||||
shortTitle: 示例
|
||||
intro: 'Example workflows that demonstrate the CI/CD features of {% data variables.product.prodname_actions %}.'
|
||||
intro: '演示 {% data variables.product.prodname_actions %} 的 CI/CD 功能的示例工作流程。'
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
|
||||
@@ -618,7 +618,7 @@ jobs:
|
||||
</td>
|
||||
<td>
|
||||
|
||||
This step uses the `actions/cache` action to cache the Next.js build, so that the workflow will attempt to retrieve a cache of the build, and not rebuild it from scratch every time. For more information, see "[Caching dependencies to speed up workflows](/actions/using-workflows/caching-dependencies-to-speed-up-workflows)."
|
||||
此步骤使用“actions/cache”操作来缓存 Next.js 构建,以便工作流程尝试检索构建的缓存,而不是每次都从头开始重新构建。 更多信息请参阅“[缓存依赖关系以加快工作流程](/actions/using-workflows/caching-dependencies-to-speed-up-workflows)”。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -631,7 +631,7 @@ This step uses the `actions/cache` action to cache the Next.js build, so that th
|
||||
</td>
|
||||
<td>
|
||||
|
||||
This step runs the build script.
|
||||
此步骤运行构建脚本。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -647,7 +647,7 @@ This step runs the build script.
|
||||
</td>
|
||||
<td>
|
||||
|
||||
This step runs the tests using `npm test`, and the test matrix provides a different value for {% raw %}`${{ matrix.test-group }}`{% endraw %} for each job in the matrix. It uses the `DIFF_FILE` environment variable to know which files have changed, and uses the `CHANGELOG_CACHE_FILE_PATH` environment variable for the changelog cache file.
|
||||
此步骤使用“npm test”运行测试,并且测试矩阵为矩阵中的每个作业提供不同的 {% raw %}`${{ matrix.test-group }}`{% endraw %} 值。 它使用“DIFF_FILE”环境变量来了解哪些文件已更改,并将“CHANGELOG_CACHE_FILE_PATH”环境变量用于更改日志缓存文件。
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Using scripts to test your code on a runner
|
||||
shortTitle: Using scripts to test your code on a runner
|
||||
intro: 'How to use essential {% data variables.product.prodname_actions %} features for continuous integration (CI).'
|
||||
title: 使用脚本在运行器上测试代码
|
||||
shortTitle: 使用脚本在运行器上测试代码
|
||||
intro: '如何使用必要 {% data variables.product.prodname_actions %} 功能进行持续集成 (CI)。'
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '> 3.1'
|
||||
@@ -23,7 +23,7 @@ topics:
|
||||
|
||||
## 示例概述
|
||||
|
||||
{% data reusables.actions.example-workflow-intro-ci %} When this workflow is triggered, it automatically runs a script that checks whether the {% data variables.product.prodname_dotcom %} Docs site has any broken links.
|
||||
{% data reusables.actions.example-workflow-intro-ci %} 此工作流程被触发时,它会自动运行一个脚本,用于检查 {% data variables.product.prodname_dotcom %} 文档网站是否有任何断开的链接。
|
||||
|
||||
{% data reusables.actions.example-diagram-intro %}
|
||||
|
||||
@@ -44,7 +44,7 @@ topics:
|
||||
|在不同的运行器上运行作业,具体取决于存储库:| [`runs-on`](/actions/using-jobs/choosing-the-runner-for-a-job)|
|
||||
{% data reusables.actions.checkout-action-table-entry %}
|
||||
{% data reusables.actions.setup-node-table-entry %}
|
||||
| Using a third-party action: | [`trilom/file-changes-action`](https://github.com/trilom/file-changes-action)| | Running a script on the runner: | Using `./script/rendered-content-link-checker.mjs` |
|
||||
|使用第三方操作:| [`trilom/file-changes-action`](https://github.com/trilom/file-changes-action)| |在运行器上运行脚本:|使用 `./script/rendered-content-link-checker.mjs` |
|
||||
|
||||
## 示例工作流程
|
||||
|
||||
@@ -181,7 +181,7 @@ on:
|
||||
</td>
|
||||
<td>
|
||||
|
||||
Add the `workflow_dispatch` event if you want to be able to manually run this workflow from the UI. For more information, see [`workflow_dispatch`](/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch).
|
||||
如果您希望能够从 UI 手动运行此工作流程,请添加“workflow_dispatch”事件。 更多信息请参阅 [`workflow_dispatch`](/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch)。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -195,7 +195,7 @@ Add the `workflow_dispatch` event if you want to be able to manually run this wo
|
||||
</td>
|
||||
<td>
|
||||
|
||||
Add the `push` event, so that the workflow runs automatically every time a commit is pushed to a branch called `main`. 更多信息请参阅 [`push`](/actions/using-workflows/events-that-trigger-workflows#push)。
|
||||
添加 'push' 事件,以便每次将提交推送到分支 `main` 时,工作流程都会自动运行。 更多信息请参阅 [`push`](/actions/using-workflows/events-that-trigger-workflows#push)。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -272,7 +272,7 @@ jobs:
|
||||
</td>
|
||||
<td>
|
||||
|
||||
Defines a job with the ID `check-links` that is stored within the `jobs` key.
|
||||
定义 ID 为“check-links”的作业,该作业存储在“jobs”键中。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -298,7 +298,7 @@ Defines a job with the ID `check-links` that is stored within the `jobs` key.
|
||||
</td>
|
||||
<td>
|
||||
|
||||
Groups together all the steps that will run as part of the `check-links` job. 工作流程中的每个作业都有自己的“steps”部分。
|
||||
组合将作为“check-links”作业一部分运行的所有步骤。 工作流程中的每个作业都有自己的“steps”部分。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -327,7 +327,7 @@ Groups together all the steps that will run as part of the `check-links` job.
|
||||
</td>
|
||||
<td>
|
||||
|
||||
This step uses the `actions/setup-node` action to install the specified version of the Node.js software package on the runner, which gives you access to the `npm` command.
|
||||
此步骤使用“actions/setup-node”操作在运行器上安装指定版本的 Node.js 软件包,这使您可以访问“npm”命令。
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -341,7 +341,7 @@ This step uses the `actions/setup-node` action to install the specified version
|
||||
</td>
|
||||
<td>
|
||||
|
||||
The `run` keyword tells the job to execute a command on the runner. In this case, `npm ci` is used to install the npm software packages for the project.
|
||||
“run”关键字指示作业在运行器上执行命令。 在这种情况下,“npm ci”用于为项目安装 npm 软件包。
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -357,7 +357,7 @@ The `run` keyword tells the job to execute a command on the runner. In this case
|
||||
</td>
|
||||
<td>
|
||||
|
||||
Uses the `trilom/file-changes-action` action to gather all the changed files. 此示例使用 'a6ca26c14274c33b15e6499323aac178af06ad4b' SHA固定到操作的特定版本。
|
||||
使用“trilom/file-changes-action”操作来收集所有已更改的文件。 此示例使用 'a6ca26c14274c33b15e6499323aac178af06ad4b' SHA固定到操作的特定版本。
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -371,7 +371,7 @@ Uses the `trilom/file-changes-action` action to gather all the changed files.
|
||||
</td>
|
||||
<td>
|
||||
|
||||
Lists the contents of `files.json`. This will be visible in the workflow run's log, and can be useful for debugging.
|
||||
列出“files.json”的内容。 这将在工作流程运行的日志中可见,并且对于调试非常有用。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -391,7 +391,7 @@ Lists the contents of `files.json`. This will be visible in the workflow run's l
|
||||
</td>
|
||||
<td>
|
||||
|
||||
This step uses `run` command to execute a script that is stored in the repository at `script/rendered-content-link-checker.mjs` and passes all the parameters it needs to run.
|
||||
此步骤使用“run”命令执行存储在存储库中的“script/rendered-content-link-checker.mjs”中的脚本,并传递运行所需的所有参数。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -410,7 +410,7 @@ This step uses `run` command to execute a script that is stored in the repositor
|
||||
</td>
|
||||
<td>
|
||||
|
||||
This step also uses `run` command to execute a script that is stored in the repository at `script/rendered-content-link-checker.mjs` and passes a different set of parameters.
|
||||
此步骤还使用“run”命令来执行存储在存储库中的“script/rendered-content-link-checker.mjs”中的脚本,并传递一组不同的参数。
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Using the GitHub CLI on a runner
|
||||
shortTitle: Using the GitHub CLI on a runner
|
||||
title: 在运行器上使用 GitHub CLI
|
||||
shortTitle: 在运行器上使用 GitHub CLI
|
||||
intro: '如何使用高级 {% data variables.product.prodname_actions %} 功能进行持续集成 (CI)。'
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -23,7 +23,7 @@ topics:
|
||||
|
||||
## 示例概述
|
||||
|
||||
{% data reusables.actions.example-workflow-intro-ci %} When this workflow is triggered, it automatically runs a script that checks whether the {% data variables.product.prodname_dotcom %} Docs site has any broken links. If any broken links are found, the workflow uses the {% data variables.product.prodname_dotcom %} CLI to create a {% data variables.product.prodname_dotcom %} issue with the details.
|
||||
{% data reusables.actions.example-workflow-intro-ci %} 此工作流程被触发时,它会自动运行一个脚本,用于检查 {% data variables.product.prodname_dotcom %} 文档网站是否有任何断开的链接。 如果发现任何断开的链接,工作流程将使用 {% data variables.product.prodname_dotcom %} CLI 创建包含详细信息的 {% data variables.product.prodname_dotcom %} 议题。
|
||||
|
||||
{% data reusables.actions.example-diagram-intro %}
|
||||
|
||||
@@ -42,7 +42,7 @@ topics:
|
||||
{% data reusables.actions.secrets-table-entry %}
|
||||
{% data reusables.actions.checkout-action-table-entry %}
|
||||
{% data reusables.actions.setup-node-table-entry %}
|
||||
| Using a third-party action: | [`peter-evans/create-issue-from-file`](https://github.com/peter-evans/create-issue-from-file)| | Running shell commands on the runner: | [`run`](/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun) | | Running a script on the runner: | Using `script/check-english-links.js` | | Generating an output file: | Piping the output using the `>` operator | | Checking for existing issues using {% data variables.product.prodname_cli %}: | [`gh issue list`](https://cli.github.com/manual/gh_issue_list) | | Commenting on an issue using {% data variables.product.prodname_cli %}: | [`gh issue comment`](https://cli.github.com/manual/gh_issue_comment) |
|
||||
| 使用第三方操作:| [`peter-evans/create-issue-from-file`](https://github.com/peter-evans/create-issue-from-file)| | 在运行器上运行 shell 命令:| [`run`](/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun) | | 在运行器上运行脚本:| 使用 `script/check-english-links.js` | | 生成输出文件:| 使用 `>` 运算符传递输出 | | 使用 {% data variables.product.prodname_cli %} 检查现有议题:| [`gh issue list`](https://cli.github.com/manual/gh_issue_list) | | 使用 {% data variables.product.prodname_cli %} 评论议题:| [`gh issue comment`](https://cli.github.com/manual/gh_issue_comment) |
|
||||
|
||||
## 示例工作流程
|
||||
|
||||
@@ -213,10 +213,10 @@ on:
|
||||
</td>
|
||||
<td>
|
||||
|
||||
Defines the `workflow_dispatch` and `scheduled` as triggers for the workflow:
|
||||
将“workflow_dispatch”和“scheduled”定义为工作流程的触发器:
|
||||
|
||||
* The `workflow_dispatch` lets you manually run this workflow from the UI. For more information, see [`workflow_dispatch`](/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch).
|
||||
* The `schedule` event lets you use `cron` syntax to define a regular interval for automatically triggering the workflow. For more information, see [`schedule`](/actions/reference/events-that-trigger-workflows#schedule).
|
||||
* “workflow_dispatch”允许您从 UI 手动运行此工作流程。 更多信息请参阅 [`workflow_dispatch`](/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch)。
|
||||
* “schedule”事件允许您使用“cron”语法来定义自动触发工作流程的定期间隔。 更多信息请参阅 [`schedule`](/actions/reference/events-that-trigger-workflows#schedule)。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -255,7 +255,7 @@ jobs:
|
||||
</td>
|
||||
<td>
|
||||
|
||||
Defines a job with the ID `check_all_english_links`, and the name `Check all links`, that is stored within the `jobs` key.
|
||||
定义 ID 为“check_all_english_links”和名称为“Check all links”的作业,该作业存储在“jobs”键中。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -267,7 +267,7 @@ if: github.repository == 'github/docs-internal'
|
||||
</td>
|
||||
<td>
|
||||
|
||||
Only run the `check_all_english_links` job if the repository is named `docs-internal` and is within the `github` organization. Otherwise, the job is marked as _skipped_.
|
||||
仅当存储库名为“docs-internal”并且位于“github”组织内时,才运行“check_all_english_links”作业。 否则,作业将标记为 _skiped_。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -279,7 +279,7 @@ runs-on: ubuntu-latest
|
||||
</td>
|
||||
<td>
|
||||
|
||||
配置作业在 Ubuntu Linux 运行器上运行。 This means that the job will execute on a fresh virtual machine hosted by {% data variables.product.prodname_dotcom %}. For syntax examples using other runners, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on)."
|
||||
配置作业在 Ubuntu Linux 运行器上运行。 这意味着作业将在由 {% data variables.product.prodname_dotcom %} 托管的新虚拟机上执行。 有关使用其他运行器的语法示例,请参阅“[{% data variables.product.prodname_actions %} 的工作流语法](/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on)”。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -295,7 +295,7 @@ runs-on: ubuntu-latest
|
||||
</td>
|
||||
<td>
|
||||
|
||||
Creates custom environment variables, and redefines the built-in `GITHUB_TOKEN` variable to use a custom [secret](/actions/security-guides/encrypted-secrets). These variables will be referenced later in the workflow.
|
||||
创建自定义环境变量,并重新定义内置的“GITHUB_TOKEN”变量以使用自定义 [secret](/actions/security-guides/encrypted-secrets)。 稍后将在工作流程中引用这些变量。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -307,7 +307,7 @@ Creates custom environment variables, and redefines the built-in `GITHUB_TOKEN`
|
||||
</td>
|
||||
<td>
|
||||
|
||||
Groups together all the steps that will run as part of the `check_all_english_links` job. Each job in the workflow has its own `steps` section.
|
||||
组合将作为“check_all_english_links”作业一部分运行的所有步骤。 工作流程中的每个作业都有自己的“steps”部分。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -351,7 +351,7 @@ Groups together all the steps that will run as part of the `check_all_english_li
|
||||
</td>
|
||||
<td>
|
||||
|
||||
The `run` keyword tells the job to execute a command on the runner. In this case, the `npm ci` and `npm run build` commands are run as separate steps to install and build the Node.js application in the repository.
|
||||
“run”关键字指示作业在运行器上执行命令。 在这种情况下,“npm ci”和“npm run build”命令作为单独的步骤运行,以在存储库中安装和构建 Node.js 应用程序。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -365,7 +365,7 @@ The `run` keyword tells the job to execute a command on the runner. In this case
|
||||
</td>
|
||||
<td>
|
||||
|
||||
This `run` command executes a script that is stored in the repository at `script/check-english-links.js`, and pipes the output to a file called `broken_links.md`.
|
||||
此“run”命令执行存储在存储库中“script/check-english-links.js”的脚本,并将输出传递到名为“broken_links.md”的文件。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -380,7 +380,7 @@ This `run` command executes a script that is stored in the repository at `script
|
||||
</td>
|
||||
<td>
|
||||
|
||||
If the `check-english-links.js` script detects broken links and returns a non-zero (failure) exit status, then use a [workflow command](/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter) to set an output that has the value of the first line of the `broken_links.md` file (this is used the next step).
|
||||
如果“check-english-links.js”脚本检测到断开的链接并返回非零(失败)退出状态,则使用 [工作流程命令](/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter) 来设置具有 “broken_links.md” 文件第一行值的输出(这是在下一步中使用)。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -402,7 +402,7 @@ If the `check-english-links.js` script detects broken links and returns a non-ze
|
||||
</td>
|
||||
<td>
|
||||
|
||||
Uses the `peter-evans/create-issue-from-file` action to create a new {% data variables.product.prodname_dotcom %} issue. This example is pinned to a specific version of the action, using the `b4f9ee0a9d4abbfc6986601d9b1a4f8f8e74c77e` SHA.
|
||||
使用“peter-evans/create-issue-from-file”操作创建新的 {% data variables.product.prodname_dotcom %} 议题。 此示例使用 'b4f9ee0a9d4abbfc6986601d9b1a4f8f8e74c77e' SHA 固定到操作的特定版本。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -430,9 +430,9 @@ Uses the `peter-evans/create-issue-from-file` action to create a new {% data var
|
||||
</td>
|
||||
<td>
|
||||
|
||||
Uses [`gh issue list`](https://cli.github.com/manual/gh_issue_list) to locate the previously created issue from earlier runs. This is [aliased](https://cli.github.com/manual/gh_alias_set) to `gh list-reports` for simpler processing in later steps. To get the issue URL, the `jq` expression processes the resulting JSON output.
|
||||
使用 [`gh issue list`](https://cli.github.com/manual/gh_issue_list) 从早期运行中查找以前创建的议题。 这将[aliased](https://cli.github.com/manual/gh_alias_set) 为“gh list-reports”,以便在后续步骤中简化处理。 若要获取议题 URL,“jq”表达式将处理生成的 JSON 输出。
|
||||
|
||||
[`gh issue comment`](https://cli.github.com/manual/gh_issue_comment) is then used to add a comment to the new issue that links to the previous one.
|
||||
[`gh issue comment`](https://cli.github.com/manual/gh_issue_comment) 然后用于向链接到上一个议题的新议题添加注释。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -450,7 +450,7 @@ Uses [`gh issue list`](https://cli.github.com/manual/gh_issue_list) to locate th
|
||||
</td>
|
||||
<td>
|
||||
|
||||
If an issue from a previous run is open and assigned to someone, then use [`gh issue comment`](https://cli.github.com/manual/gh_issue_comment) to add a comment with a link to the new issue.
|
||||
如果上一次运行中的议题已打开并分配给某人,请使用 [`gh issue comment`](https://cli.github.com/manual/gh_issue_comment) 添加带有指向新议题的链接的注释。
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -471,11 +471,11 @@ If an issue from a previous run is open and assigned to someone, then use [`gh i
|
||||
</td>
|
||||
<td>
|
||||
|
||||
If an issue from a previous run is open and is not assigned to anyone, then:
|
||||
如果上一次运行中的议题已打开且未分配给任何人,则:
|
||||
|
||||
* Use [`gh issue comment`](https://cli.github.com/manual/gh_issue_comment) to add a comment with a link to the new issue.
|
||||
* Use [`gh issue close`](https://cli.github.com/manual/gh_issue_close) to close the old issue.
|
||||
* Use [`gh issue edit`](https://cli.github.com/manual/gh_issue_edit) to edit the old issue to remove it from a specific {% data variables.product.prodname_dotcom %} project board.
|
||||
* 使用 [`gh issue comment`](https://cli.github.com/manual/gh_issue_comment) 添加带有新议题链接的评论。
|
||||
* 使用 [`gh issue close`](https://cli.github.com/manual/gh_issue_close) 关闭旧议题。
|
||||
* 使用 [`gh issue edit`](https://cli.github.com/manual/gh_issue_edit) 编辑旧议题,以将其从特定 {% data variables.product.prodname_dotcom %} 项目板中删除。
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: 重新运行工作流程和作业
|
||||
intro: '您可以工作流程运行初始运行后最长 30 天内重新运行工作流程运行{% ifversion re-run-jobs %}、工作流程运行中所有失败的作业或工作流程运行中的特定作业{% endif %}。'
|
||||
title: Re-running workflows and jobs
|
||||
intro: You can re-run a workflow run{% ifversion re-run-jobs %}, all failed jobs in a workflow run, or specific jobs in a workflow run{% endif %} up to 30 days after its initial run.
|
||||
permissions: People with write permissions to a repository can re-run workflows in the repository.
|
||||
miniTocMaxHeadingLevel: 3
|
||||
redirect_from:
|
||||
@@ -15,11 +15,11 @@ versions:
|
||||
{% data reusables.actions.enterprise-beta %}
|
||||
{% data reusables.actions.enterprise-github-hosted-runners %}
|
||||
|
||||
## 关于重新运行工作流程和作业
|
||||
## About re-running workflows and jobs
|
||||
|
||||
重新运行工作流程{% ifversion re-run-jobs %} 或工作流程中的作业{% endif %} 会使用触发工作流程运行的原始事件的 `GITHUB_SHA`(提交 SHA)和 `GITHUB_REF` (Git ref)。 You can re-run a workflow{% ifversion re-run-jobs %} or jobs in a workflow{% endif %} for up to 30 days after the initial run.{% ifversion re-run-jobs %} You cannot re-run jobs in a workflow once its logs have passed their retention limits. For more information, see "[Usage limits, billing, and administration](/actions/learn-github-actions/usage-limits-billing-and-administration#artifact-and-log-retention-policy)."{% endif %}{% ifversion debug-reruns %} When you re-run a workflow or jobs in a workflow, you can enable debug logging for the re-run. 这将为重新运行启用运行程序诊断日志记录和步骤调试日志记录。 有关调试日志记录的更多信息,请参阅“[启用调试日志记录](/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging)”。{% endif %}
|
||||
Re-running a workflow{% ifversion re-run-jobs %} or jobs in a workflow{% endif %} uses the same `GITHUB_SHA` (commit SHA) and `GITHUB_REF` (Git ref) of the original event that triggered the workflow run. You can re-run a workflow{% ifversion re-run-jobs %} or jobs in a workflow{% endif %} for up to 30 days after the initial run.{% ifversion re-run-jobs %} You cannot re-run jobs in a workflow once its logs have passed their retention limits. For more information, see "[Usage limits, billing, and administration](/actions/learn-github-actions/usage-limits-billing-and-administration#artifact-and-log-retention-policy)."{% endif %}{% ifversion debug-reruns %} When you re-run a workflow or jobs in a workflow, you can enable debug logging for the re-run. This will enable runner diagnostic logging and step debug logging for the re-run. For more information about debug logging, see "[Enabling debug logging](/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging)."{% endif %}
|
||||
|
||||
## 重新运行工作流程中的所有作业
|
||||
## Re-running all the jobs in a workflow
|
||||
|
||||
{% webui %}
|
||||
|
||||
@@ -28,12 +28,14 @@ versions:
|
||||
{% data reusables.repositories.navigate-to-workflow %}
|
||||
{% data reusables.repositories.view-run %}
|
||||
{% ifversion fpt or ghes > 3.4 or ghae-issue-4721 or ghec %}
|
||||
1. 在工作流程的右上角,使用 **Re-run jobs(重新运行作业)**下拉菜单,并选择 **Re-run all jobs(重新运行所有作业)**。
|
||||
1. In the upper-right corner of the workflow, use the **Re-run jobs** drop-down menu, and select **Re-run all jobs**.
|
||||
|
||||
如果没有作业失败,您将不会看到 **重新运行作业(Re-run jobs)**下拉菜单。 相反,请单击 **Re-run all jobs(重新运行所有作业)**。 
|
||||
If no jobs failed, you will not see the **Re-run jobs** drop-down menu. Instead, click **Re-run all jobs**.
|
||||

|
||||
{% endif %}
|
||||
{% ifversion ghes < 3.5 or ghae %}
|
||||
1. 在工作流程的右上角,使用 **Re-run jobs(重新运行作业)**下拉菜单,并选择 **Re-run all jobs(重新运行所有作业)**。 
|
||||
1. In the upper-right corner of the workflow, use the **Re-run jobs** drop-down menu, and select **Re-run all jobs**.
|
||||

|
||||
{% endif %}
|
||||
{% data reusables.actions.enable-debug-logging %}
|
||||
|
||||
@@ -43,7 +45,7 @@ versions:
|
||||
|
||||
{% data reusables.cli.cli-learn-more %}
|
||||
|
||||
要重新运行失败的工作流程运行,请使用 `run rerun` 子命令。 将 `run-id` 替换为您想要重新运行的已失败运行的 ID。 如果您没有指定 `run-id`,{% data variables.product.prodname_cli %} 将返回一个交互式菜单,供您选择最近失败的运行。
|
||||
To re-run a failed workflow run, use the `run rerun` subcommand. Replace `run-id` with the ID of the failed run that you want to re-run. If you don't specify a `run-id`, {% data variables.product.prodname_cli %} returns an interactive menu for you to choose a recent failed run.
|
||||
|
||||
```shell
|
||||
gh run rerun <em>run-id</em>
|
||||
@@ -58,7 +60,7 @@ gh run rerun <em>run-id</em> --debug
|
||||
|
||||
{% endif %}
|
||||
|
||||
要查看工作流程运行的进度,请使用 `run watch` 子命令,并从交互式列表中选择运行。
|
||||
To view the progress of the workflow run, use the `run watch` subcommand and select the run from the interactive list.
|
||||
|
||||
```shell
|
||||
gh run watch
|
||||
@@ -67,9 +69,9 @@ gh run watch
|
||||
{% endcli %}
|
||||
|
||||
{% ifversion re-run-jobs %}
|
||||
## 重新运行工作流程中失败的作业
|
||||
## Re-running failed jobs in a workflow
|
||||
|
||||
如果工作流程运行中的任何作业失败,您可以仅重新运行失败的作业。 在重新运行工作流程中失败的作业时,将为所有失败的作业及其依赖项启动新的工作流程运行。 上一个工作流程运行中任何成功作业的任何输出都将用于重新运行。 在初始运行中创建的任何构件都将在重新运行中可用。 在上一次运行中通过的任何环境保护规则都将自动在重新运行中通过。
|
||||
If any jobs in a workflow run failed, you can re-run just the jobs that failed. When you re-run failed jobs in a workflow, a new workflow run will start for all failed jobs and their dependents. Any outputs for any successful jobs in the previous workflow run will be used for the re-run. Any artifacts that were created in the initial run will be available in the re-run. Any environment protection rules that passed in the previous run will automatically pass in the re-run.
|
||||
|
||||
{% webui %}
|
||||
|
||||
@@ -77,14 +79,15 @@ gh run watch
|
||||
{% data reusables.repositories.actions-tab %}
|
||||
{% data reusables.repositories.navigate-to-workflow %}
|
||||
{% data reusables.repositories.view-run %}
|
||||
1. 在工作流程的右上角,使用 **Re-run jobs(重新运行作业)**下拉菜单,并选择 **Re-run failed jobs(重新运行失败的作业)**。 
|
||||
1. In the upper-right corner of the workflow, use the **Re-run jobs** drop-down menu, and select **Re-run failed jobs**.
|
||||

|
||||
{% data reusables.actions.enable-debug-logging %}
|
||||
|
||||
{% endwebui %}
|
||||
|
||||
{% cli %}
|
||||
|
||||
要重新运行工作流程运行中失败的作业,请使用 `run rerun` 子命令与 `--failed` 标志。 将 `run-id` 替换为要为其重新运行失败作业的运行 ID。 如果您没有指定 `run-id`,{% data variables.product.prodname_cli %} 将返回一个交互式菜单,供您选择最近失败的运行。
|
||||
To re-run failed jobs in a workflow run, use the `run rerun` subcommand with the `--failed` flag. Replace `run-id` with the ID of the run for which you want to re-run failed jobs. If you don't specify a `run-id`, {% data variables.product.prodname_cli %} returns an interactive menu for you to choose a recent failed run.
|
||||
|
||||
```shell
|
||||
gh run rerun <em>run-id</em> --failed
|
||||
@@ -100,9 +103,9 @@ gh run rerun <em>run-id</em> --failed --debug
|
||||
{% endif %}
|
||||
{% endcli %}
|
||||
|
||||
## 重新运行工作流程中的特定作业
|
||||
## Re-running a specific job in a workflow
|
||||
|
||||
重新运行工作流程中的特定作业时,将为该作业和任何依赖项启动新的工作流程运行。 上一个工作流程运行中任何其他作业的任何输出都将用于重新运行。 在初始运行中创建的任何构件都将在重新运行中可用。 在上一次运行中通过的任何环境保护规则都将自动在重新运行中通过。
|
||||
When you re-run a specific job in a workflow, a new workflow run will start for the job and any dependents. Any outputs for any other jobs in the previous workflow run will be used for the re-run. Any artifacts that were created in the initial run will be available in the re-run. Any environment protection rules that passed in the previous run will automatically pass in the re-run.
|
||||
|
||||
{% webui %}
|
||||
|
||||
@@ -110,16 +113,18 @@ gh run rerun <em>run-id</em> --failed --debug
|
||||
{% data reusables.repositories.actions-tab %}
|
||||
{% data reusables.repositories.navigate-to-workflow %}
|
||||
{% data reusables.repositories.view-run %}
|
||||
1. 在要重新运行的作业旁边,单击 {% octicon "sync" aria-label="The re-run icon" %}。 
|
||||
1. Next to the job that you want to re-run, click {% octicon "sync" aria-label="The re-run icon" %}.
|
||||

|
||||
|
||||
或者,单击作业以查看日志。 在日志中,单击 {% octicon "sync" aria-label="The re-run icon" %}。 
|
||||
Alternatively, click on a job to view the log. In the log, click {% octicon "sync" aria-label="The re-run icon" %}.
|
||||

|
||||
{% data reusables.actions.enable-debug-logging %}
|
||||
|
||||
{% endwebui %}
|
||||
|
||||
{% cli %}
|
||||
|
||||
要重新运行工作流程运行中的特定作业,请使用 `run rerun` 子命令与 `--job` 标志。 将 `job-id` 替换为您想要重新运行的作业的 ID。
|
||||
To re-run a specific job in a workflow run, use the `run rerun` subcommand with the `--job` flag. Replace `job-id` with the ID of the job that you want to re-run.
|
||||
|
||||
```shell
|
||||
gh run rerun --job <em>job-id</em>
|
||||
@@ -139,26 +144,28 @@ gh run rerun --job <em>job-id</em> --debug
|
||||
|
||||
{% ifversion partial-reruns-with-reusable %}
|
||||
|
||||
## 使用可重用工作流程重新运行工作流程和作业
|
||||
## Re-running workflows and jobs with reusable workflows
|
||||
|
||||
{% data reusables.actions.partial-reruns-with-reusable %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% ifversion fpt or ghes > 3.4 or ghae-issue-4721 or ghec %}
|
||||
## 查看以前的工作流程运行
|
||||
## Reviewing previous workflow runs
|
||||
|
||||
您可以查看以前尝试运行工作流程的结果。 您还可以使用 API 查看以前的工作流程运行。 更多信息请参阅“[获取工作流程运行](/rest/reference/actions#get-a-workflow-run)”。
|
||||
You can view the results from your previous attempts at running a workflow. You can also view previous workflow runs using the API. For more information, see ["Get a workflow run"](/rest/reference/actions#get-a-workflow-run).
|
||||
|
||||
{% data reusables.repositories.navigate-to-repo %}
|
||||
{% data reusables.repositories.actions-tab %}
|
||||
{% data reusables.repositories.navigate-to-workflow %}
|
||||
{% data reusables.repositories.view-run %}
|
||||
{%- ifversion re-run-jobs %}
|
||||
1. 任何以前的运行尝试都显示在 **Latest(最新)**下拉菜单中。 
|
||||
1. Any previous run attempts are shown in the **Latest** drop-down menu.
|
||||

|
||||
{%- else %}
|
||||
1. 任何以前的运行尝试都显示在左窗格中。 
|
||||
1. Any previous run attempts are shown in the left pane.
|
||||

|
||||
{%- endif %}
|
||||
1. 单击某个条目以查看其结果。
|
||||
1. Click an entry to view its results.
|
||||
|
||||
{% endif %}
|
||||
|
||||
@@ -1250,12 +1250,12 @@ on: workflow_dispatch
|
||||
|
||||
#### 提供输入
|
||||
|
||||
您可以直接在工作流程中配置事件的自定义输入属性、默认输入值和必要输入。 触发事件时,可以提供 `ref` 和任何 `inputs`。 When the workflow runs, you can access the input values in the {% ifversion actions-unified-inputs %}`inputs`{% else %}`github.event.inputs`{% endif %} context. 更多信息请参阅“[上下文](/actions/learn-github-actions/contexts)”。
|
||||
您可以直接在工作流程中配置事件的自定义输入属性、默认输入值和必要输入。 触发事件时,可以提供 `ref` 和任何 `inputs`。 在工作流程运行时,您可以访问 {% ifversion actions-unified-inputs %}`inputs`{% else %}`github.event.inputs`{% endif %} 上下文中的输入值。 更多信息请参阅“[上下文](/actions/learn-github-actions/contexts)”。
|
||||
|
||||
{% data reusables.actions.inputs-vs-github-event-inputs %}
|
||||
|
||||
{% ifversion fpt or ghec or ghes > 3.3 or ghae-issue-5511 %}
|
||||
此示例定义了称为 `logLevel`、`tags` 和 `environment` 的输入。 在运行工作流程时,可以将这些输入的值传递给工作流程。 This workflow then prints the values to the log, using the {% ifversion actions-unified-inputs %}`inputs.logLevel`, `inputs.tags`, and `inputs.environment`{% else %}`github.event.inputs.logLevel`, `github.event.inputs.tags`, and `github.event.inputs.environment`{% endif %} context properties.
|
||||
此示例定义了称为 `logLevel`、`tags` 和 `environment` 的输入。 在运行工作流程时,可以将这些输入的值传递给工作流程。 然后,此工作流程使用 {% ifversion actions-unified-inputs %}`inputs.logLevel`、`inputs.tags` 和 `inputs.environment`{% else %}`github.event.inputs.logLevel`、`github.event.inputs.tags`)和 `github.event.inputs.environment`{% endif %} 上下文属性,将值打印到日志中。
|
||||
|
||||
```yaml
|
||||
on:
|
||||
@@ -1306,7 +1306,7 @@ gh workflow run run-tests.yml -f logLevel=warning -f tags=false -f environment=s
|
||||
更多信息请参阅“[手动运行工作流程](/actions/managing-workflow-runs/manually-running-a-workflow)”中的 {% data variables.product.prodname_cli %} 信息。
|
||||
|
||||
{% else %}
|
||||
This example defines the `name` and `home` inputs and prints them using the {% ifversion actions-unified-inputs %}`inputs.name` and `inputs.home`{% else %}`github.event.inputs.name` and `github.event.inputs.home`{% endif %} contexts. 如果未提供 `home` ,则打印默认值“The Octoverse”。
|
||||
此示例定义 `name` 和 `home` 输入,并使用 {% ifversion actions-unified-inputs %}`inputs.name` 和 `inputs.home`{% else %}`github.event.inputs.name` 和 `github.event.inputs.home`{% endif %} 上下文打印它们。 如果未提供 `home` ,则打印默认值“The Octoverse”。
|
||||
|
||||
```yaml
|
||||
name: Manually triggered workflow
|
||||
|
||||
@@ -280,7 +280,7 @@ updates:
|
||||
prefix-development: "pip dev"
|
||||
include: "scope"
|
||||
```
|
||||
If you use the same configuration as in the example above, bumping the `requests` library in the `pip` development dependency group will generate a commit message of:
|
||||
如果使用与上述示例中相同的配置,则在 `pip` 开发依赖项组中刷入 `requests` 库将生成以下提交消息:
|
||||
|
||||
`pip dev: bump requests from 1.0.0 to 1.0.1`
|
||||
|
||||
|
||||
@@ -34,7 +34,10 @@ topics:
|
||||
|
||||
{% note %}
|
||||
|
||||
**注:**您可以为开源项目创建公共仓库。 创建公共仓库时,请确保包含[许可文件](https://choosealicense.com/)以确定您希望与其他人共享项目。 {% data reusables.open-source.open-source-guide-repositories %} {% data reusables.open-source.open-source-learning %}
|
||||
**注意:**
|
||||
- You can create public repositories for an open source project. 创建公共仓库时,请确保包含[许可文件](https://choosealicense.com/)以确定您希望与其他人共享项目。 {% data reusables.open-source.open-source-guide-repositories %}
|
||||
- {% data reusables.open-source.open-source-learning %}
|
||||
- You can also add community health files to your repositories, to set guidelines on how to contribute, keep your repositories safe, and much more. 更多信息请参阅“[创建默认社区健康文件](/communities/setting-up-your-project-for-healthy-contributions/creating-a-default-community-health-file)”。
|
||||
|
||||
{% endnote %}
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ GitHub 可能会向执法部门或其他政府机构披露我们收集的有关
|
||||
|
||||
如果 GitHub 处理除您的个人资料信息以外的个人数据,例如 GitHub 从[第三方](/github/site-policy/github-privacy-statement#information-we-collect-from-third-parties)收到的有关您的信息,则根据适用法律,您可以联系 [GitHub 支持](https://support.github.com/contact) 或 [GitHub 高级支持](https://enterprise.githubsupport.com/hc/en-us)访问、更新、更改、删除、反对或限制处理您的个人数据。
|
||||
|
||||
您可以通过[个人资料设置](https://github.com/settings/profile)来调整帐户上的设置,包括将您的个人数据显示在私人或公共存储库中,或与社区功能(例如 GitHub Feed、GitHub Globe、GitHub Explore、GitHub 讨论排行榜)相关的个人数据。
|
||||
You can adjust the settings on your Account regarding the display of your Personal Data in private or public repositories or Personal Data processed in connection with Community Features (such as GitHub Feed, GitHub Sponsors, and GitHub Explore) through [profile settings](https://github.com/settings/profile).
|
||||
|
||||
此外,如果您无法通过上述方式访问我们拥有的某些个人数据,您可以按照本隐私声明底部所述与我们联系以请求访问。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user