-
Notifications
You must be signed in to change notification settings - Fork 5
🩹[Patch]: Add a Set-GitHubRepository
function
#377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🩹[Patch]: Add a Set-GitHubRepository
function
#377
Conversation
…se consistent rounding and formatting
…epositoryByName for enhanced data retrieval
…ory call for improved debugging and logging
…yByName for improved flexibility
…epository object directly for improved data handling
…new GitHubRepository object for improved type handling
…operty for improved clarity and conciseness; standardize visibility options in New-GitHubRepository to match casing conventions.
…ting user repositories; standardize parameter naming to improve clarity and consistency.
…o improve usability and consistency.
…sitoryListByOwner for consistency in parameter naming.
…ser.Login if not specified, enhancing parameter handling.
…serName instead of Context.User.Login for improved accuracy in user context handling.
…bRepositoryListByOwner for enhanced filtering options; update Owner assignment in Get-GitHubRepository to use Context.UserName as fallback.
…case for consistent handling in Get-GitHubRepositoryListByOwner; update repository iteration to use foreach for clarity.
…d Get-GitHubRepositoryListByOwner to use Write-Output for improved clarity in data flow.
…d Get-GitHubRepositoryListByOwner to use Write-Output for improved clarity in data flow.
…t for improved logging clarity and consistency in output formatting.
…y to use Format-Table for improved readability; ensure output is returned from Get-GitHubMyRepositories and Get-GitHubRepositoryByName.
… Get-GitHubRepositoryListByOwner, and Get-GitHubRepository to return objects directly instead of using Write-Output.
…oryListByOwner to use Write-Debug for improved logging and clarity in object creation.
…ByName and Get-GitHubRepositoryListByOwner for cleaner output.
…ory constructor for proper object initialization.
… in GitHubRepository for proper object initialization.
…per object initialization and enhance clarity in repository handling.
…pository for clarity and to prevent unnecessary processing.
…sitory for proper object initialization and clarity.
…ry to enhance clarity and prevent unnecessary processing.
…for proper object initialization and clarity.
…e assignments in GitHubRepository for proper object initialization and clarity.
…ryPermissions and uncomment Permissions assignment in GitHubRepository for clarity and proper initialization.
…s for improved debugging
… parameters for better troubleshooting
…binding names for improved debugging
… properties, ensuring consistent repository creation behavior
… before updating configuration
… calls in repository tests for cleaner output
…t-GitHubRepository for improved logging consistency; update repository tests to use -Verbose flag.
…ion in Set-GitHubRepository
…tionally include it for non-fork repositories
… messages in Invoke-GitHubAPI
- Created a template test file for structuring Pester tests. - Implemented tests for GitHub Teams API, including team creation, retrieval, updating, and deletion. - Developed tests for GitHub Users API, covering user retrieval and updates. - Added extensive tests for GitHub Variables API, including variable creation, updates, retrieval, and deletion across different scopes (organization, repository, environment). - Ensured proper authentication handling for GitHub Apps and user accounts. - Included logging for better visibility during test execution. - Suppressed specific Pester warnings to maintain code clarity and focus on test functionality.
…ed debugging in tests
…ks for consistency
…mprove clarity and remove redundant parameters
There was a problem hiding this 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 adds a new Set-GitHubRepository
cmdlet to unify create/update logic, refines parameter sets for repository functions, and enhances CI skips and examples.
- Introduce
Set-GitHubRepository
for idempotent create-or-update workflows - Rename and streamline parameter sets in
New-GitHubRepository
and remove redundant flags inUpdate-GitHubRepository
- Add extensive examples and test coverage for the new
Set-GitHubRepository
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
tests/Secrets.Tests.ps1 | Temporarily enabled -Debug switch in secret tests |
tests/Repositories.Tests.ps1 | Expanded repository tests; added Set-GitHubRepository cases |
src/functions/public/Repositories/Set-GitHubRepository.ps1 | New cmdlet to create or update repositories |
src/functions/public/Repositories/New-GitHubRepository.ps1 | Renamed parameter sets and updated verbose/debug output |
src/functions/public/Repositories/Update-GitHubRepository.ps1 | Removed obsolete Declare flag and enhanced debug logging |
Comments suppressed due to low confidence (1)
tests/Repositories.Tests.ps1:176
- The
AllowAutoMerge
property is commented out and not being asserted; add or restore a test to cover this behavior.
# $repo.AllowAutoMerge | Should -Be $true
Set-GitHubRepository
functionSet-GitHubRepository
function
Module GitHub - 0.28.2 published to the PowerShell Gallery. |
GitHub release for GitHub v0.28.2 has been created. |
This pull request introduces updates to GitHub repository management functionality, including new features, enhanced parameter handling, and additional examples. The changes primarily focus on refining repository creation, updating workflows, and adding a new
Set-GitHubRepository
function.Set-GitHubRepository
for idempotent configuration #350Enhancements to Repository Management:
New
Set-GitHubRepository
Functionality: Introduced a new function to create or update repositories based on their existence, with comprehensive parameter support for repository settings such as visibility, merge options, and security features (src/functions/public/Repositories/Set-GitHubRepository.ps1
).Refined Parameter Sets in
New-GitHubRepository
: Updated parameter sets forNew-GitHubRepository
to provide more descriptive names and improve clarity for creating repositories in different contexts (e.g., for authenticated users, organizations, or from templates) (src/functions/public/Repositories/New-GitHubRepository.ps1
). [1] [2] [3] [4] [5]Removed Redundant Parameters in
Update-GitHubRepository
: Eliminated theDeclare
parameter and associated logic to simplify the function and streamline its usage (src/functions/public/Repositories/Update-GitHubRepository.ps1
). [1] [2]Workflow and Testing Adjustments:
.github/PSModule.yml
to skip certain test and build steps, such asSourceCode
,PSModule
, andDocs
, to optimize the CI/CD workflow. Additionally, setCodeCoverage
to skip while maintaining a target percentage (.github/PSModule.yml
).Examples and Usability Improvements:
New-GitHubRepository
,Update-GitHubRepository
, andSet-GitHubRepository
with real-world scenarios, including creating repositories with specific configurations and comparing repository states (examples/Repositories.ps1
,examples/Repositories/Set-GitHubRepository.ps1
). [1] [2]