Skip to content

Commit 2953c59

Browse files
Fix indentation and add UTF-8 BOM to info.ps1 and outputs.ps1
1 parent 8b8c9ef commit 2953c59

2 files changed

Lines changed: 42 additions & 42 deletions

File tree

src/info.ps1

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Requires -Modules GitHub
1+
#Requires -Modules GitHub
22

33
[CmdletBinding()]
44
param()
@@ -25,40 +25,40 @@ process {
2525
Write-Output $fenceStart
2626

2727
if ($showInfo) {
28-
LogGroup ' - Installed modules' {
29-
Get-InstalledPSResource | Select-Object Name, Version, Prerelease | Sort-Object -Property Name | Format-Table -AutoSize | Out-String
30-
}
28+
LogGroup ' - Installed modules' {
29+
Get-InstalledPSResource | Select-Object Name, Version, Prerelease | Sort-Object -Property Name | Format-Table -AutoSize | Out-String
30+
}
3131

32-
LogGroup ' - GitHub connection - Default' {
33-
$context = Get-GitHubContext
34-
$context | Format-List | Out-String
35-
36-
Write-Verbose "Token? [$([string]::IsNullOrEmpty($env:PSMODULE_GITHUB_SCRIPT_INPUT_Token))]"
37-
Write-Verbose "AuthType? [$($context.AuthType)] - [$($context.AuthType -ne 'APP')]"
38-
Write-Verbose "gh auth? [$($context.AuthType -ne 'APP' -and -not [string]::IsNullOrEmpty($env:PSMODULE_GITHUB_SCRIPT_INPUT_Token))]"
39-
40-
if ($context.AuthType -ne 'APP' -and -not [string]::IsNullOrEmpty($env:PSMODULE_GITHUB_SCRIPT_INPUT_Token)) {
41-
Write-Output 'GitHub CLI status:'
42-
$before = $LASTEXITCODE
43-
gh auth status
44-
if ($LASTEXITCODE -ne $before) {
45-
Write-Warning "LASTEXITCODE has changed [$LASTEXITCODE]"
46-
$global:LASTEXITCODE = $before
32+
LogGroup ' - GitHub connection - Default' {
33+
$context = Get-GitHubContext
34+
$context | Format-List | Out-String
35+
36+
Write-Verbose "Token? [$([string]::IsNullOrEmpty($env:PSMODULE_GITHUB_SCRIPT_INPUT_Token))]"
37+
Write-Verbose "AuthType? [$($context.AuthType)] - [$($context.AuthType -ne 'APP')]"
38+
Write-Verbose "gh auth? [$($context.AuthType -ne 'APP' -and -not [string]::IsNullOrEmpty($env:PSMODULE_GITHUB_SCRIPT_INPUT_Token))]"
39+
40+
if ($context.AuthType -ne 'APP' -and -not [string]::IsNullOrEmpty($env:PSMODULE_GITHUB_SCRIPT_INPUT_Token)) {
41+
Write-Output 'GitHub CLI status:'
42+
$before = $LASTEXITCODE
43+
gh auth status
44+
if ($LASTEXITCODE -ne $before) {
45+
Write-Warning "LASTEXITCODE has changed [$LASTEXITCODE]"
46+
$global:LASTEXITCODE = $before
47+
}
4748
}
4849
}
49-
}
5050

51-
LogGroup ' - GitHub connection - List' {
52-
Get-GitHubContext -ListAvailable | Format-Table | Out-String
53-
}
51+
LogGroup ' - GitHub connection - List' {
52+
Get-GitHubContext -ListAvailable | Format-Table | Out-String
53+
}
5454

55-
LogGroup ' - Configuration' {
56-
Get-GitHubConfig | Format-List | Out-String
57-
}
55+
LogGroup ' - Configuration' {
56+
Get-GitHubConfig | Format-List | Out-String
57+
}
5858

59-
LogGroup ' - Event Information' {
60-
Get-GitHubEventData | Format-List | Out-String
61-
}
59+
LogGroup ' - Event Information' {
60+
Get-GitHubEventData | Format-List | Out-String
61+
}
6262
} # end if ($showInfo)
6363

6464
$env:PSMODULE_GITHUB_SCRIPT_RATELIMIT_LABEL = 'Pre'

src/outputs.ps1

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Requires -Modules GitHub
1+
#Requires -Modules GitHub
22

33
[CmdletBinding()]
44
param()
@@ -29,21 +29,21 @@ try {
2929
Write-Output $fenceStart
3030

3131
if ($result) {
32-
if ([string]::IsNullOrEmpty($env:GITHUB_ACTION)) {
33-
Write-GitHubWarning 'Outputs cannot be accessed as the step has no ID.'
34-
}
32+
if ([string]::IsNullOrEmpty($env:GITHUB_ACTION)) {
33+
Write-GitHubWarning 'Outputs cannot be accessed as the step has no ID.'
34+
}
3535

36-
if (-not (Test-Path -Path $env:GITHUB_OUTPUT)) {
37-
Write-Warning "File not found: $env:GITHUB_OUTPUT"
38-
}
36+
if (-not (Test-Path -Path $env:GITHUB_OUTPUT)) {
37+
Write-Warning "File not found: $env:GITHUB_OUTPUT"
38+
}
3939

40-
foreach ($output in $result.PSObject.Properties) {
41-
$blue = $PSStyle.Foreground.Blue
42-
$reset = $PSStyle.Reset
43-
LogGroup " - $blue$($output.Name)$reset" {
44-
$output.Value | Format-List | Out-String
40+
foreach ($output in $result.PSObject.Properties) {
41+
$blue = $PSStyle.Foreground.Blue
42+
$reset = $PSStyle.Reset
43+
LogGroup " - $blue$($output.Name)$reset" {
44+
$output.Value | Format-List | Out-String
45+
}
4546
}
46-
}
4747
} # end if ($result)
4848

4949
$env:PSMODULE_GITHUB_SCRIPT_RATELIMIT_LABEL = 'Post'

0 commit comments

Comments
 (0)