You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I noticed that getPayloadBranch doesn't work/returns an empty string when the api.Payloader is of type *api.PullRequestPayload.
Because of that I can't filter pull request related notifications (open/edit/reject/approve/merge) and send them to different channel in our slack
I fixed that issue in the following commit by using the head branch as relevant branch for the filter lhemala@d78e63a
Before I open a PR I wanted to know if this functionality was left out intentionally, maybe because a PR has two branches to which the filter can be applied to (head and base) and therefore the filter might be ambiguous.
In my implementation I only filter for the head branch. If we'd want to filter for both the change would get bigger since the filtering logic only expects a single branch. (But still very much doable)
Relates to:
Enhancements of webhooks (#3998)
WebHooks: branch filter for push/pull request notifications (#2025)
The text was updated successfully, but these errors were encountered:
Let me elaborate the use case:
We have a monorepo which includes, among other things, our front and backend. In our Slack we have two separate channel on which the respective devs always keep an eye on.
We set up two Slack webhooks in Gitea (via the GUI). One has fe/** as filter, the other be/**, which matches the names of our branches and PRs.
Without the patch, both webhooks fire for any newly opened/edited/approved/rejected PR. With the fix I propose this is not the case and our devs only find the messages they are interested in their respective channel.
Description
Hi,
I noticed that
getPayloadBranch
doesn't work/returns an empty string when theapi.Payloader
is of type*api.PullRequestPayload
.Because of that I can't filter pull request related notifications (open/edit/reject/approve/merge) and send them to different channel in our slack
I fixed that issue in the following commit by using the head branch as relevant branch for the filter
lhemala@d78e63a
Before I open a PR I wanted to know if this functionality was left out intentionally, maybe because a PR has two branches to which the filter can be applied to (head and base) and therefore the filter might be ambiguous.
In my implementation I only filter for the head branch. If we'd want to filter for both the change would get bigger since the filtering logic only expects a single branch. (But still very much doable)
Relates to:
Enhancements of webhooks (#3998)
WebHooks: branch filter for push/pull request notifications (#2025)
The text was updated successfully, but these errors were encountered: