Skip to content

v1.3.0: Git hooks for quality enforcement

Choose a tag to compare

@cv cv released this 04 Jan 07:30
· 72 commits to main since this release
b512c68

Features

Git Hooks for the Agent

The action now automatically installs lightweight, standalone git hooks in target repositories before running the pi agent:

  • commit-msg: Enforces Conventional Commits format
  • prepare-commit-msg: Auto-appends issue numbers from branch names

These hooks:

  • ✅ Have no dependencies - pure shell scripts
  • ✅ Work with any language/stack (Python, Go, Rust, etc.)
  • ✅ Respect existing hooks - only install if no hook exists
  • ✅ Don't modify package.json or install npm packages

Development Quality (for pi-action contributors)

  • Add Husky + commitlint for enforcing commit conventions
  • Pre-commit hook: tests, typecheck, lint, build verification, dist/ freshness check
  • Pre-push hook: coverage thresholds (80% lines/functions, 70% branches)

Refactoring

From issue #10:

  • Extract shared types (GitHubReaction, GitHubUser, AgentResult)
  • Add test helpers (createMockGitHubClient, createTriggerInfo)
  • Extract utility functions (getErrorMessage, formatSuccessComment, formatErrorComment)
  • Use discriminated union for AgentResult (makes invalid states unrepresentable)
  • Handle empty agent responses
  • Clear timeout timer on success

Usage

- uses: cv/pi-action@v1.3.0
  with:
    github_token: ${{ secrets.GITHUB_TOKEN }}
    pi_auth_json: ${{ secrets.PI_AUTH_JSON }}