You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🪲[Fix]: Piping GitHubSecret and GitHubVariable objects to Remove-GitHubSecret and Remove-GitHubVariable (#499)
This pull request improves the handling and testing of secret and
variable removal in the GitHub module. The main focus is on making the
removal functions (`Remove-GitHubSecret`, `Remove-GitHubVariable`) more
robust and scope-aware, and on expanding the test coverage to ensure
correct behavior across different usage patterns and scopes.
- Fixes#388
Key changes include:
### Functional improvements to removal logic
* Updated `Remove-GitHubSecret.ps1` and `Remove-GitHubVariable.ps1` to
dispatch removal actions based on the `Scope` property of each item,
ensuring the correct removal function is called for environment,
repository, or organization scopes, and providing clear error handling
for unsupported scopes.
### Documentation and class property clarifications
* Improved property descriptions in `GitHubSecret.ps1` and
`GitHubVariable.ps1` to clarify that properties refer to where the
secret or variable is stored, enhancing code readability and
maintainability.
### Expanded and improved test coverage
* Refactored and expanded tests in `Secrets.Tests.ps1` and
`Variables.Tests.ps1` to:
- Add separate tests for pipeline-based removal using both direct
pipeline and variable assignment approaches.
- Ensure secrets and variables are created and removed correctly in all
supported scopes.
- Add logging and verification steps to improve test clarity and
debugging.
These changes make the module's behavior more predictable and easier to
test, especially when handling secrets and variables in different scopes
and using pipeline operations.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
Co-authored-by: Marius Storhaug <marstor@hotmail.com>
0 commit comments