Skip to main content

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

Viewing workflow run history

You can view logs for each run of a workflow. Logs include the status for each job and step in a workflow.

Tool navigation

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

执行这些步骤需要对仓库的读取访问权限。

  1. 在 你的 GitHub Enterprise Server 实例 上,导航到存储库的主页。

  2. 在存储库名称下,单击 “操作”。

    “github/docs”存储库的选项卡的屏幕截图。 “操作”选项卡以橙色边框突出显示。

  3. 在左侧边栏中,单击您想要查看的工作流程。

    “操作”选项卡的左侧边栏的屏幕截图。工作流“CodeQL”以深橙色标出。

  4. 在工作流运行列表中,单击运行的名称以查看工作流运行摘要。

若要详细了解 GitHub CLI,请参阅“关于 GitHub CLI”。

Viewing recent workflow runs

To list the recent workflow runs, use the run list subcommand.

gh run list

To specify the maximum number of runs to return, you can use the -L or --limit flag . The default is 10.

gh run list --limit 5

To only return runs for the specified workflow, you can use the -w or --workflow flag. Replace workflow with either the workflow name, workflow ID, or workflow file name. For example, "Link Checker", 1234567, or "link-check-test.yml".

gh run list --workflow WORKFLOW

Viewing details for a specific workflow run

To display details for a specific workflow run, use the run view subcommand. Replace run-id with the ID of the run that you want to view. If you don't specify a run-id, GitHub CLI returns an interactive menu for you to choose a recent run.

gh run view RUN_ID

To include job steps in the output, use the -v or --verbose flag.

gh run view RUN_ID --verbose

To view details for a specific job in the run, use the -j or --job flag. Replace job-id with the ID of the job that you want to view.

gh run view --job JOB_ID

To view the full log for a job, use the --log flag.

gh run view --job JOB_ID --log

Use the --exit-status flag to exit with a non-zero status if the run failed. For example:

gh run view 0451 --exit-status && echo "run pending or passed"