diff --git a/README.md b/README.md index 3f3d79b..8bf9513 100644 --- a/README.md +++ b/README.md @@ -66,19 +66,20 @@ Each example includes a complete workflow file that you can copy to your `.githu ### Inputs -| Input | Description | Required | Example | -| ---------------------- | ----------------------------------------------------- | -------- | ----------------------------------------- | -| `augment_session_auth` | Augment session authentication JSON (store as secret) | No\*\* | `${{ secrets.AUGMENT_SESSION_AUTH }}` | -| `augment_api_token` | API token for Augment services (store as secret) | No\*\* | `${{ secrets.AUGMENT_API_TOKEN }}` | -| `augment_api_url` | Augment API endpoint URL (store as variable) | No\*\* | `${{ vars.AUGMENT_API_URL }}` | -| `github_token` | GitHub token with `repo` and `user:email` scopes. | No | `${{ secrets.GITHUB_TOKEN }}` | -| `instruction` | Direct instruction text for simple commands | No\* | `"Generate PR description"` | -| `instruction_file` | Path to file with detailed instructions | No\* | `/tmp/instruction.txt` | -| `template_directory` | Path to template directory for dynamic instructions | No\* | `.github/templates` | -| `template_name` | Template file name (default: prompt.njk) | No | `pr-review.njk` | -| `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"}'` | +| Input | Description | Required | Example | +| ---------------------- | ----------------------------------------------------- | -------- | ------------------------------------------- | +| `augment_session_auth` | Augment session authentication JSON (store as secret) | No\*\* | `${{ secrets.AUGMENT_SESSION_AUTH }}` | +| `augment_api_token` | API token for Augment services (store as secret) | No\*\* | `${{ secrets.AUGMENT_API_TOKEN }}` | +| `augment_api_url` | Augment API endpoint URL (store as variable) | No\*\* | `${{ vars.AUGMENT_API_URL }}` | +| `github_token` | GitHub token with `repo` and `user:email` scopes. | No | `${{ secrets.GITHUB_TOKEN }}` | +| `instruction` | Direct instruction text for simple commands | No\* | `"Generate PR description"` | +| `instruction_file` | Path to file with detailed instructions | No\* | `/tmp/instruction.txt` | +| `template_directory` | Path to template directory for dynamic instructions | No\* | `.github/templates` | +| `template_name` | Template file name (default: prompt.njk) | No | `pr-review.njk` | +| `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 | e.g. `sonnet4`, from `auggie --list-models` | \*Either `instruction`, `instruction_file`, or `template_directory` must be provided. diff --git a/action.yml b/action.yml index b48e93b..03f9c61 100644 --- a/action.yml +++ b/action.yml @@ -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" @@ -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 }} diff --git a/src/config/constants.ts b/src/config/constants.ts index 30a1b25..3776e3f 100644 --- a/src/config/constants.ts +++ b/src/config/constants.ts @@ -24,6 +24,7 @@ export const INPUT_FIELD_MAP: Record = { 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 = { diff --git a/src/index.ts b/src/index.ts index 9adc62b..ee639a0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -113,17 +113,19 @@ async function runAugmentScript(inputs: ActionInputs): Promise { 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'); } diff --git a/src/types/inputs.ts b/src/types/inputs.ts index 317882f..07fec62 100644 --- a/src/types/inputs.ts +++ b/src/types/inputs.ts @@ -16,6 +16,7 @@ export interface ActionInputs { githubToken?: string | undefined; instruction?: string | undefined; instructionFile?: string | undefined; + model?: string | undefined; // Template inputs templateDirectory?: string | undefined; diff --git a/src/utils/validation.ts b/src/utils/validation.ts index e937487..742cb89 100644 --- a/src/utils/validation.ts +++ b/src/utils/validation.ts @@ -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(),