Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 10, 2026

Generated workflows used incorrect parameter name depth for actions/checkout, causing GitHub Actions to emit warnings about unexpected inputs. The checkout action expects fetch-depth.

Changes

  • pkg/workflow/compiler_yaml_helpers.go: Corrected parameter name in two functions:
    • generateCheckoutActionsFolder() - script mode actions checkout
    • generateCheckoutGitHubFolder() - .github/.agents folders checkout
  • pkg/workflow/compiler_custom_actions_test.go: Updated test assertion

Before/After

# Before (incorrect)
- uses: actions/checkout@v6
  with:
    sparse-checkout: |
      actions
    depth: 1  # ❌ Not a valid parameter

# After (correct)
- uses: actions/checkout@v6
  with:
    sparse-checkout: |
      actions
    fetch-depth: 1  # ✅ Valid parameter

This affects workflows using script mode or requiring .github folder checkouts. Existing workflow lock files don't use script mode, so no regeneration needed.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix unexpected input field depth in checkout action Fix checkout action parameter: use fetch-depth instead of depth Feb 10, 2026
Copilot AI requested a review from pelikhan February 10, 2026 20:02
@pelikhan pelikhan marked this pull request as ready for review February 10, 2026 20:07
Copilot AI review requested due to automatic review settings February 10, 2026 20:07
@pelikhan pelikhan merged commit 09e9416 into main Feb 10, 2026
95 checks passed
@pelikhan pelikhan deleted the copilot/fix-checkout-depth-field branch February 10, 2026 20:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes generated GitHub Actions workflows to use the correct actions/checkout input name for shallow clones (fetch-depth), avoiding “unexpected input” warnings during workflow runs.

Changes:

  • Replaced depth: 1 with fetch-depth: 1 in the workflow YAML generated for script-mode actions checkout.
  • Replaced depth: 1 with fetch-depth: 1 in the workflow YAML generated for sparse checkout of .github/.agents.
  • Updated the script-mode compilation test to assert on fetch-depth: 1.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pkg/workflow/compiler_yaml_helpers.go Updates generated checkout step YAML to use fetch-depth for shallow clones in two helper generators.
pkg/workflow/compiler_custom_actions_test.go Updates test expectations to match the corrected checkout input name.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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