Conditionally set local git config based on skip-checkout input#11
Merged
Conditionally set local git config based on skip-checkout input#11
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-checkoutinput parameter.Key Changes
git config user.nameandgit config user.emailcommandsskip-checkoutis not set to"true"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