Request: Add workflow name in event check_run payload

hi folks
i’m trying to develop a solution to auto scale out self-hosted runner.
i was inspired this article: https://040code.github.io/2020/05/25/scaling-selfhosted-action-runners
basically, it listens on event check_run to trigger auto scale out.
however, in my use cases, one github organization may have multiple self-hosted runners with different labels.
with current check_run event payload, i can’t tell what runner to be scaled:

{
  "action": "created",
  "check_run": {
    "id": 936829714,
    ...
    "status": "queued",
    ...
    "name": "Build",
    "check_suite": {
        ...
    }
    ...
  }
}

I think with workflow name, i can get the runner label than knows which runner to scale. but I can only see name “Build” which is job name and not unique.

could you add “workflow” name in the event payload? or suggest a way I can tell which runner to scale.
thanks

Hi @missedone,

The workflow name is included in GITHUB CONTEXT: ${{ github.workflow }}, however it’s not included in the check_run event payload. You can raise a feature_request here where github product manager will take a review.

Since you can get the check_run id in the payload, you can get the workflow file with below link:
https://github.com/{org}/{repo}/actions/runs/{checkrun_id}/workflow, parse the selfhosted runner info then.

Thanks

1 Like

thanks, sounds a good workaround for now.
also i raised the feature request.