Specify check suite when creating a checkrun

When creating a check run through the API, a check suite is newly created unless a check suite for the requesting application has already been made, in which case that check suite seems to be reused.

This leads to issues however: due to Github Actions workflows, and each Workflow Run (workflow/event) having its own check suite, multiple check suites may exist for a given commit SHA. As a result, annotations generated in a Github action during a step executed in the “pull request” event, end up in the “workflow” for the "push’ event.

Through hoops, it is possible to find the check run ID during a Github Action: one can look up the Workflow Run by the run_id and then extract the Check Suite ID from the checkSuiteUrl. However, there is no way to specify the Check Suite ID when creating a new check run (its ignored in the request) and neither there seems to be any dedicated endpoint for creating check runs for a particular check suite.

It would be great if it were possible to more easily find the corresponding Check Suite for a Workflow Run, and if it were possible to create Check Runs for this particular Check Suite rather than have one picked “randomly” for you.

See also the issue thread https://github.com/jwgmeligmeyling/pmd-github-action/issues/4 and proof of concept code in https://github.com/jwgmeligmeyling/pmd-github-action/pull/3

1 Like

@jwgmeligmeyling - Welcome back to the Support Community and thanks for this feedback! :bowing_man:

After reviewing your particular case, I’d like to confirm here that it is not currently possible to create a check run associated with a particular check suite with the GitHub Actions-provided GITHUB_TOKEN. I acknowledge that it is something that would be valuable given your use case.

We’re always working to improve GitHub and the GitHub Support Community, and we consider every suggestion we receive. Would you mind submitting this through our official product feedback form so that our product team can track your request? That’s the best place to share requests like these in consideration for future iterations of GitHub features, including Actions.

Thanks for your response! I’ve submitted the product feedback form.