GitHub 操作 API:获取查看工作流 运行 历史记录

GitHub Actions API: Get view workflow run history

我正在寻找 API 来检索 GitHub 操作中特定工作流的先前运行。 我发现 API returns 我整个存储库的先前运行,但我只需要特定工作流程的运行。

这个 link 完美地描述了我正在寻找的 API: https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/viewing-workflow-run-history

使用 /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs 端点列出给定存储库中给定工作流 ID 的运行。

例如,要获取 rust-lang/rust 存储库的 CI 作业的所有运行,请使用 https://api.github.com/repos/rust-lang/rust/actions/workflows/817415/runs.