Skip to content

Instantly share code, notes, and snippets.

@skateman
Created June 24, 2023 14:30
Show Gist options
  • Save skateman/57e174c63d99ae56d3359578202c0de5 to your computer and use it in GitHub Desktop.
Save skateman/57e174c63d99ae56d3359578202c0de5 to your computer and use it in GitHub Desktop.
Git hook that detects Gemfile.lock changes
#!/bin/bash
RED='\033[0;31m'
NC='\033[0m' # No Color
MESSAGE="${RED}Changes detected in the Gemfile.lock, consider rebuilding your container image.${NC}"
if [[ $3 == 1 ]]; then
git diff --quiet $1 $2 -- Gemfile.lock || echo -e $MESSAGE
fi;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment