获取 GitHub 名参赛者的名单?

Get a list of GitHub runners?

我是 GitHub workflow/actions 的新手,我的任务是获取当前跑步者匹配跑步者的列表。我正在查看现有工作流程的声明。

runs-on: ["self-hosted", "management-control-plane", "${{ needs.env.outputs.env }}"]

所以它看起来像是在说“在指定的环境中找到一个我们现有的具有指定标签 'management-control-plane' 的 VM。因此,Github 作为其引用的某处的列表。

问题:如何使用标签和环境查询虚拟机列表?谢谢!

您可以使用 REST API 列出您的组织或存储库的所有运行器。

这是来自 docs 的示例:

curl \
  -H "Accept: application/vnd.github.v3+json" \
  https://api.github.com/orgs/ORG/actions/runners
{
  "total_count": 2,
  "runners": [
    {
      "id": 23,
      "name": "linux_runner",
      "os": "linux",
      "status": "online",
      "busy": true,
      "labels": [
        {
          "id": 5,
          "name": "self-hosted",
          "type": "read-only"
        },
        {
          "id": 7,
  // etc...