Fix repo slug
This commit is contained in:
committed by
pullfrog[bot]
parent
5604cf1868
commit
3fa309853b
@@ -0,0 +1,19 @@
|
||||
name: "Pullfrog Action (Dispatch)"
|
||||
description: "Execute coding agents with JSON payload input"
|
||||
author: "Pullfrog"
|
||||
|
||||
inputs:
|
||||
payload:
|
||||
description: "JSON payload containing prompt, event, and other configuration"
|
||||
required: true
|
||||
cwd:
|
||||
description: "Working directory for the agent (defaults to GITHUB_WORKSPACE)"
|
||||
required: false
|
||||
|
||||
runs:
|
||||
using: "node24"
|
||||
main: "entry"
|
||||
|
||||
branding:
|
||||
icon: "code"
|
||||
color: "green"
|
||||
Executable
+138885
File diff suppressed because one or more lines are too long
@@ -0,0 +1,55 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/**
|
||||
* entry point for pullfrog/pullfrog/dispatch - JSON payload input for internal use
|
||||
*/
|
||||
|
||||
import * as core from "@actions/core";
|
||||
import { Inputs, main } from "../main.ts";
|
||||
|
||||
async function run(): Promise<void> {
|
||||
try {
|
||||
const payloadStr = core.getInput("payload", { required: true });
|
||||
|
||||
// parse JSON payload
|
||||
let payload: unknown;
|
||||
try {
|
||||
payload = JSON.parse(payloadStr);
|
||||
} catch {
|
||||
throw new Error(`failed to parse payload as JSON: ${payloadStr.slice(0, 100)}...`);
|
||||
}
|
||||
|
||||
// validate and convert to Inputs
|
||||
if (typeof payload !== "object" || payload === null) {
|
||||
throw new Error("payload must be a JSON object");
|
||||
}
|
||||
|
||||
const payloadObj = payload as Record<string, unknown>;
|
||||
|
||||
// build inputs from payload fields
|
||||
const inputs = Inputs.assert({
|
||||
prompt: payloadObj.prompt,
|
||||
effort: payloadObj.effort,
|
||||
agent: payloadObj.agent,
|
||||
event: payloadObj.event,
|
||||
modes: payloadObj.modes,
|
||||
sandbox: payloadObj.sandbox,
|
||||
disableProgressComment: payloadObj.disableProgressComment,
|
||||
comment_id: payloadObj.comment_id,
|
||||
issue_id: payloadObj.issue_id,
|
||||
pr_id: payloadObj.pr_id,
|
||||
cwd: core.getInput("cwd") || undefined,
|
||||
});
|
||||
|
||||
const result = await main(inputs);
|
||||
|
||||
if (!result.success) {
|
||||
throw new Error(result.error || "Agent execution failed");
|
||||
}
|
||||
} catch (error) {
|
||||
const errorMessage = error instanceof Error ? error.message : "Unknown error occurred";
|
||||
core.setFailed(`Action failed: ${errorMessage}`);
|
||||
}
|
||||
}
|
||||
|
||||
await run();
|
||||
Reference in New Issue
Block a user