Fix issue preventing labels from being updated when updating Issue

Similar to #76, `Update-GitHubIssue` was passing in the provided
labels as `label` instead of `labels` in the request body.
This commit is contained in:
Howard Wolosky 2018-12-13 21:57:42 -08:00
Родитель c63496c015
Коммит 577f07bd21
2 изменённых файлов: 8 добавлений и 1 удалений

Просмотреть файл

@ -640,7 +640,7 @@ function Update-GitHubIssue
if ($PSBoundParameters.ContainsKey('Title')) { $hashBody['title'] = $Title }
if ($PSBoundParameters.ContainsKey('Body')) { $hashBody['body'] = $Body }
if ($PSBoundParameters.ContainsKey('Assignee')) { $hashBody['assignees'] = @($Assignee) }
if ($PSBoundParameters.ContainsKey('Label')) { $hashBody['label'] = @($Label) }
if ($PSBoundParameters.ContainsKey('Label')) { $hashBody['labels'] = @($Label) }
if ($PSBoundParameters.ContainsKey('State')) { $hashBody['state'] = $State }
if ($PSBoundParameters.ContainsKey('Milestone'))
{

Просмотреть файл

@ -378,6 +378,13 @@ try
$labelIssues.Count | Should be $defaultLabels.Count
}
$updatedIssueLabels = @($labelsToAdd[0])
$updatedIssue = Update-GitHubIssue -OwnerName $ownerName -RepositoryName $repositoryName -Issue $issue.number -Label $updatedIssueLabels
It 'Should have 1 label after updating the issue' {
$updatedIssue.labels.Count | Should be $updatedIssueLabels.Count
}
$null = Remove-GitHubRepository -OwnerName $ownerName -RepositoryName $repositoryName
}
}