File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,15 +62,11 @@ LogGroup 'BeforeAll - Global Test Setup' {
6262 }
6363
6464 # Create extra repositories needed by Secrets/Variables SelectedRepository tests.
65- foreach ($suffix in 2 , 3 ) {
66- $extraName = " $repoName -$suffix "
67- switch ($OwnerType ) {
68- ' user' {
69- New-GitHubRepository - Name $extraName
70- }
71- ' organization' {
72- New-GitHubRepository - Organization $Owner - Name $extraName
73- }
65+ # Only organization owners need them — those tests are skipped for user owners.
66+ if ($OwnerType -eq ' organization' ) {
67+ foreach ($suffix in 2 , 3 ) {
68+ $extraName = " $repoName -$suffix "
69+ New-GitHubRepository - Organization $Owner - Name $extraName
7470 }
7571 }
7672 }
Original file line number Diff line number Diff line change @@ -50,8 +50,6 @@ Describe 'Secrets' {
5050 switch ($OwnerType ) {
5151 ' user' {
5252 $repo = Get-GitHubRepository - Name $repoName
53- $repo2 = Get-GitHubRepository - Name " $repoName -2"
54- $repo3 = Get-GitHubRepository - Name " $repoName -3"
5553 }
5654 ' organization' {
5755 Get-GitHubSecret - Owner $Owner | Where-Object { $_.Name -like " $secretName *" } | Remove-GitHubSecret - Confirm:$false
@@ -74,8 +72,10 @@ Describe 'Secrets' {
7472 }
7573 LogGroup " Repository - [$repoName ]" {
7674 Write-Host ($repo | Select-Object * | Out-String )
77- Write-Host ($repo2 | Select-Object * | Out-String )
78- Write-Host ($repo3 | Select-Object * | Out-String )
75+ if ($OwnerType -eq ' organization' ) {
76+ Write-Host ($repo2 | Select-Object * | Out-String )
77+ Write-Host ($repo3 | Select-Object * | Out-String )
78+ }
7979 }
8080 }
8181
Original file line number Diff line number Diff line change @@ -50,8 +50,6 @@ Describe 'Variables' {
5050 switch ($OwnerType ) {
5151 ' user' {
5252 $repo = Get-GitHubRepository - Name $repoName
53- $repo2 = Get-GitHubRepository - Name " $repoName -2"
54- $repo3 = Get-GitHubRepository - Name " $repoName -3"
5553 }
5654 ' organization' {
5755 Get-GitHubVariable - Owner $Owner | Where-Object { $_.Name -like " $variableName *" } | Remove-GitHubVariable - Confirm:$false
@@ -73,8 +71,10 @@ Describe 'Variables' {
7371 }
7472 LogGroup " Repository - [$repoName ]" {
7573 Write-Host ($repo | Select-Object * | Out-String )
76- Write-Host ($repo2 | Select-Object * | Out-String )
77- Write-Host ($repo3 | Select-Object * | Out-String )
74+ if ($OwnerType -eq ' organization' ) {
75+ Write-Host ($repo2 | Select-Object * | Out-String )
76+ Write-Host ($repo3 | Select-Object * | Out-String )
77+ }
7878 }
7979 }
8080
You can’t perform that action at this time.
0 commit comments