fix input type

This commit is contained in:
David Blass
2025-09-24 13:52:18 -04:00
parent e13c5eed00
commit ff1226a824
2 changed files with 6 additions and 8 deletions
+2 -2
View File
@@ -26005,13 +26005,13 @@ async function setupGitHubInstallationToken() {
async function run() { async function run() {
try { try {
const prompt = core4.getInput("prompt", { required: true }); const prompt = core4.getInput("prompt", { required: true });
const anthropicApiKey = core4.getInput("anthropic_api_key"); const anthropic_api_key = core4.getInput("anthropic_api_key");
if (!prompt) { if (!prompt) {
throw new Error("prompt is required"); throw new Error("prompt is required");
} }
const inputs = { const inputs = {
prompt, prompt,
anthropic_api_key: anthropicApiKey anthropic_api_key
}; };
const githubToken = core4.getInput("github_token") || process.env.GITHUB_TOKEN; const githubToken = core4.getInput("github_token") || process.env.GITHUB_TOKEN;
if (githubToken) { if (githubToken) {
+4 -6
View File
@@ -6,23 +6,23 @@
*/ */
import * as core from "@actions/core"; import * as core from "@actions/core";
import { type MainParams, main } from "./main.ts"; import { type ExecutionInputs, type MainParams, main } from "./main.ts";
import { setupGitHubInstallationToken } from "./utils/github.ts"; import { setupGitHubInstallationToken } from "./utils/github.ts";
async function run(): Promise<void> { async function run(): Promise<void> {
try { try {
// Get inputs from GitHub Actions // Get inputs from GitHub Actions
const prompt = core.getInput("prompt", { required: true }); const prompt = core.getInput("prompt", { required: true });
const anthropicApiKey = core.getInput("anthropic_api_key"); const anthropic_api_key = core.getInput("anthropic_api_key");
if (!prompt) { if (!prompt) {
throw new Error("prompt is required"); throw new Error("prompt is required");
} }
// Create params object with new structure // Create params object with new structure
const inputs: any = { const inputs: ExecutionInputs = {
prompt, prompt,
anthropic_api_key: anthropicApiKey, anthropic_api_key,
}; };
// Add optional properties only if they exist // Add optional properties only if they exist
@@ -36,7 +36,6 @@ async function run(): Promise<void> {
if (githubInstallationToken) { if (githubInstallationToken) {
inputs.github_installation_token = githubInstallationToken; inputs.github_installation_token = githubInstallationToken;
} else { } else {
// Setup GitHub installation token
await setupGitHubInstallationToken(); await setupGitHubInstallationToken();
} }
@@ -46,7 +45,6 @@ async function run(): Promise<void> {
cwd: process.cwd(), cwd: process.cwd(),
}; };
// Run the main function
const result = await main(params); const result = await main(params);
// TODO: Set outputs // TODO: Set outputs