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 (removeToken → getSubmoduleConfigPaths in git-auth-helper.ts). This fails when:
- The
.gitmodules file is malformed (e.g., a submodule path entry with no url)
- 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
- Create a repository with submodules (any valid
.gitmodules + submodule directories)
- Add any other agentic workflow targeting that repository
- the workflow fails at the
Checkout repository step during post-job cleanup
Current Workaround
We maintain a post-compile patch that replaces persist-credentials: false → persist-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
Description
The
gh-awcompiler generatespersist-credentials: falseon allactions/checkoutsteps in compiled.lock.ymlfiles. This causes workflow failures when the target repository uses git submodules.Root Cause
actions/checkoutv6 withpersist-credentials: falserunsgit submodule foreach --recursiveduring post-step credential cleanup (removeToken→getSubmoduleConfigPathsingit-auth-helper.ts). This fails when:.gitmodulesfile is malformed (e.g., a submodule path entry with nourl)The error looks like:
Reproduction
.gitmodules+ submodule directories)Checkout repositorystep during post-job cleanupCurrent Workaround
We maintain a post-compile patch that replaces
persist-credentials: false→persist-credentials: trueon ALLactions/checkoutsteps across all compiled lock files.Proposed Fix
The compiler should default to
persist-credentials: trueon all generatedactions/checkoutsteps. Rationale:Alternatively, expose a
persist-credentialsoption in the workflow frontmatter so users can opt out if needed.Environment