Skip to content

Conditionally set local git config based on skip-checkout input#11

Merged
nsheaps merged 3 commits intomainfrom
claude/fix-git-config-skip-checkout-s9F8S
Mar 8, 2026
Merged

Conditionally set local git config based on skip-checkout input#11
nsheaps merged 3 commits intomainfrom
claude/fix-git-config-skip-checkout-s9F8S

Conversation

@nsheaps
Copy link
Owner

@nsheaps nsheaps commented Mar 8, 2026

Summary

This change refactors the git configuration logic in the GitHub App authentication action to conditionally apply local git config settings based on the skip-checkout input parameter.

Key Changes

  • Removed unconditional local git config user.name and git config user.email commands
  • Wrapped local git config commands in a conditional block that only executes when skip-checkout is not set to "true"
  • Retained global git config commands which are always applied
  • This prevents git configuration errors when checkout is skipped (e.g., when the repository is not available locally)

Implementation Details

The local git config settings are now only applied when a checkout is expected to occur. The global git config settings remain unchanged and are always configured, ensuring the GitHub App identity is properly set at the system level regardless of the checkout status.

https://claude.ai/code/session_01To6bMgr59sMZgHKDTt4F1x

claude added 2 commits March 8, 2026 21:36
When skip-checkout: 'true', there is no git repo yet, so local git
config commands fail with "fatal: not in a git directory" (exit 128).
Wrap the local (non---global) git config commands in a conditional so
they only run when a repo is present.

https://claude.ai/code/session_01To6bMgr59sMZgHKDTt4F1x
Move local git config (user.name, user.email) to a dedicated step that
runs after checkout, so it always sets both global and local config when
a repo is present. When skip-checkout is true, only global config is set.

https://claude.ai/code/session_01To6bMgr59sMZgHKDTt4F1x
@nsheaps nsheaps marked this pull request as ready for review March 8, 2026 23:44
@nsheaps nsheaps enabled auto-merge (squash) March 8, 2026 23:48
@nsheaps nsheaps merged commit 6030528 into main Mar 8, 2026
2 checks passed
@nsheaps nsheaps deleted the claude/fix-git-config-skip-checkout-s9F8S branch March 8, 2026 23:48
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