feat: add Gitea actions workflow runs list and logs tools
This commit is contained in:
@@ -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()
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user