Skip to content

checkout: false still emits 'Configure Git credentials' steps that fail without .git #21313

@pholleran

Description

@pholleran

Summary

When using checkout: false in agentic workflow frontmatter, the compiler correctly removes the actions/checkout step from the agent job. However, it still emits "Configure Git credentials" steps that run git remote set-url origin ..., which fails with:

fatal: not a git repository (or any of the parent directories): .git

The agent job fails at this step because there is no .git directory when checkout is disabled.

Steps to Reproduce

  1. Set checkout: false in the workflow frontmatter:
    checkout: false
    permissions:
      issues: read
  2. Run gh aw compile (v0.59.0) — compiles successfully
  3. Trigger the workflow

Expected Behavior

When checkout: false is set, the compiled workflow should skip (or gate) git credential configuration steps that depend on a .git directory existing, specifically:

  • "Configure Git credentials" (which runs git remote set-url origin ...)
  • "Clean git credentials"

Actual Behavior

The compiled workflow still includes these steps unconditionally:

- name: Configure Git credentials
  run: |
    git config --global user.email "github-actions[bot]@users.noreply.github.com"
    git config --global user.name "github-actions[bot]"
    git config --global am.keepcr true
    git remote set-url origin "https://x-access-token:...@github.com/REPO.git"

The git config --global commands succeed, but git remote set-url origin fails because no repository was cloned.

Failing Run

https://github.com/github/fcto-workflow-test/actions/runs/23172602972/job/67327762478

Workaround

Using sparse-checkout to minimize what is fetched instead of disabling checkout entirely:

checkout:
  sparse-checkout: "README.md"
permissions:
  contents: read
  issues: read

Environment

  • gh aw version: v0.59.0
  • Workflow type: API-only (uses MCP tools for GitHub Projects/Issues, no repo files needed)

Metadata

Metadata

Labels

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