Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ Each example includes a complete workflow file that you can copy to your `.githu
| `pull_number` | PR number for template context extraction | No | `${{ github.event.pull_request.number }}` |
| `repo_name` | Repository name for template context | No | `${{ github.repository }}` |
| `custom_context` | Additional JSON context for templates | No | `'{"priority": "high"}'` |
| `model` | Model to use; passed through to auggie as --model | No | `gpt-4o-mini` |

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

Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ inputs:
custom_context:
description: "Additional context data as JSON string to pass to templates."
required: false
model:
description: "Model to use; forwarded to auggie as --model"
required: false

runs:
using: "composite"
Expand Down Expand Up @@ -67,3 +70,4 @@ runs:
INPUT_PULL_NUMBER: ${{ inputs.pull_number }}
INPUT_REPO_NAME: ${{ inputs.repo_name }}
INPUT_CUSTOM_CONTEXT: ${{ inputs.custom_context }}
INPUT_MODEL: ${{ inputs.model }}
1 change: 1 addition & 0 deletions src/config/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const INPUT_FIELD_MAP: Record<string, InputField> = {
repoName: { envVar: 'INPUT_REPO_NAME', required: false },
templateDirectory: { envVar: 'INPUT_TEMPLATE_DIRECTORY', required: false },
templateName: { envVar: 'INPUT_TEMPLATE_NAME', required: false },
model: { envVar: 'INPUT_MODEL', required: false },
};

export const TEMPLATE_CONFIG = {
Expand Down
14 changes: 8 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,19 @@ async function runAugmentScript(inputs: ActionInputs): Promise<void> {
instructionFile: instruction_value,
});
}
const args = ['--print'];
if (inputs.model && inputs.model.trim().length > 0) {
args.push('--model', inputs.model.trim());
}
if (is_file) {
logger.info(`📄 Using instruction file: ${instruction_value}`);
await execCommand('auggie', [
'--instruction-file',
instruction_value,
'--print',
]);
args.push('--instruction-file');
} else {
logger.info('📝 Using direct instruction');
await execCommand('auggie', ['--print', instruction_value]);
args.push('--instruction');
}
args.push(instruction_value);
await execCommand('auggie', args);
logger.info('✅ Augment Agent completed successfully');
}

Expand Down
1 change: 1 addition & 0 deletions src/types/inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface ActionInputs {
githubToken?: string | undefined;
instruction?: string | undefined;
instructionFile?: string | undefined;
model?: string | undefined;

// Template inputs
templateDirectory?: string | undefined;
Expand Down
1 change: 1 addition & 0 deletions src/utils/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const ActionInputsSchema = z
githubToken: z.string().optional(),
instruction: z.string().optional(),
instructionFile: z.string().optional(),
model: z.string().optional(),
templateDirectory: z.string().optional(),
templateName: z.string().default('prompt.njk'),
customContext: z.string().optional(),
Expand Down