Skip to main content

此版本的 GitHub Enterprise Server 将于以下日期停止服务 2024-08-29. 即使针对重大安全问题,也不会发布补丁。 为了获得更好的性能、更高的安全性和新功能,请升级到最新版本的 GitHub Enterprise。 如需升级帮助,请联系 GitHub Enterprise 支持

Enabling debug logging

If the workflow logs do not provide enough detail to diagnose why a workflow, job, or step is not working as expected, you can enable additional debug logging.

注意:GitHub Enterprise Server 目前不支持 GitHub 托管的运行器。 可以在 GitHub public roadmap 上查看有关未来支持计划的更多信息。

These extra logs are enabled by setting secrets or variables in the repository containing the workflow, so the same permissions requirements will apply:

  • 若要在 GitHub 上为个人帐户存储库创建机密或变量,你必须是存储库所有者。 若要在 GitHub 上为组织存储库创建机密或变量,你必须拥有 admin 访问权限。 最后,若要通过 REST API 为个人帐户存储库或组织存储库创建机密或变量,你必须拥有协作者访问权限。
  • 要为个人帐户存储库中的环境创建密码或变量,你必须是存储库所有者。 要为组织存储库中的环境创建密码或变量,必须具有 admin 访问权限。 有关环境的详细信息,请参阅“管理部署环境”。
  • 组织所有者可以在组织级别创建机密或变量。

For more information on setting secrets and variables, see "在 GitHub Actions 中使用机密" and "变量."

Additionally, anyone who has access to run a workflow can enable runner diagnostic logging and step debug logging for a workflow re-run. For more information, see "重新运行工作流程和作业."

Enabling runner diagnostic logging

Runner diagnostic logging provides additional log files that contain information about how a runner is executing a job. Two extra log files are added to the log archive:

  • The runner process log, which includes information about coordinating and setting up runners to execute jobs.
  • The worker process log, which logs the execution of a job.
  1. To enable runner diagnostic logging, set the following secret or variable in the repository that contains the workflow: ACTIONS_RUNNER_DEBUG to true. If both the secret and variable are set, the value of the secret takes precedence over the variable.
  2. To download runner diagnostic logs, download the log archive of the workflow run. The runner diagnostic logs are contained in the runner-diagnostic-logs folder. For more information on downloading logs, see "Using workflow run logs."

Enabling step debug logging

Step debug logging increases the verbosity of a job's logs during and after a job's execution.

  1. To enable step debug logging, set the following secret or variable in the repository that contains the workflow: ACTIONS_STEP_DEBUG to true. If both the secret and variable are set, the value of the secret takes precedence over the variable.
  2. After setting the secret or variable, more debug events are shown in the step logs. For more information, see "Using workflow run logs."