Open jvarness opened 8 years ago
Interesting. I don't really have that use case for the workflow we're using, but if it would be helpful I have no problem including it. The only downside would be there wouldn't be a way to disable it but still have push (I'm assuming, not familiar with testing for force push via webhook).
If you'd rather just have it for your install, you can always just fork the project and make a deployed
branch where you commit scripts specific for your install in the events
folder. Then when you want to update, just pull from upstream.
The way that I think it would work is this:
The webhook is setup to listen to push
events. When we receive one, we check to make sure of two things: 1.) the branch name is master, and 2.) the commit was force pushed.
We could also include configuration through environment variables that allows you to include which branch or branches you want to be notified of force pushes.
I wanted to get some opinions on this... Would it be a good idea to have a notifier script that warns of force pushes?
Github does have protection against force pushes, and has protected branches, but would it be useful to have a script that notifies users of a force push?