feat(gitea): add Actions API support: list filters, run/job endpoints, dispatch, and richer types
This commit is contained in:
@@ -1,3 +1,37 @@
|
||||
// ---------------------------------------------------------------------------
|
||||
// Common
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export interface ITestConnectionResult {
|
||||
ok: boolean;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
export interface IListOptions {
|
||||
search?: string;
|
||||
page?: number;
|
||||
perPage?: number;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Action Run list options
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export interface IActionRunListOptions extends IListOptions {
|
||||
/** Filter by run status (waiting, running, success, failure, cancelled) */
|
||||
status?: string;
|
||||
/** Filter by head branch */
|
||||
branch?: string;
|
||||
/** Filter by trigger event (push, pull_request, schedule, workflow_dispatch, …) */
|
||||
event?: string;
|
||||
/** Filter by the user who triggered the run */
|
||||
actor?: string;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Users
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export interface IGiteaUser {
|
||||
id: number;
|
||||
login: string;
|
||||
@@ -6,6 +40,10 @@ export interface IGiteaUser {
|
||||
avatar_url: string;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Repositories
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export interface IGiteaRepository {
|
||||
id: number;
|
||||
name: string;
|
||||
@@ -23,6 +61,10 @@ export interface IGiteaRepository {
|
||||
};
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Organizations
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export interface IGiteaOrganization {
|
||||
id: number;
|
||||
name: string;
|
||||
@@ -32,32 +74,86 @@ export interface IGiteaOrganization {
|
||||
repo_count: number;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Secrets
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export interface IGiteaSecret {
|
||||
name: string;
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Action Runs
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export interface IGiteaActionRun {
|
||||
id: number;
|
||||
name: string;
|
||||
workflow_id: string;
|
||||
status: string;
|
||||
conclusion: string;
|
||||
head_branch: string;
|
||||
head_sha: string;
|
||||
html_url: string;
|
||||
event: string;
|
||||
run_number: number;
|
||||
run_attempt: number;
|
||||
run_duration: number;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
started_at: string;
|
||||
actor: IGiteaUser;
|
||||
trigger_actor: IGiteaUser;
|
||||
repository: {
|
||||
id: number;
|
||||
name: string;
|
||||
full_name: string;
|
||||
html_url: string;
|
||||
};
|
||||
head_commit: {
|
||||
id: string;
|
||||
message: string;
|
||||
timestamp: string;
|
||||
};
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Action Run Jobs
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export interface IGiteaActionRunJob {
|
||||
id: number;
|
||||
run_id: number;
|
||||
name: string;
|
||||
workflow_name: string;
|
||||
head_branch: string;
|
||||
head_sha: string;
|
||||
status: string;
|
||||
conclusion: string;
|
||||
html_url: string;
|
||||
run_duration: number;
|
||||
started_at: string;
|
||||
completed_at: string;
|
||||
steps: IGiteaActionRunJobStep[];
|
||||
labels: string[];
|
||||
runner_id: number;
|
||||
runner_name: string;
|
||||
}
|
||||
|
||||
export interface IGiteaActionRunJobStep {
|
||||
name: string;
|
||||
number: number;
|
||||
status: string;
|
||||
conclusion: string;
|
||||
started_at: string;
|
||||
completed_at: string;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Branches & Tags
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export interface IGiteaBranch {
|
||||
name: string;
|
||||
commit: {
|
||||
@@ -72,14 +168,3 @@ export interface IGiteaTag {
|
||||
sha: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface ITestConnectionResult {
|
||||
ok: boolean;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
export interface IListOptions {
|
||||
search?: string;
|
||||
page?: number;
|
||||
perPage?: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user