Skip to content

Commit b557fef

Browse files
committed
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
1 parent 3fbe40c commit b557fef

File tree

2 files changed

+39
-16
lines changed

2 files changed

+39
-16
lines changed

README.md

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -64,24 +64,43 @@ Each example includes a complete workflow file that you can copy to your `.githu
6464

6565
## Advanced
6666

67+
### Performance Optimization
68+
69+
For large repositories with extensive history, you can significantly speed up the checkout process by using a shallow clone:
70+
71+
```yaml
72+
- uses: actions/checkout@v4
73+
with:
74+
fetch-depth: 1 # Shallow clone for faster checkout
75+
```
76+
77+
The `fetch-depth` parameter controls how much history is fetched:
78+
79+
- `fetch-depth: 1` - Only the latest commit (fastest for most use cases)
80+
- `fetch-depth: 50` - Last 50 commits (balance between speed and history)
81+
- `fetch-depth: 0` - Full history (slowest but complete, default behavior)
82+
83+
For most PR reviews and code analysis, a shallow clone (`fetch-depth: 1`) provides sufficient context while significantly reducing checkout time.
84+
6785
### Inputs
6886

69-
| Input | Description | Required | Example |
70-
| ---------------------- | --------------------------------------------------------------------------------------- | -------- | ------------------------------------------- |
71-
| `augment_session_auth` | Augment session authentication JSON (store as secret) | No\*\* | `${{ secrets.AUGMENT_SESSION_AUTH }}` |
72-
| `augment_api_token` | API token for Augment services (store as secret) | No\*\* | `${{ secrets.AUGMENT_API_TOKEN }}` |
73-
| `augment_api_url` | Augment API endpoint URL (store as variable) | No\*\* | `${{ vars.AUGMENT_API_URL }}` |
74-
| `github_token` | GitHub token with `repo` and `user:email` scopes. | No | `${{ secrets.GITHUB_TOKEN }}` |
75-
| `instruction` | Direct instruction text for simple commands | No\* | `"Generate PR description"` |
76-
| `instruction_file` | Path to file with detailed instructions | No\* | `/tmp/instruction.txt` |
77-
| `template_directory` | Path to template directory for dynamic instructions | No\* | `.github/templates` |
78-
| `template_name` | Template file name (default: prompt.njk) | No | `pr-review.njk` |
79-
| `pull_number` | PR number for template context extraction | No | `${{ github.event.pull_request.number }}` |
80-
| `repo_name` | Repository name for template context | No | `${{ github.repository }}` |
81-
| `custom_context` | Additional JSON context for templates | No | `'{"priority": "high"}'` |
82-
| `model` | Model to use; passed through to auggie as --model | No | e.g. `sonnet4`, from `auggie --list-models` |
83-
| `rules` | JSON array of rules file paths (each forwarded as individual `--rules` flags) | No | `'[".github/augment/rules.md"]'` |
84-
| `mcp_configs` | JSON array of MCP config file paths (each forwarded as individual `--mcp-config` flags) | No | `'[".augment/mcp/config.json"]'` |
87+
| Input | Description | Required | Example |
88+
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------- |
89+
| `augment_session_auth` | Augment session authentication JSON (store as secret) | No\*\* | `${{ secrets.AUGMENT_SESSION_AUTH }}` |
90+
| `augment_api_token` | API token for Augment services (store as secret) | No\*\* | `${{ secrets.AUGMENT_API_TOKEN }}` |
91+
| `augment_api_url` | Augment API endpoint URL (store as variable) | No\*\* | `${{ vars.AUGMENT_API_URL }}` |
92+
| `github_token` | GitHub token with `repo` and `user:email` scopes. | No | `${{ secrets.GITHUB_TOKEN }}` |
93+
| `instruction` | Direct instruction text for simple commands | No\* | `"Generate PR description"` |
94+
| `instruction_file` | Path to file with detailed instructions | No\* | `/tmp/instruction.txt` |
95+
| `template_directory` | Path to template directory for dynamic instructions | No\* | `.github/templates` |
96+
| `template_name` | Template file name (default: prompt.njk) | No | `pr-review.njk` |
97+
| `pull_number` | PR number for template context extraction | No | `${{ github.event.pull_request.number }}` |
98+
| `repo_name` | Repository name for template context | No | `${{ github.repository }}` |
99+
| `custom_context` | Additional JSON context for templates | No | `'{"priority": "high"}'` |
100+
| `model` | Model to use; passed through to auggie as --model | No | e.g. `sonnet4`, from `auggie --list-models` |
101+
| `rules` | JSON array of rules file paths (each forwarded as individual `--rules` flags) | No | `'[".github/augment/rules.md"]'` |
102+
| `mcp_configs` | JSON array of MCP config file paths (each forwarded as individual `--mcp-config` flags) | No | `'[".augment/mcp/config.json"]'` |
103+
| `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) |
85104

86105
\*Either `instruction`, `instruction_file`, or `template_directory` must be provided.
87106

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ inputs:
4949
mcp_configs:
5050
description: "JSON array of MCP config file paths. Each entry is forwarded to auggie as an individual --mcp-config flag."
5151
required: false
52+
fetch_depth:
53+
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."
54+
required: false
55+
default: "0"
5256

5357
runs:
5458
using: "composite"

0 commit comments

Comments
 (0)