examples/service/commit-and-push.sh (456 bytes)
1 #!/bin/sh 2 # Example --exec hook for `aicr watch`: commit imported edits and conflict files 3 # in the source repo, scan them for secrets, push. Copy it into your source repo. 4 set -e 5 cd "$(dirname "$0")" 6 git add -A rules skills hooks aicr.toml 2>/dev/null || true 7 git diff --cached --quiet && exit 0 8 git commit -q -m "import: local edits from $(hostname)" 9 gitleaks git --no-banner --redact --log-opts="@{u}..HEAD" . # no push if a secret is found 10 git push -q