claude-code-gitea-action/src/create-prompt/types.ts
claude (ops) 32685a740f
Some checks failed
Test Custom Executables / test-custom-executables (push) Has been cancelled
CI / test (push) Has been cancelled
CI / prettier (push) Has been cancelled
CI / typecheck (push) Has been cancelled
Sync Base Action to claude-code-base-action / Sync base-action to claude-code-base-action repository (push) Has been cancelled
Test Claude Code Action / test-inline-prompt (push) Has been cancelled
Test Claude Code Action / test-prompt-file (push) Has been cancelled
Test Claude Env Feature / test-claude-env-with-comments (push) Has been cancelled
Test MCP Servers / test-mcp-integration (push) Has been cancelled
Test MCP Servers / test-mcp-config-flag (push) Has been cancelled
Test Settings Feature / test-settings-inline-allow (push) Has been cancelled
Test Settings Feature / test-settings-inline-deny (push) Has been cancelled
Test Settings Feature / test-settings-file-allow (push) Has been cancelled
Test Settings Feature / test-settings-file-deny (push) Has been cancelled
Forgejo-patched claude-code-gitea-action (View-job URL uses per-repo run index)
Fork of markwylde/claude-code-gitea-action@b744372 (v1.0.21) with the
'View job' link fixed to use GITHUB_RUN_NUMBER (per-repo index) instead of
GITHUB_RUN_ID (global id), because Forgejo routes run pages by per-repo index.
See VENDOR.txt.
2026-07-01 06:42:55 +00:00

105 lines
2.3 KiB
TypeScript

export type CommonFields = {
repository: string;
claudeCommentId: string;
triggerPhrase: string;
triggerUsername?: string;
customInstructions?: string;
allowedTools?: string;
disallowedTools?: string;
directPrompt?: string;
overridePrompt?: string;
};
type PullRequestReviewCommentEvent = {
eventName: "pull_request_review_comment";
isPR: true;
prNumber: string;
commentId?: string; // May be present for review comments
commentBody: string;
claudeBranch?: string;
baseBranch?: string;
};
type PullRequestReviewEvent = {
eventName: "pull_request_review";
isPR: true;
prNumber: string;
commentBody: string;
claudeBranch?: string;
baseBranch?: string;
};
type IssueCommentEvent = {
eventName: "issue_comment";
commentId: string;
issueNumber: string;
isPR: false;
baseBranch: string;
claudeBranch?: string;
commentBody: string;
};
// Not actually a real github event, since issue comments and PR coments are both sent as issue_comment
type PullRequestCommentEvent = {
eventName: "issue_comment";
commentId: string;
prNumber: string;
isPR: true;
commentBody: string;
claudeBranch?: string;
baseBranch?: string;
};
type IssueOpenedEvent = {
eventName: "issues";
eventAction: "opened";
isPR: false;
issueNumber: string;
baseBranch: string;
claudeBranch?: string;
};
type IssueAssignedEvent = {
eventName: "issues";
eventAction: "assigned";
isPR: false;
issueNumber: string;
baseBranch: string;
claudeBranch?: string;
assigneeTrigger?: string;
};
type IssueLabeledEvent = {
eventName: "issues";
eventAction: "labeled";
isPR: false;
issueNumber: string;
baseBranch: string;
claudeBranch?: string;
labelTrigger: string;
};
type PullRequestEvent = {
eventName: "pull_request";
eventAction?: string; // opened, synchronize, etc.
isPR: true;
prNumber: string;
claudeBranch?: string;
baseBranch?: string;
};
// Union type for all possible event types
export type EventData =
| PullRequestReviewCommentEvent
| PullRequestReviewEvent
| PullRequestCommentEvent
| IssueCommentEvent
| IssueOpenedEvent
| IssueAssignedEvent
| IssueLabeledEvent
| PullRequestEvent;
// Combined type with separate eventData field
export type PreparedContext = CommonFields & {
eventData: EventData;
};