Skip to content

feat(hooks): let git-push-approval allow feature-branch pushes in autopilot sessions #228

Closed

Description

@DevSecNinja

Problem

The git-push-approval hook (#222) blocks pushes from agent sessions running in autopilot, because there's no interactive prompt where the owner can approve them. On 2026-11-13 the owner approved a force-push of the #226 rebase, but the hook still blocked it. The session had to be switched to interactive mode before the push could go through.

This affects any autopilot session that rebases or pushes its own PR branch, which is a routine step in the PR workflow (rebases after a squash merge, review fixes).

Proposed solution

  • Let the hook allow pushes to a session's own non-default feature branch (not main or the default branch, never with --force without --with-lease) without a prompt, while still prompting or denying for pushes to protected or default branches.
  • Alternatively, support an explicit pre-approval, such as an environment variable or file the owner sets per session, that the hook honours in autopilot.
  • Document the behaviour and how to approve pushes in autopilot.

Alternatives considered

  • Switching every session to interactive mode for pushes: this defeats unattended autopilot work.
  • Disabling the hook: this removes the safety net for pushes to main.

Activity

  1. added a commit that references this issue on Nov 13, 2026
    1af43da
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions