Skip to content

fix: Replace hardcoded GitHub credentials with configurable options in GitHelpers#1807

Merged
thomhurst merged 1 commit intomainfrom
fix-1494
Jan 2, 2026
Merged

fix: Replace hardcoded GitHub credentials with configurable options in GitHelpers#1807
thomhurst merged 1 commit intomainfrom
fix-1494

Conversation

@thomhurst
Copy link
Copy Markdown
Owner

Summary

  • Adds GitUserName, GitUserEmail, RepositoryOwner, and RepositoryName configurable properties to GitHubSettings
  • Updates GitHelpers.cs to use these settings instead of hardcoded values like "Tom Longhurst" and "thomhurst@users.noreply.github.com"
  • Provides sensible defaults (github-actions[bot] for automated commits) for backward compatibility
  • Adds configuration options to appsettings.json

Test plan

  • Verify the build compiles successfully
  • Verify existing functionality is not affected (default values maintain current behavior)
  • Test with custom configuration values if desired

Closes #1494

🤖 Generated with Claude Code

…n GitHelpers

- Add GitUserName, GitUserEmail, RepositoryOwner, and RepositoryName properties to GitHubSettings
- Update GitHelpers to use configurable settings instead of hardcoded values
- Add default values for backward compatibility (github-actions[bot] for commits)
- Update appsettings.json with new configuration options

Closes #1494

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 2, 2026 17:28
@thomhurst
Copy link
Copy Markdown
Owner Author

Summary

Replaces hardcoded GitHub credentials (user name, email, repository owner/name) with configurable options in GitHubSettings.

Critical Issues

None found ✅

Suggestions

None - the implementation is clean and maintains backward compatibility through sensible defaults.

Verdict

APPROVE - No critical issues

The refactoring successfully:

  • Removes hardcoded values ("Tom Longhurst", "thomhurst@users.noreply.github.com", "thomhurst", "ModularPipelines")
  • Provides configurable alternatives via GitHubSettings
  • Maintains backward compatibility with appropriate defaults
  • Follows existing DI and configuration patterns
  • Properly handles null cases with fallback to new instance

@thomhurst thomhurst merged commit e0ea6e4 into main Jan 2, 2026
15 of 16 checks passed
@thomhurst thomhurst deleted the fix-1494 branch January 2, 2026 17:40
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR successfully refactors hardcoded GitHub credentials and repository information into configurable settings, improving the flexibility and reusability of the ModularPipelines build system. The changes replace hardcoded values like "Tom Longhurst" and "thomhurst@users.noreply.github.com" with configurable properties while maintaining backward compatibility through sensible defaults.

Key changes:

  • Adds four new configurable properties to GitHubSettings for git user info and repository details
  • Refactors GitHelpers.cs to consistently use settings instead of hardcoded values
  • Provides appropriate defaults (github-actions[bot] for automation, existing repo values for continuity)

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/ModularPipelines.Build/Settings/GitHubSettings.cs Adds four new properties with XML documentation and default values for git user credentials and repository identification
src/ModularPipelines.Build/GitHelpers.cs Refactors all methods to use configurable settings via new GetGitHubSettings helper method instead of hardcoded strings
src/ModularPipelines.Build/appsettings.json Adds configuration entries for the new settings with appropriate default values matching the code

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.

Code smell: Hardcoded GitHub username and email in GitHelpers

2 participants