Currently, client.AutoMerge results in a panic if its called from StatusEvent, because the field prLabels isn't set. This will let the handler fail and return HTTP 500 to the GitHub webhook client.
In contrast to the PullRequestEvent & PullRequestReviewEvent - there might be multiple PRs involved when receiving a StatusEvent. Therefore, this commit removes the labels of a PR from the client fields and introduces a dedicated type PRLabels which gets created and passed explicitly to the individual functions (e.g. client.AutoMerge) if needed.
Currently,
client.AutoMerge
results in a panic if its called fromStatusEvent
, because the fieldprLabels
isn't set. This will let the handler fail and return HTTP 500 to the GitHub webhook client.In contrast to the
PullRequestEvent
&PullRequestReviewEvent
- there might be multiple PRs involved when receiving aStatusEvent
. Therefore, this commit removes the labels of a PR from the client fields and introduces a dedicated typePRLabels
which gets created and passed explicitly to the individual functions (e.g.client.AutoMerge
) if needed.