Skip to content

Commit cd17571

Browse files
committed
Minor updates for recent Events PR
* Move `$uriFragment` and `$description` to be defined in the same scope as all usages. * Fix Static Analysis issue with the tests file (extra spaces)
1 parent 06e2524 commit cd17571

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

GitHubEvents.ps1

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ function Get-GitHubEvent
8989
'ProvidedEvent' = $PSBoundParameters.ContainsKey('EventID')
9090
}
9191

92+
$uriFragment = "repos/$OwnerName/$RepositoryName/issues/events"
93+
$description = "Getting events for $RepositoryName"
94+
9295
if ($PSBoundParameters.ContainsKey('EventID'))
9396
{
9497
$uriFragment = "repos/$OwnerName/$RepositoryName/issues/events/$EventID"
@@ -99,11 +102,6 @@ function Get-GitHubEvent
99102
$uriFragment = "repos/$OwnerName/$RepositoryName/issues/$Issue/events"
100103
$description = "Getting events for issue $Issue in $RepositoryName"
101104
}
102-
else
103-
{
104-
$uriFragment = "repos/$OwnerName/$RepositoryName/issues/events"
105-
$description = "Getting events for $RepositoryName"
106-
}
107105

108106
$acceptHeaders = @(
109107
'application/vnd.github.starfox-preview+json',

Tests/GitHubEvents.tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ try
140140

141141
Context 'For getting an event directly'{
142142
$singleEvent = Get-GitHubEvent -OwnerName $ownerName -RepositoryName $repositoryName -EventID $events[0].id
143-
143+
144144
It 'Should have the correct event type'{
145145
$singleEvent.event | Should be 'reopened'
146146
}

0 commit comments

Comments
 (0)