-
Notifications
You must be signed in to change notification settings - Fork 187
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
GitHubRepositories: Add Get/Set GitHub Repository Actions Permissions #301
GitHubRepositories: Add Get/Set GitHub Repository Actions Permissions #301
Conversation
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.
Thanks again for this submission, and apologies for the delayed review.
Some minor feedback to address and then we should be good to merge in.
GitHubRepositories.ps1
Outdated
[string] $Uri, | ||
|
||
[Parameter(Mandatory)] | ||
[ValidateSet('All', 'Local_Only', 'Selected', 'Disabled')] |
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.
While the API uses local_only
, the whole underscore thing isn't very PowerShell-y. I'd prefer that to be LocalOnly
with a conversion to local_only
internally. In the past, we've used hashtable "converters" to handle scenarios like this. Example:
PowerShellForGitHub/GitHubIssues.ps1
Lines 900 to 901 in 8a29c7f
[ValidateSet('OffTopic', 'TooHeated', 'Resolved', 'Spam')] | |
[string] $Reason, |
PowerShellForGitHub/GitHubIssues.ps1
Lines 923 to 931 in 8a29c7f
$reasonConverter = @{ | |
'OffTopic' = 'off-topic' | |
'TooHeated' = 'too heated' | |
'Resolved' = 'resolved' | |
'Spam' = 'spam' | |
} | |
$telemetryProperties['Reason'] = $Reason | |
$hashBody['lock_reason'] = $reasonConverter[$Reason] |
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.
Done
/azp run PowerShellForGitHub-CI |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
@HowardWolosky, ready for the next review.
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.
Thanks for the quick update. Looks like there was only one typo, but I'll get that suggested update applied myself once this review is submitted. Then I'll kick off a pipeline run and then get it submitted.
Thanks for your efforts here!
/azp run PowerShellForGitHub-CI |
Azure Pipelines successfully started running 1 pipeline(s). |
Description
This PR adds the following functions to the
GitHubRepositories
module:Get-GitHubRepositoryActionsPermission
Set-GitHubRepositoryActionsPermission
Issues Fixed
None
References
Checklist
If desired, ensure your name is added to our Contributors list