Skip to content

Conversation

@augustoccesar
Copy link
Contributor

@augustoccesar augustoccesar commented Sep 18, 2025

TL;DR issue

Currently JSON parsing breaks when handling Push Webhook events where the pusher is a bot without an email.

Description

Currently, the Push webhook uses the GitUserTime (which internally use the flatten CommitAuthor) as the Pusher, which assumes that email is always present. After considering adding a new struct to represent the Pusher, I noticed that in the documentation it mentions that the email can be null for all the Commiter, Pusher and Author.

This was noticed while handling Push webhook events from GitHub Merge Queue, where the pusher is:

"pusher": {
  "name": "github-merge-queue[bot]",
  "email": null
}

But also investigated and this seems to be the case for bots in general. As PRs where the pushes are done by Renovate also have the pusher as:

"pusher": {
  "name": "renovate[bot]",
  "email": null
}

So, because of that, the suggestion here is to do the change directly on the CommitAuthor. This approach is a breaking change for the current API. Another solution if we want to avoid it being breaking would be to have a different type for the Pusher where the email is nullable/optional.

Screenshots

Screenshot 2025-09-18 at 11 06 48 Screenshot 2025-09-18 at 09 50 51

References

### Description
Currently, the Push webhook uses the `GitUserTime` (which internally use the flatten `CommitAuthor`) as the `Pusher`, which assumes that email is always present.
After considering adding a new struct to represent the `Pusher`, I noticed that in the documentation it mentions that the email can be null for all the `Commiter`, `Pusher` and `Author`.

This was noticed while handling Push webhook events from [GitHub Merge Queue](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue), where the pusher is:
```json
"pusher": {
  "name": "github-merge-queue[bot]",
  "email": null
}
```

But also investigated and this seems to be the case for bots in general. As PRs where the pushes are done by [Renovate](https://docs.renovatebot.com/) also have the pusher as:
```json
"pusher": {
  "name": "renovate[bot]",
  "email": null
}
```

So, because of that, the suggestion here is to do the change directly on the `CommitAuthor`.
This approach is a breaking change for the current API. Another solution if we want to avoid it being breaking would be to have a different type for the `Pusher` where the email is nullable/optional.

### Screenshots
**To be added on the PR**

### References
- https://docs.github.com/en/webhooks/webhook-events-and-payloads#push
@dmgorsky
Copy link
Collaborator

LGTM; [breaking] similar to #656 or #784

@XAMPPRocky
Copy link
Owner

Thank you for your PR!

@XAMPPRocky XAMPPRocky merged commit 0b57b29 into XAMPPRocky:main Sep 21, 2025
20 checks passed
@github-actions github-actions bot mentioned this pull request Sep 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants