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?
Asked
Active
Viewed 296 times
1 Answers
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
}
}
}
}
}
}

Khaled Sulayman
- 21
- 2