Skip to content

Conversation

@bcherny
Copy link

@bcherny bcherny commented Jan 1, 2026

Summary

Add support for push events as an automation event type, enabling workflows triggered by pushes to use claude-code-action.

Changes

  • Add PushEvent import from @octokit/webhooks-types
  • Add "push" to AUTOMATION_EVENT_NAMES array
  • Add PushEvent to AutomationContext payload union type
  • Add case "push": handler in parseGitHubContext()
  • Add isPushEvent() type guard function
  • Add documentation for push events with auto-rebase example
  • Add tests for push event mode detection and isPushEvent type guard

Testing

  • All 551 tests pass
  • Typecheck passes
  • Format check passes

Push events are treated as automation events (like workflow_dispatch, schedule, etc.) and default to agent mode.


🤖 Generated with Claude Code

Add support for `push` events as an automation event type, enabling
workflows triggered by pushes to use claude-code-action.

Changes:
- Add PushEvent to automation event types in context.ts
- Add case handler for push events in parseGitHubContext()
- Add isPushEvent() type guard
- Add test for push event mode detection

This enables use cases like auto-rebasing PRs when main is updated,
where a workflow triggers on push to main and uses a prompt to
instruct Claude to merge main into stale PR branches.
@bcherny bcherny enabled auto-merge (squash) January 1, 2026 21:16
Address code review feedback:
- Add push event to supported events list in docs/custom-automations.md
- Add auto-rebase example workflow using push events
- Add tests for isPushEvent type guard
- Add tests for push event mode detection
- Add test to verify track_progress throws error for push events

🤖 Generated with [Claude Code](https://claude.ai/code)
@bcherny
Copy link
Author

bcherny commented Jan 1, 2026

🤖 PR feedback addressed:

  • Added push to the supported events list in documentation
  • Added auto-rebase example workflow showing push event usage
  • Added tests for isPushEvent type guard (3 test cases)
  • Added tests for push event mode detection and track_progress validation

🤖 Generated with Claude Code

@bcherny bcherny requested a review from ashwin-ant January 1, 2026 21:29
@bcherny bcherny closed this Jan 1, 2026
auto-merge was automatically disabled January 1, 2026 23:52

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants