8bac460177
* fix: add concurrency protection to action sync workflows * style: fix formatting in action/modes.ts --------- Co-authored-by: pullfrog[bot] <226033991+pullfrog[bot]@users.noreply.github.com>
30 lines
874 B
JavaScript
30 lines
874 B
JavaScript
#!/usr/bin/env node
|
|
|
|
/**
|
|
* entry point for pullfrog/pullfrog - unified action
|
|
*/
|
|
|
|
import { dirname } from "node:path";
|
|
import * as core from "@actions/core";
|
|
import { main } from "./main.ts";
|
|
|
|
// GitHub Actions runs the action entry point with the node24 binary specified
|
|
// in action.yml, but doesn't add that binary's directory to PATH. Without this,
|
|
// spawned processes (pnpm, npm, etc.) resolve to the runner's default node (v20).
|
|
process.env.PATH = `${dirname(process.execPath)}:${process.env.PATH}`;
|
|
|
|
async function run(): Promise<void> {
|
|
try {
|
|
const result = await main();
|
|
|
|
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();
|