# Analyze current commit
commit-coach analyze
# Analyze specific commit
commit-coach analyze --commit abc123
# Different output formats
commit-coach analyze --output report > analysis.json
commit-coach analyze --output comment# Post to specific PR
commit-coach github --pr 123
# Auto-detect PR from commit
commit-coach github --commit abc123
# Only create status check (no comment)
commit-coach github --pr 123 --no-commentname: Commit Coach
on: [push, pull_request]
jobs:
commit-coach:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: your-org/commit-coach@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
config-path: '.commit-coach.yml' # optionalNote: Replace
your-org/commit-coach@v1with the actual action reference once published to the marketplace.
- name: Run Commit Coach
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ "${{ github.event_name }}" = "push" ]; then
pnpm run coach github -- --commit ${{ github.sha }}
fi
if [ "${{ github.event_name }}" = "pull_request" ]; then
pnpm run coach github -- --pr ${{ github.event.number }}
ficommit-coach:
stage: test
image: node:24
before_script:
- npm install -g pnpm
script:
- pnpm run coach github -- --commit $CI_COMMIT_SHA
only:
- merge_requests
- mainrules:
- id: security-check
enabled: true
severity: error
conditions: ["diff.includes('password')"]
message: "Potential password exposure detected"rules:
- id: frontend-tests
enabled: true
severity: warning
conditions: ["file.path.includes('src/components/') && !hasTestFile"]
message: "React components should have tests"