Skip to content

Compiled lock files use persist-credentials: false on checkout steps — fails on repos with submodules #31658

@jaroslawgajewski

Description

@jaroslawgajewski

Description

The gh-aw compiler generates persist-credentials: false on all actions/checkout steps in compiled .lock.yml files. This causes workflow failures when the target repository uses git submodules.

Root Cause

actions/checkout v6 with persist-credentials: false runs git submodule foreach --recursive during post-step credential cleanup (removeTokengetSubmoduleConfigPaths in git-auth-helper.ts). This fails when:

  1. The .gitmodules file is malformed (e.g., a submodule path entry with no url)
  2. Submodule paths are absent in the working tree (common in sparse checkout mode)

The error looks like:

Error: fatal: No url found for submodule path '<path>' in .gitmodules

Reproduction

  1. Create a repository with submodules (any valid .gitmodules + submodule directories)
  2. Add any other agentic workflow targeting that repository
  3. the workflow fails at the Checkout repository step during post-job cleanup

Current Workaround

We maintain a post-compile patch that replaces persist-credentials: falsepersist-credentials: true on ALL actions/checkout steps across all compiled lock files.

Proposed Fix

The compiler should default to persist-credentials: true on all generated actions/checkout steps. Rationale:

  • Runners are ephemeral — credentials left in git config are discarded after the job
  • Credentials are re-configured anyway — every workflow has a "Configure Git credentials" step that sets up auth after checkout
  • No security downgrade — the agent already has access to the GitHub token via MCP server and environment variables; persisting in git config doesn't expand the attack surface

Alternatively, expose a persist-credentials option in the workflow frontmatter so users can opt out if needed.

Environment

  • gh-aw CLI: v0.71.5
  • actions/checkout: v6.0.2
  • Affected repositories: Any repo with git submodules

Metadata

Metadata

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