EventContext
Complete context about a GitHub event triggering Warden analysis.Type of GitHub event:
"pull_request"- PR opened, updated, or closed"issues"- Issue opened, edited, or closed"issue_comment"- Comment on issue or PR"pull_request_review"- PR review submitted"pull_request_review_comment"- Comment on PR diff"schedule"- Scheduled cron trigger
Specific action within the event type (e.g.,
"opened", "synchronize", "reopened", "closed")Information about the repository where the event occurred
Pull request details (only present for PR-related events)
Absolute path to the local repository checkout
PullRequestContext
Detailed information about a pull request.PR number (must be a positive integer)
PR title
PR description body (null if empty)
GitHub username of the PR author
Target branch name (e.g.,
"main", "develop")Source branch name (e.g.,
"feature/new-auth")Git commit SHA of the head branch (latest commit in the PR)
Git commit SHA of the base branch (merge target)
List of all files changed in the PR
RepositoryContext
Information about a GitHub repository.Repository owner username or organization name
Repository name (without owner)
Full repository name in
owner/name format (e.g., "sentry/warden")Default branch name (e.g.,
"main", "master", "develop")FileChange
Information about a single file changed in a pull request.Path to the file relative to repository root
Type of change:
"added"- New file"removed"- Deleted file"modified"- Changed file"renamed"- File moved/renamed"copied"- File copied"changed"- Generic change"unchanged"- No changes (rare)
Number of lines added (must be non-negative)
Number of lines deleted (must be non-negative)
Unified diff patch showing the changes. May be absent for binary files or very large diffs.
Number of diff hunks in the patch (calculated automatically if patch is present)
GitHubEventType
Supported GitHub event types:PullRequestAction
Common pull request actions:Example: Pull Request Event Context
Example: Schedule Event Context
Building Event Context
Warden automatically constructs event context from GitHub Actions environment:When running locally via CLI, Warden synthesizes a minimal event context based on the current git state.
Utility: Counting Patch Chunks
Warden provides a utility to count hunks in a patch:Validation
All context types are validated using Zod schemas:Warden validates all GitHub event payloads to ensure they contain required fields. Invalid payloads will cause analysis to fail early with clear error messages.