Add optional fetch_depth option for shallow clones#10
Add optional fetch_depth option for shallow clones#10justinxu421 wants to merge 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
The documentation updates are helpful, but there's a critical implementation issue: the fetch_depth input parameter is defined but never used by the action.
🤖 Automated review complete. Please react with 👍 or 👎 on the individual review comments to provide feedback on their usefulness.
| 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" |
There was a problem hiding this comment.
Critical Issue: Parameter defined but not passed to implementation
The fetch_depth input is defined here but is never passed to the action's implementation. Looking at lines 74-88, the environment variables section doesn't include INPUT_FETCH_DEPTH.
To fix this, you need to add the following to the env: block (around line 88):
INPUT_FETCH_DEPTH: ${{ inputs.fetch_depth }}However, there's a deeper conceptual issue: this action doesn't perform any git checkout operations. The fetch-depth parameter is meant for actions/checkout@v4, which users already call in their workflows before this action runs. Adding fetch_depth as an input to this action serves no purpose since the checkout has already happened by the time this action executes.
Recommendation: Remove the fetch_depth input from action.yml entirely. The documentation updates showing users how to use fetch-depth with actions/checkout@v4 are valuable and should be kept, but this action doesn't need to accept or handle this parameter.
| | `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) | |
There was a problem hiding this comment.
Documentation Issue: Parameter doesn't belong to this action
This documents fetch_depth as an input to the Augment Agent action, but this parameter should not be part of this action's interface. The fetch-depth parameter belongs to actions/checkout@v4, not to this action.
The Performance Optimization section (lines 67-82) correctly shows users how to configure fetch-depth for actions/checkout@v4, which is the right approach. However, this line in the inputs table incorrectly suggests that fetch_depth is an input to the Augment Agent action itself.
Recommendation: Remove this row from the inputs table. The Performance Optimization section already provides clear guidance on using fetch-depth with the checkout action.
- 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
de2044b to
b557fef
Compare
Add configurable fetch depth support to optimize checkout performance in large repositories.
Key Changes
fetch_depthinput parameter inaction.ymlwith default value of'0'(full history) for backward compatibilityfetch-depth: 1) and full clones (fetch-depth: 0)Benefits
'0'for full history,'1'for latest commit only, or any positive integer for specific depthUsage Example
For most PR review scenarios:
For workflows requiring more history:
🤖 This description was generated automatically. Please react with 👍 if it's helpful or 👎 if it needs improvement.