remcode
Version:
Turn your AI assistant into a codebase expert. Intelligent code analysis, semantic search, and software engineering guidance through MCP integration.
95 lines (94 loc) • 2.97 kB
TypeScript
import { GitHubClient } from './client';
export interface WorkflowRun {
id: number;
name?: string;
workflow_id?: number;
head_branch?: string;
head_sha?: string;
status: string;
conclusion: string | null;
created_at: string;
updated_at: string;
html_url?: string;
jobs_url?: string;
logs_url?: string;
run_number?: number;
run_attempt?: number;
display_title?: string;
}
export interface Workflow {
id: number;
name: string;
path: string;
state: string;
created_at: string;
updated_at: string;
url: string;
html_url: string;
badge_url: string;
}
export interface WorkflowJob {
id: number;
run_id: number;
name: string;
status: string;
conclusion: string | null;
started_at: string | null;
completed_at: string | null;
steps?: WorkflowStep[];
}
export interface WorkflowStep {
name: string;
status: string;
conclusion: string | null;
number: number;
started_at?: string;
completed_at?: string;
}
export declare class GitHubActions {
private client;
constructor(client: GitHubClient);
/**
* List workflows in a repository
*/
listWorkflows(owner: string, repo: string): Promise<Workflow[]>;
/**
* Get workflow by ID or filename
*/
getWorkflow(owner: string, repo: string, workflowIdOrFilename: string): Promise<Workflow>;
/**
* List workflow runs for a specific workflow or all workflows in a repo
*/
getWorkflowRuns(owner: string, repo: string, workflowId?: string, options?: {
branch?: string;
status?: 'completed' | 'action_required' | 'cancelled' | 'failure' | 'neutral' | 'skipped' | 'stale' | 'success' | 'timed_out' | 'in_progress' | 'queued' | 'requested' | 'waiting';
}): Promise<WorkflowRun[]>;
/**
* Trigger a workflow dispatch event
*/
triggerWorkflow(owner: string, repo: string, workflowId: string, ref?: string, inputs?: Record<string, any>): Promise<void>;
/**
* Get the status of a specific workflow run
*/
getWorkflowStatus(owner: string, repo: string, runId: number): Promise<WorkflowRun | null>;
/**
* Get jobs for a specific workflow run
*/
getWorkflowJobs(owner: string, repo: string, runId: number): Promise<WorkflowJob[]>;
/**
* Download workflow run logs
*/
downloadWorkflowLogs(owner: string, repo: string, runId: number): Promise<Buffer>;
/**
* Cancel a workflow run
*/
cancelWorkflowRun(owner: string, repo: string, runId: number): Promise<void>;
/**
* Re-run a workflow
*/
rerunWorkflow(owner: string, repo: string, runId: number, onlyFailedJobs?: boolean): Promise<void>;
/**
* Wait for a workflow run to complete, with polling and timeout
*/
waitForWorkflowCompletion(owner: string, repo: string, runId: number, timeoutMs?: number, pollIntervalMs?: number): Promise<WorkflowRun>;
}