Trigger CI pipeline and notify team after push.
## Claude Code Post-Push Hook
Configure Claude Code hooks for automatic post-push actions.
### .claude/hooks/post-push.json
```json
{
"hooks": {
"post-push": {
"description": "Trigger CI pipeline and notify team after push.",
"command": ".claude/scripts/post-push.sh",
"timeout": 30000,
"enabled": true
}
}
}
```
### .claude/scripts/post-push.sh
```bash
#!/bin/bash
set -e
echo "Running Post-Push hook..."
# Step 1: Validate environment
if [ -z "$PROJECT_ROOT" ]; then
PROJECT_ROOT=$(git rev-parse --show-toplevel)
fi
# Step 2: Run checks
cd "$PROJECT_ROOT"
# Run linting
npm run lint --quiet 2>/dev/null || echo "Lint warnings found"
# Run type checking
npm run typecheck 2>/dev/null || echo "Type errors found"
# Step 3: Report results
echo "Post-Push hook completed successfully"
```
### Setup
1. Create `.claude/hooks/` directory
2. Add the JSON config file
3. Create the shell script and make executable
4. Claude Code will run this automaticallyFree to copy and use. Compatible with Claude Code, Claude 4 Opus.
Copy this prompt into your Claude Code project. Customize bracketed variables for your specific setup.
Initial release
Sign in and download this prompt to leave a review.