Git email hook to include commit message and changed files

冷暖自知 提交于 2019-12-12 10:46:13

问题


I set up the email hook for git in heroku. However, all i get is the message that something is pushed - i need both the commit message and the modified files.

#what i now get in the email:
noreply@heroku.com to me, hermantamas

xxx@gmail.com deployed app

#what i need:
noreply@heroku.com to me, hermantamas

xxx@gmail.com deployed app:

"home page is now working"
Changed:
- index.html
- javascript.js

回答1:


That would mean modifying the Heorku email hook directly to add some of those git log options (git log --name-status, git log --name-only, git log --stat or git whatchanged)

But since you may not have the possibility to change directly the hook script, you still can add one Heroku variable when defining said mail hook.

git_log: log of commits between this deploy and the last

$ heroku addons:add deployhooks:email \
    recipient=me@example.com \
    subject="Myapp Deployed" \
    body="{{user}} deployed app: {{git_log}}"
Adding deployhooks:email to myapp...Done.


来源:https://stackoverflow.com/questions/4406069/git-email-hook-to-include-commit-message-and-changed-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!