feat: add Gitea actions workflow runs list and logs tools

This commit is contained in:
2026-08-15 12:14:56 +02:00
parent ec45a86c27
commit eac2a61452
2 changed files with 40 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
import { tool } from "@opencode-ai/plugin"
import { $ } from "bun"
export default tool({
description: "List workflow runs for Gitea actions with optional filters",
args: {
status: tool.schema.string().optional().describe("Filter by status (success, failure, pending, queued, in_progress, skipped, canceled)"),
branch: tool.schema.string().optional().describe("Filter by branch name"),
event: tool.schema.string().optional().describe("Filter by event type (push, pull_request, etc.)"),
limit: tool.schema.number().optional().describe("Number of results to return (default: 30)"),
since: tool.schema.string().optional().describe("Show runs started after this time (e.g., '24h', '7d')"),
},
async execute(args) {
let cmd = [`tea`, `actions`, `runs`, `list`, `-o`, `json`]
if (args.status) cmd = [...cmd, `--status`, args.status]
if (args.branch) cmd = [...cmd, `--branch`, args.branch]
if (args.event) cmd = [...cmd, `--event`, args.event]
if (args.limit) cmd = [...cmd, `--limit`, String(args.limit)]
if (args.since) cmd = [...cmd, `--since`, args.since]
const result = await $`${cmd}`.text()
return result.trim()
},
})
+17
View File
@@ -0,0 +1,17 @@
import { tool } from "@opencode-ai/plugin"
import { $ } from "bun"
export default tool({
description: "Get logs for a specific Gitea actions workflow run to diagnose failures",
args: {
runId: tool.schema.number().describe("Workflow run ID to get logs for"),
job: tool.schema.string().optional().describe("Specific job ID to view (if omitted, shows all jobs)"),
},
async execute(args) {
let cmd = [`tea`, `actions`, `runs`, `logs`]
if (args.job) cmd = [...cmd, `--job`, args.job]
cmd = [...cmd, String(args.runId), `-o`, `simple`]
const result = await $`${cmd}`.text()
return result.trim()
},
})