Filter by branch name
Hello.
Is it possible to get notifications on specific branch only?
I tried to subscribe to pushes in master/devel branches and ignore other (usually WIP) pushes.
Hello @hanzei, I am interested in this issue, may I take this up?
Sure, thanks for taking a look @thoratvinod :+1:
Hi @hanzei ,
I have a question regarding the code. I've read through the codebase, and I noticed that when we run the command /github subscriptions add <repo>, it executes the handleSubscribesAdd method. However, I couldn't find the part in the code where we actually subscribe to the events. In the handleSubscribesAdd method, it seems like we are only adding subscriptions to the database as key-value pairs. Could you please let me know which file contains the code for subscribing to those events?
Hi @hanzei,
Thanks for reaching out. Plugin.handleSubscribesAdd calls Plugin.Subscribe. That methods saves to subscriptions to the KV sore. The Plugin.handleWebhook method, which is called when a webhook event from GH comes in, the fetches the list of subscriptions from the store in e.g. https://github.com/mattermost/mattermost-plugin-github/blob/cbad10e07638725b3028dc2225561a91ba3136c9/server/plugin/webhook.go#L732-L735.
Please let me know if that helps.