Created
June 30, 2021 06:59
-
-
Save kougazhang/504b076c612a8038cabbad2e06f5c3cc to your computer and use it in GitHub Desktop.
使用git把diff结果写入文件,然后把该文件路径用飞书机器人通知 #shell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
root=<ProjectRoot> | |
pushd $root | |
diff=`git diff` | |
tm=`date +"%Y-%m-%d"` | |
file=$root/diff-history/$tm | |
echo $diff > $file | |
curl -X POST -H "Content-Type: application/json" \ | |
-d "{\"msg_type\":\"text\",\"content\":{\"text\":\"file://$file\"}}" \ | |
<飞书Api> | |
git add -A . | |
git commit -m "check@$tm" | |
git push origin master | |
popd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment