1 2 3 4 5 6 7 8
#!/usr/bin/env bash set -euo pipefail branch="$(git symbolic-ref --quiet --short HEAD || true)" if [ "$branch" = "main" ]; then echo "ERROR: Direct commits to main are blocked. Create a feature branch." exit 1 fi