Created
October 30, 2019 19:40
-
-
Save sdwvit/b4138e74e1ac5437a7756d2cede7f66a to your computer and use it in GitHub Desktop.
Generate cacheable key for CI depending on versioned files diff
This file contains 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/sh | |
a="$(git diff master... --numstat | awk 'NF==3 {total+=$1+$2} END {printf("%d\n", total)}')" \ | |
if [ "$a" -gt 100 ] | |
then | |
echo "bust $(date +%s)" > gitdiff | |
else | |
echo "keep" > gitdiff | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Some parameters:
100
- describes number of lines changed threshold.gitdiff
- filepath for partial key, editablebust/keep
- editableUsage example: