Skip to content

Bundle apply fails due to shallow clone (fetch-depth: 1) in safe_outputs job #32467

@kaovilai

Description

@kaovilai

Problem

The safe_outputs job in the generated lock file uses fetch-depth: 1 (shallow clone) when checking out the repository. When the agent job creates a git bundle whose prerequisite commit is not the current HEAD, the bundle apply fails because the shallow clone doesn't have that commit.

Error

[command]/usr/bin/git fetch /tmp/gh-aw/aw-fix-local-attempts-reconnect-wifi.bundle refs/heads/fix/local-attempts-reconnect-wifi:refs/heads/fix/local-attempts-reconnect-wifi-e930cb838cf960c8
error: Repository lacks these prerequisite commits:
error: 7512708088c7c197c6847c339614ba3671448977
##[error]Failed to apply bundle: The process '/usr/bin/git' failed with exit code 1

Reproduction

The prerequisite commit 7512708 is the 3rd commit back from HEAD (73d9735). The shallow clone only has HEAD, so git can't satisfy the bundle prerequisite.

Root Cause

In the auto-generated lock file, the safe_outputs job checkout step has:

uses: actions/checkout@...
with:
  fetch-depth: 1

The agent job (which runs earlier with full history) creates a bundle that references an older commit as a prerequisite. The safe_outputs job's shallow clone can't resolve it.

Suggested Fix

Use a deeper fetch-depth (e.g., 0 or a reasonable depth like 50) in the safe_outputs checkout step, or ensure the bundle is created with --all / minimal prerequisites that a depth-1 clone can satisfy.

Note

Responses generated with Claude

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions