Closed ghost closed 4 years ago
Hi @Sean-Intellicore,
Good morning.
I was able to reproduce the issue where the following error is returned in the PowerShell console:
Set-CCRepositoryTrigger `
>> -RepositoryName "Example" `
>> -Trigger @(
>> @{
>>
>> CustomData = "TestData";
>> DestinationArn = "arn:aws:lambda:us-east-2:000000000000:function:Example";
>> Events = "updateReference";
>> Name = "ExampleTrigger";
>> }
>> )
Set-CCRepositoryTrigger: Repository trigger branch name list cannot be null
Then I was going the CodeCommit API documentation for the supported scenarios. Even though the RepositoryTrigger link specifies that for branches parameter, if an empty array is specified, the trigger applies to all branches. However it also specifies the length constraint of minimum length of 1. Also the API documentation for PutRepositoryTriggers lists RepositoryTriggerBranchNameListRequiredException (At least one branch name is required, but was not specified in the trigger configuration.) as one of the errors. So looks like the CodeCommit PutRepositoryTriggers API itself doesn't allow empty branch list and the Powershell cmdlet is just returning the appropriate error.
Hence this doesn't appear to be an issue in Powershell cmdlet or .NET SDK, but merely a limitation at the CodeCommit API level. Please let me know if this provides necessary input for the issue and if this could be closed.
Thanks, Ashish
This issue has not received a response in 2 weeks. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.
When providing an empty array with @() the command fails.
Expected Behavior
Passing in @() should allow trigger to run on all branches
Steps to Reproduce (for bugs) Example request:
Your Environment AWS.Tools.Codecommit
Microsoft Windows 10.0.18363 Powershell Core 7