18 lines
634 B
TypeScript
18 lines
634 B
TypeScript
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()
|
|
},
|
|
})
|