1

I am trying to get data on the user who set a label on a github pull request, but I can't find this in the API docs. Am I missing something?

1 Answers1

1

I found the solution! I don't think this is possible with their REST API, but the GraphQL API allows querying for all historical LabeledEvent objects, which have fields such as actor, createdAt, and label.

The example query below should get you the first label events on a pull request:

query { 
  repository(owner: <repo_owner>, name: <repo_name>) { 
    pullRequest(number: <pr_number>) {
      timelineItems(itemTypes: LABELED_EVENT, first: 100) {
        nodes {
          ... on LabeledEvent {
            actor { login }
            # add any other LabeledEvent fields you want to query here
          }
        }
      }
    }
  }
}