Is there a way to notify people on change of some certain files? Specifically, I would like to track change of *.sql files and and notify our developers on a change. How can I configure post commit hooks to notify?
In the left sidebar, under the list of repositories, use the "Manage notifications" drop-down to click Notification settings. On the notifications settings page, choose how you receive notifications when: There are updates in repositories or team discussions you're watching or in a conversation you're participating in.
On GitHub.com, navigate to the main page of the repository. Under your repository name, click Settings. In the "Integrations" section of the sidebar, click Email notifications. Type up to two email addresses, separated by whitespace, where you'd like notifications to be sent.
There are no ways to do it because GitHub delivers only two kinds of notifications: Participating: Someone mentions you or a team you're a member of. You are assigned to an issue or pull request.
### Notifications permission If you want to receive desktop notifications, you can enable them on extension options page. You will then be asked for the notifications permission.
If you want folks to get notified via email, and you want them to manage their own notifications, then https://app.github-file-watcher.com/ should do the trick - it monitors any public repo, and will notify you via email of changes to any file, a specific file, or some files that match your criteria.
Use git diff-tree
in your post-receive hook:
git diff-tree --name-status -rz
You can grep the result to check if certain files are modified (status 'M
'), as described in this answer.
you can find many examples on gist.github.com
, with this one using the --name-status
option.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With