Skip to content

Commit 74d48ab

Browse files
authored
Add optional fetch_depth parameter for shallow clones (#8)
* Add optional fetch_depth parameter for shallow clones * Fix formatting issues in README.md
1 parent c2a2d9a commit 74d48ab

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Each example includes a complete workflow file that you can copy to your `.githu
8383
| `model` | Optional model to use for generation | No | e.g. `sonnet4`, from `auggie --list-models` |
8484
| `rules` | JSON array of rules file paths forwarded to agent | No | `[".augment/rules.md"]` |
8585
| `mcp_configs` | JSON array of MCP config paths forwarded to agent | No | `[".augment/mcp.md"]` |
86+
| `fetch_depth` | Optional fetch depth for git checkout (default: 0) | No | `10` for shallow clones, `0` for full history |
8687

8788
## How It Works
8889

@@ -92,6 +93,20 @@ Each example includes a complete workflow file that you can copy to your `.githu
9293
4. **AI Processing**: Calls the Augment Agent to analyze the changes and generate a description
9394
5. **PR Update**: The Augment Agent updates the PR description with the generated content
9495

96+
## Performance Optimization
97+
98+
For large repositories with long history, you can use the `fetch_depth` parameter to speed up checkouts by limiting the git history fetched:
99+
100+
```yaml
101+
- name: Generate PR Description
102+
uses: augmentcode/describe-pr@v0
103+
with:
104+
# ... other inputs ...
105+
fetch_depth: 50 # Only fetch last 50 commits
106+
```
107+
108+
This can significantly reduce checkout time for repositories with extensive history while still providing enough context for PR description generation.
109+
95110
## Custom Guidelines
96111
97112
You can add project-specific guidelines to any workflow by including the `custom_guidelines` input:

action.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ inputs:
3030
mcp_configs:
3131
description: "Optional JSON array of MCP config file paths forwarded to augment-agent."
3232
required: false
33+
fetch_depth:
34+
description: "Optional fetch depth for git checkout. Default is 0 (full history). Set to a positive number for shallow clones."
35+
required: false
36+
default: "0"
3337

3438
runs:
3539
using: "composite"
@@ -39,7 +43,7 @@ runs:
3943
with:
4044
token: ${{ inputs.github_token }}
4145
ref: refs/pull/${{ inputs.pull_number }}/head
42-
fetch-depth: 0
46+
fetch-depth: ${{ inputs.fetch_depth }}
4347

4448
- name: Prepare Custom Context
4549
id: custom_context

0 commit comments

Comments
 (0)