Make token configurable

This commit is contained in:
Sean Goedecke
2025-04-07 04:53:19 +00:00
parent fbd6a39716
commit 32ebbe708a
5 changed files with 27 additions and 18 deletions
+4 -4
View File
@@ -14,11 +14,11 @@ export async function run(): Promise<void> {
throw new Error('prompt is not set')
}
const systemPrompt: string = core.getInput('system_prompt')
const systemPrompt: string = core.getInput('system-prompt')
const modelName: string = core.getInput('model')
const maxTokens: number = parseInt(core.getInput('max_tokens'), 10)
const maxTokens: number = parseInt(core.getInput('max-tokens'), 10)
const token = process.env['GITHUB_TOKEN']
const token = core.getInput('token') || process.env['GITHUB_TOKEN']
if (token === undefined) {
throw new Error('GITHUB_TOKEN is not set')
}
@@ -31,7 +31,7 @@ export async function run(): Promise<void> {
messages: [
{
role: 'system',
content: systemPrompt || 'You are a helpful assistant.'
content: systemPrompt
},
{ role: 'user', content: prompt }
],