From 6f32561e0ace8b9325808c8b8f15ddad013f4c7e Mon Sep 17 00:00:00 2001 From: Justin Xu Date: Wed, 8 Oct 2025 23:59:55 +0000 Subject: [PATCH 1/2] Add optional fetch_depth parameter for shallow clones --- README.md | 15 +++++++++++++++ action.yml | 6 +++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a6365f7..cc24587 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,7 @@ Each example includes a complete workflow file that you can copy to your `.githu | `model` | Optional model to use for generation | No | e.g. `sonnet4`, from `auggie --list-models` | | `rules` | JSON array of rules file paths forwarded to agent | No | `[".augment/rules.md"]` | | `mcp_configs` | JSON array of MCP config paths forwarded to agent | No | `[".augment/mcp.md"]` | +| `fetch_depth` | Optional fetch depth for git checkout (default: 0) | No | `10` for shallow clones, `0` for full history | ## How It Works @@ -92,6 +93,20 @@ Each example includes a complete workflow file that you can copy to your `.githu 4. **AI Processing**: Calls the Augment Agent to analyze the changes and generate a description 5. **PR Update**: The Augment Agent updates the PR description with the generated content +## Performance Optimization + +For large repositories with long history, you can use the `fetch_depth` parameter to speed up checkouts by limiting the git history fetched: + +```yaml +- name: Generate PR Description + uses: augmentcode/describe-pr@v0 + with: + # ... other inputs ... + fetch_depth: 50 # Only fetch last 50 commits +``` + +This can significantly reduce checkout time for repositories with extensive history while still providing enough context for PR description generation. + ## Custom Guidelines You can add project-specific guidelines to any workflow by including the `custom_guidelines` input: diff --git a/action.yml b/action.yml index b42a616..c2b56d2 100644 --- a/action.yml +++ b/action.yml @@ -30,6 +30,10 @@ inputs: mcp_configs: description: "Optional JSON array of MCP config file paths forwarded to augment-agent." required: false + fetch_depth: + description: "Optional fetch depth for git checkout. Default is 0 (full history). Set to a positive number for shallow clones." + required: false + default: "0" runs: using: "composite" @@ -39,7 +43,7 @@ runs: with: token: ${{ inputs.github_token }} ref: refs/pull/${{ inputs.pull_number }}/head - fetch-depth: 0 + fetch-depth: ${{ inputs.fetch_depth }} - name: Prepare Custom Context id: custom_context From 4e5c388da762e5b1e54e3973c3325bb5c6cd77e4 Mon Sep 17 00:00:00 2001 From: Justin Xu Date: Thu, 9 Oct 2025 00:02:35 +0000 Subject: [PATCH 2/2] Fix formatting issues in README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cc24587..15cbbfc 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ Each example includes a complete workflow file that you can copy to your `.githu | `model` | Optional model to use for generation | No | e.g. `sonnet4`, from `auggie --list-models` | | `rules` | JSON array of rules file paths forwarded to agent | No | `[".augment/rules.md"]` | | `mcp_configs` | JSON array of MCP config paths forwarded to agent | No | `[".augment/mcp.md"]` | -| `fetch_depth` | Optional fetch depth for git checkout (default: 0) | No | `10` for shallow clones, `0` for full history | +| `fetch_depth` | Optional fetch depth for git checkout (default: 0) | No | `10` for shallow clones, `0` for full history | ## How It Works @@ -102,7 +102,7 @@ For large repositories with long history, you can use the `fetch_depth` paramete uses: augmentcode/describe-pr@v0 with: # ... other inputs ... - fetch_depth: 50 # Only fetch last 50 commits + fetch_depth: 50 # Only fetch last 50 commits ``` This can significantly reduce checkout time for repositories with extensive history while still providing enough context for PR description generation.