From b557fef80fbdb74926e3b9c9686b3bd907784d28 Mon Sep 17 00:00:00 2001 From: Justin Xu Date: Thu, 9 Oct 2025 00:02:40 +0000 Subject: [PATCH] Add optional fetch_depth parameter for performance optimization - Add fetch_depth input parameter to action.yml with default value of '0' - Document fetch_depth in README.md inputs table - Add Performance Optimization section to README.md explaining shallow clone benefits - Enables users to use shallow clones (fetch-depth: 1) for faster checkouts in large repos - Maintains backward compatibility with default full history behavior - Apply prettier formatting fixes to README.md --- README.md | 51 +++++++++++++++++++++++++++++++++++---------------- action.yml | 4 ++++ 2 files changed, 39 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 9084d8c..810108b 100644 --- a/README.md +++ b/README.md @@ -64,24 +64,43 @@ Each example includes a complete workflow file that you can copy to your `.githu ## Advanced +### Performance Optimization + +For large repositories with extensive history, you can significantly speed up the checkout process by using a shallow clone: + +```yaml +- uses: actions/checkout@v4 + with: + fetch-depth: 1 # Shallow clone for faster checkout +``` + +The `fetch-depth` parameter controls how much history is fetched: + +- `fetch-depth: 1` - Only the latest commit (fastest for most use cases) +- `fetch-depth: 50` - Last 50 commits (balance between speed and history) +- `fetch-depth: 0` - Full history (slowest but complete, default behavior) + +For most PR reviews and code analysis, a shallow clone (`fetch-depth: 1`) provides sufficient context while significantly reducing checkout time. + ### 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 | e.g. `sonnet4`, from `auggie --list-models` | -| `rules` | JSON array of rules file paths (each forwarded as individual `--rules` flags) | No | `'[".github/augment/rules.md"]'` | -| `mcp_configs` | JSON array of MCP config file paths (each forwarded as individual `--mcp-config` flags) | No | `'[".augment/mcp/config.json"]'` | +| 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` | +| `rules` | JSON array of rules file paths (each forwarded as individual `--rules` flags) | No | `'[".github/augment/rules.md"]'` | +| `mcp_configs` | JSON array of MCP config file paths (each forwarded as individual `--mcp-config` flags) | No | `'[".augment/mcp/config.json"]'` | +| `fetch_depth` | Number of commits to fetch. Use `0` for full history (default), `1` for shallow clone, or any positive integer for specific depth | No | `1` (shallow), `50` (last 50 commits), `0` (full) | \*Either `instruction`, `instruction_file`, or `template_directory` must be provided. diff --git a/action.yml b/action.yml index 46e9098..36e8fbd 100644 --- a/action.yml +++ b/action.yml @@ -49,6 +49,10 @@ inputs: mcp_configs: description: "JSON array of MCP config file paths. Each entry is forwarded to auggie as an individual --mcp-config flag." required: false + fetch_depth: + description: "Number of commits to fetch. Use '0' for full history (default), '1' for shallow clone (latest commit only), or any positive integer for a specific depth." + required: false + default: "0" runs: using: "composite"