From 3d42c606ab08f6141473515ca85ca4a21ce4f082 Mon Sep 17 00:00:00 2001 From: Nathan Rockenbach Date: Mon, 11 Aug 2025 04:44:30 +0000 Subject: [PATCH 1/3] Support model --- README.md | 1 + action.yml | 4 ++++ src/config/constants.ts | 1 + src/index.ts | 14 ++++++++------ src/types/inputs.ts | 1 + src/utils/validation.ts | 1 + 6 files changed, 16 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3f3d79b..0ee7ed5 100644 --- a/README.md +++ b/README.md @@ -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. 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..d22d3e2 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(), From f5a9d26bb490424fe154df0c9a6d51d6ddc0eabf Mon Sep 17 00:00:00 2001 From: Nathan Rockenbach Date: Mon, 11 Aug 2025 04:45:44 +0000 Subject: [PATCH 2/3] Format --- README.md | 2 +- src/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0ee7ed5..83ce954 100644 --- a/README.md +++ b/README.md @@ -79,7 +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` | +| `model` | Model to use; passed through to auggie as --model | No | `gpt-4o-mini` | \*Either `instruction`, `instruction_file`, or `template_directory` must be provided. diff --git a/src/index.ts b/src/index.ts index d22d3e2..ee639a0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -113,7 +113,7 @@ async function runAugmentScript(inputs: ActionInputs): Promise { instructionFile: instruction_value, }); } - const args = ["--print"]; + const args = ['--print']; if (inputs.model && inputs.model.trim().length > 0) { args.push('--model', inputs.model.trim()); } From a5a85b1f013f3dcea68021f98c6361aa58e994b8 Mon Sep 17 00:00:00 2001 From: Nathan Rockenbach Date: Mon, 11 Aug 2025 18:11:39 +0000 Subject: [PATCH 3/3] Update example --- README.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 83ce954..8bf9513 100644 --- a/README.md +++ b/README.md @@ -66,20 +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"}'` | -| `model` | Model to use; passed through to auggie as --model | No | `gpt-4o-mini` | +| 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.