Skip to content

Conversation

@justinxu421
Copy link
Contributor

@justinxu421 justinxu421 commented Oct 8, 2025

Add configurable fetch depth support to optimize checkout performance in large repositories.

Key Changes

  • New fetch_depth input parameter in action.yml with default value of '0' (full history) for backward compatibility
  • Performance optimization documentation added to README.md explaining when and how to use shallow clones
  • Updated example workflows with inline comments guiding users on choosing between shallow (fetch-depth: 1) and full clones (fetch-depth: 0)

Benefits

  • Faster checkouts: Shallow clones significantly reduce checkout time for repositories with extensive history
  • Flexible configuration: Users can specify '0' for full history, '1' for latest commit only, or any positive integer for specific depth
  • Backward compatible: Default behavior unchanged, maintaining full history fetch

Usage Example

For most PR review scenarios:

- uses: actions/checkout@v4
  with:
    fetch-depth: 1  # Shallow clone for faster checkout

For workflows requiring more history:

- uses: actions/checkout@v4
  with:
    fetch-depth: 50  # Last 50 commits

🤖 This description was generated automatically. Please react with 👍 if it's helpful or 👎 if it needs improvement.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@justinxu421 justinxu421 force-pushed the add-fetch-depth-support branch from de2044b to b557fef Compare October 9, 2025 00:03
@justinxu421 justinxu421 marked this pull request as ready for review October 9, 2025 00:07
@justinxu421 justinxu421 closed this Oct 9, 2025
@justinxu421 justinxu421 deleted the add-fetch-depth-support branch October 9, 2025 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants