Skip to content

Instantly share code, notes, and snippets.

@bserem
Created May 4, 2021 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bserem/25cedc950e00848f9d712e9a5d26c48a to your computer and use it in GitHub Desktop.
Save bserem/25cedc950e00848f9d712e9a5d26c48a to your computer and use it in GitHub Desktop.
Git hook to automatically add [skip ci] to commit message.
#!/bin/bash
exec < /dev/tty
read -n 1 -p "Would you like to run CI? (y/N) " ans;
ans=${ans:-n} # Default is no, always add [skip ci]
echo # Just add a new line
case $ans in
y|Y)
exit;;
n|N|*)
sed -i '$s/$/ [skip ci]/' $1;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment