Skip to content

Commit 3d42c60

Browse files
committed
Support model
1 parent 6f08f56 commit 3d42c60

File tree

6 files changed

+16
-6
lines changed

6 files changed

+16
-6
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ Each example includes a complete workflow file that you can copy to your `.githu
7979
| `pull_number` | PR number for template context extraction | No | `${{ github.event.pull_request.number }}` |
8080
| `repo_name` | Repository name for template context | No | `${{ github.repository }}` |
8181
| `custom_context` | Additional JSON context for templates | No | `'{"priority": "high"}'` |
82+
| `model` | Model to use; passed through to auggie as --model | No | `gpt-4o-mini` |
8283

8384
\*Either `instruction`, `instruction_file`, or `template_directory` must be provided.
8485

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ inputs:
3737
custom_context:
3838
description: "Additional context data as JSON string to pass to templates."
3939
required: false
40+
model:
41+
description: "Model to use; forwarded to auggie as --model"
42+
required: false
4043

4144
runs:
4245
using: "composite"
@@ -67,3 +70,4 @@ runs:
6770
INPUT_PULL_NUMBER: ${{ inputs.pull_number }}
6871
INPUT_REPO_NAME: ${{ inputs.repo_name }}
6972
INPUT_CUSTOM_CONTEXT: ${{ inputs.custom_context }}
73+
INPUT_MODEL: ${{ inputs.model }}

src/config/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export const INPUT_FIELD_MAP: Record<string, InputField> = {
2424
repoName: { envVar: 'INPUT_REPO_NAME', required: false },
2525
templateDirectory: { envVar: 'INPUT_TEMPLATE_DIRECTORY', required: false },
2626
templateName: { envVar: 'INPUT_TEMPLATE_NAME', required: false },
27+
model: { envVar: 'INPUT_MODEL', required: false },
2728
};
2829

2930
export const TEMPLATE_CONFIG = {

src/index.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,19 @@ async function runAugmentScript(inputs: ActionInputs): Promise<void> {
113113
instructionFile: instruction_value,
114114
});
115115
}
116+
const args = ["--print"];
117+
if (inputs.model && inputs.model.trim().length > 0) {
118+
args.push('--model', inputs.model.trim());
119+
}
116120
if (is_file) {
117121
logger.info(`📄 Using instruction file: ${instruction_value}`);
118-
await execCommand('auggie', [
119-
'--instruction-file',
120-
instruction_value,
121-
'--print',
122-
]);
122+
args.push('--instruction-file');
123123
} else {
124124
logger.info('📝 Using direct instruction');
125-
await execCommand('auggie', ['--print', instruction_value]);
125+
args.push('--instruction');
126126
}
127+
args.push(instruction_value);
128+
await execCommand('auggie', args);
127129
logger.info('✅ Augment Agent completed successfully');
128130
}
129131

src/types/inputs.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export interface ActionInputs {
1616
githubToken?: string | undefined;
1717
instruction?: string | undefined;
1818
instructionFile?: string | undefined;
19+
model?: string | undefined;
1920

2021
// Template inputs
2122
templateDirectory?: string | undefined;

src/utils/validation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const ActionInputsSchema = z
1818
githubToken: z.string().optional(),
1919
instruction: z.string().optional(),
2020
instructionFile: z.string().optional(),
21+
model: z.string().optional(),
2122
templateDirectory: z.string().optional(),
2223
templateName: z.string().default('prompt.njk'),
2324
customContext: z.string().optional(),

0 commit comments

Comments
 (0)