Getting a list of workflow runs for a specific PR

I’m trying to use the new actions api to get a list of workflow runs for a specific PR when it’s closed. If the workflow ran 10 times for the given PR I want to be able to get a list of those 10 runs that I can act on.

The only way I’m seeing to accomplish this is to list all workflow runs and check each one of them to see if it’s for the given PR which will just get slower and slower as more runs accumulate. Are there plans to add this functionality in or maybe a way to do it with the graphql api?

1 Like

I tried List workflow runs api, you could get your workflows with is on: pull_request and filter the pull request related workflow runs from the response body.  

As Actions API is still in beta, you could submit a feature request in the Feedback form for GitHub Actions.

Sorry to tell you that I am not familar with graphql api, I found this document for you to reference: https://developer.github.com/v4/guides/migrating-from-rest/ 

There doesn’t seem to be a graph for workflows. Is this possible?