0.0.1 • Published 3 years ago
git-commit-monitor v0.0.1
monitor assign files change when git push
- you should use it with husky git
- you can get the diff with last commit brefore commit
ueage
npm install gitMonitor -D
config in package.json
assign the files and use cli in husky
...
"repository": {
"type": "https",
"url": "https://xxxxxxxx",
"monitorFiles": [
"./package.json",
...
]
},
"husky": {
"hooks": {
...
"pre-commit": "gitMonitor './trigger.js'",
...
}
},
...
trigger function
- If you monitor files exposed JSON or object, you can get objectDiff in diffRes
- If you monitor files are not JSON or object, you can get stringDiff in diffRes
- you can send diff result to chat group in trigger
module.exports = function (diffRes) {
console.info(diffRes) // objectDiff 、stringDiff、branch、committer
.....
}
0.0.1
3 years ago