diff --git a/README.md b/README.md index a6365f7..15cbbfc 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