From 6a93c3f2373cc087a5bdc87e0124da5a192bdd36 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 21:52:39 +0100 Subject: [PATCH 01/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Update=20output?= =?UTF-8?q?=20format=20for=20GitHub=20configuration=20and=20context=20to?= =?UTF-8?q?=20use=20Format-List?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 905f225..72ab2fa 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -48,9 +48,7 @@ Write-Output 'Installed modules:' Get-InstalledPSResource | Select-Object Name, Version, Prerelease | Format-Table -AutoSize Write-Output 'GitHub module configuration:' -Get-GitHubConfig | Select-Object Name, ID, RunEnv | Format-Table -AutoSize - -'::endgroup::' +Get-GitHubConfig | Format-List $providedToken = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Token) $providedClientID = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_ClientID) @@ -59,15 +57,17 @@ Write-Verbose 'Provided authentication info:' Write-Verbose "Token: [$providedToken]" Write-Verbose "ClientID: [$providedClientID]" Write-Verbose "PrivateKey: [$providedPrivateKey]" +'::endgroup::' + if ($providedClientID -and $providedPrivateKey) { LogGroup 'Connecting using provided GitHub App' { Connect-GitHub -ClientID $env:GITHUB_ACTION_INPUT_ClientID -PrivateKey $env:GITHUB_ACTION_INPUT_PrivateKey -Silent - Get-GitHubContext | Format-Table -AutoSize + Get-GitHubContext | Format-List } } elseif ($providedToken) { LogGroup 'Connecting using provided token' { Connect-GitHub -Token $env:GITHUB_ACTION_INPUT_Token -Silent - Get-GitHubContext | Format-Table -AutoSize + Get-GitHubContext | Format-List } } From 59b4c49b01f5e67c1d81c83e039e917055e8af28 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 21:52:47 +0100 Subject: [PATCH 02/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Update=20README?= =?UTF-8?q?=20to=20include=20example=20for=20using=20Set-GitHubOutput=20in?= =?UTF-8?q?=20workflows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index 1c467a6..4bb7d83 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,30 @@ For more information on the available functions and automatic loaded variables, | - | - | | `result` | The output of the script as a JSON object. To add outputs to `result`, use `Set-GitHubOutput`. | +To use the outputs in a subsequent step, you can use the following syntax: + +```yaml +- uses: PSModule/GitHub-Script@v1 + id: set-output + with: + Script: | + Set-GitHubOutput -Name 'Octocat' -Value @{ + Name = 'Octocat' + Image = 'https://octodex.github.com/images/original.png' + } + +- name: Use outputs + shell: pwsh + env: + result: ${{ steps.set-output.outputs.result }} # = '{"Octocat":{"Name":"Octocat","Image":"https://octodex.github.com/images/original.png"}}' + name: ${{ fromJson(steps.set-output.outputs.result).Octocat.Name }} # = 'Octocat' + run: | + $result = $env:result | ConvertFrom-Json + Write-Output $env:name + Write-Output $result.Octocat.Image +``` + + ### Examples #### Example 1: Run a GitHub PowerShell script From 3258860cf4273b2ca46cf670904af691946581eb Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 22:02:28 +0100 Subject: [PATCH 03/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Refactor=20GitH?= =?UTF-8?q?ub=20connection=20logging=20and=20reintroduce=20GitHub=20module?= =?UTF-8?q?=20configuration=20output?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 72ab2fa..ef1b999 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -47,9 +47,6 @@ if (-not $alreadyImported) { Write-Output 'Installed modules:' Get-InstalledPSResource | Select-Object Name, Version, Prerelease | Format-Table -AutoSize -Write-Output 'GitHub module configuration:' -Get-GitHubConfig | Format-List - $providedToken = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Token) $providedClientID = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_ClientID) $providedPrivateKey = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_PrivateKey) @@ -59,15 +56,18 @@ Write-Verbose "ClientID: [$providedClientID]" Write-Verbose "PrivateKey: [$providedPrivateKey]" '::endgroup::' - if ($providedClientID -and $providedPrivateKey) { - LogGroup 'Connecting using provided GitHub App' { + LogGroup 'Connected using provided GitHub App' { Connect-GitHub -ClientID $env:GITHUB_ACTION_INPUT_ClientID -PrivateKey $env:GITHUB_ACTION_INPUT_PrivateKey -Silent - Get-GitHubContext | Format-List + Get-GitHubContext | Select-Object -Property * | Format-List } } elseif ($providedToken) { - LogGroup 'Connecting using provided token' { + LogGroup 'Connected using provided token' { Connect-GitHub -Token $env:GITHUB_ACTION_INPUT_Token -Silent - Get-GitHubContext | Format-List + Get-GitHubContext | Select-Object -Property * | Format-List } } + +LogGroup 'GitHub module configuration' { + Get-GitHubConfig | Format-List +} From 4396db113fe769779f9a976568631664f919c436 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 22:05:44 +0100 Subject: [PATCH 04/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Enhance=20loggi?= =?UTF-8?q?ng=20messages=20in=20GitHub=20PowerShell=20module=20setup=20for?= =?UTF-8?q?=20clarity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index ef1b999..c554b4a 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -4,7 +4,7 @@ param() $DebugPreference = $env:GITHUB_ACTION_INPUT_Debug -eq 'true' ? 'Continue' : 'SilentlyContinue' $VerbosePreference = $env:GITHUB_ACTION_INPUT_Verbose -eq 'true' ? 'Continue' : 'SilentlyContinue' -'::group::Setting up GitHub PowerShell module' +'::group::GitHub-Script - Setting up GitHub PowerShell module' $env:PSMODULE_GITHUB_SCRIPT = $true $Name = 'GitHub' @@ -57,17 +57,19 @@ Write-Verbose "PrivateKey: [$providedPrivateKey]" '::endgroup::' if ($providedClientID -and $providedPrivateKey) { - LogGroup 'Connected using provided GitHub App' { + LogGroup 'GitHub-Script - Connected using provided GitHub App' { Connect-GitHub -ClientID $env:GITHUB_ACTION_INPUT_ClientID -PrivateKey $env:GITHUB_ACTION_INPUT_PrivateKey -Silent Get-GitHubContext | Select-Object -Property * | Format-List } } elseif ($providedToken) { - LogGroup 'Connected using provided token' { + LogGroup 'GitHub-Script - Connected using provided token' { Connect-GitHub -Token $env:GITHUB_ACTION_INPUT_Token -Silent Get-GitHubContext | Select-Object -Property * | Format-List } } -LogGroup 'GitHub module configuration' { +LogGroup 'GitHub-Script - GitHub module configuration' { Get-GitHubConfig | Format-List } + +Write-Host '-----------------------------------------------' From 5385fb6a8395753ae2d0e7887910def60a3e91ca Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 22:12:40 +0100 Subject: [PATCH 05/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Update=20loggin?= =?UTF-8?q?g=20to=20use=20Write-Host=20for=20better=20visibility=20in=20Gi?= =?UTF-8?q?tHub=20PowerShell=20module=20setup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index c554b4a..1a6c82c 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -3,27 +3,27 @@ param() $DebugPreference = $env:GITHUB_ACTION_INPUT_Debug -eq 'true' ? 'Continue' : 'SilentlyContinue' $VerbosePreference = $env:GITHUB_ACTION_INPUT_Verbose -eq 'true' ? 'Continue' : 'SilentlyContinue' - -'::group::GitHub-Script - Setting up GitHub PowerShell module' $env:PSMODULE_GITHUB_SCRIPT = $true +'::group::GitHub-Script - Setup GitHub PowerShell' + $Name = 'GitHub' $Version = [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Version) ? $null : $env:GITHUB_ACTION_INPUT_Version $Prerelease = $env:GITHUB_ACTION_INPUT_Prerelease -eq 'true' $alreadyInstalled = Get-InstalledPSResource -Name $Name -ErrorAction SilentlyContinue if ($Version) { - Write-Verbose "Filtering by version: $Version" + Write-Host "Filtering by version: $Version" $alreadyInstalled = $alreadyInstalled | Where-Object Version -EQ $Version } if ($Prerelease) { - Write-Verbose 'Filtering by prerelease' + Write-Host 'Filtering by prerelease' $alreadyInstalled = $alreadyInstalled | Where-Object Prerelease -EQ $Prerelease } -Write-Verbose 'Already installed:' -Write-Verbose ($alreadyInstalled | Format-Table | Out-String) +Write-Host 'Already installed:' +$alreadyInstalled | Format-Table if (-not $alreadyInstalled) { - Write-Verbose "Installing module. Name: [$Name], Version: [$Version], Prerelease: [$Prerelease]" + Write-Host "Installing module. Name: [$Name], Version: [$Version], Prerelease: [$Prerelease]" $params = @{ Name = $Name Repository = 'PSGallery' @@ -37,24 +37,25 @@ if (-not $alreadyInstalled) { } $alreadyImported = Get-Module -Name $Name -Write-Verbose 'Already imported:' -Write-Verbose ($alreadyImported | Format-Table | Out-String) +Write-Host 'Already imported:' +$alreadyImported | Format-Table if (-not $alreadyImported) { - Write-Verbose "Importing module: $Name" + Write-Host "Importing module: $Name" Import-Module -Name $Name } +'::endgroup::' -Write-Output 'Installed modules:' -Get-InstalledPSResource | Select-Object Name, Version, Prerelease | Format-Table -AutoSize +LogGroup 'GitHub-Script - Installed modules' { + Get-InstalledPSResource | Select-Object Name, Version, Prerelease | Format-Table -AutoSize +} $providedToken = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Token) $providedClientID = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_ClientID) $providedPrivateKey = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_PrivateKey) -Write-Verbose 'Provided authentication info:' -Write-Verbose "Token: [$providedToken]" -Write-Verbose "ClientID: [$providedClientID]" -Write-Verbose "PrivateKey: [$providedPrivateKey]" -'::endgroup::' +Write-Host 'Provided authentication info:' +Write-Host "Token: [$providedToken]" +Write-Host "ClientID: [$providedClientID]" +Write-Host "PrivateKey: [$providedPrivateKey]" if ($providedClientID -and $providedPrivateKey) { LogGroup 'GitHub-Script - Connected using provided GitHub App' { From 532206a9eb93a4f5ba7ff27c26fdd34c0e7a7d62 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 22:25:01 +0100 Subject: [PATCH 06/43] test --- scripts/main.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 1a6c82c..5d08d22 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -73,4 +73,4 @@ LogGroup 'GitHub-Script - GitHub module configuration' { Get-GitHubConfig | Format-List } -Write-Host '-----------------------------------------------' +Write-Host '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' From 8d0fd7dc427abded9cc7bbc9c5d13f69cc66b9cc Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 22:27:39 +0100 Subject: [PATCH 07/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Improve=20authe?= =?UTF-8?q?ntication=20info=20logging=20format=20and=20restore=20module=20?= =?UTF-8?q?installation=20logging?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 5d08d22..a1679e0 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -43,19 +43,24 @@ if (-not $alreadyImported) { Write-Host "Importing module: $Name" Import-Module -Name $Name } -'::endgroup::' - -LogGroup 'GitHub-Script - Installed modules' { - Get-InstalledPSResource | Select-Object Name, Version, Prerelease | Format-Table -AutoSize -} $providedToken = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Token) $providedClientID = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_ClientID) $providedPrivateKey = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_PrivateKey) Write-Host 'Provided authentication info:' -Write-Host "Token: [$providedToken]" -Write-Host "ClientID: [$providedClientID]" -Write-Host "PrivateKey: [$providedPrivateKey]" +@{ + Token = $providedToken + ClientID = $providedClientID + PrivateKey = $providedPrivateKey +} | Format-List +$providedToken = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Token) +$providedClientID = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_ClientID) +$providedPrivateKey = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_PrivateKey) +'::endgroup::' + +LogGroup 'GitHub-Script - Installed modules' { + Get-InstalledPSResource | Select-Object Name, Version, Prerelease | Format-Table -AutoSize +} if ($providedClientID -and $providedPrivateKey) { LogGroup 'GitHub-Script - Connected using provided GitHub App' { @@ -73,4 +78,4 @@ LogGroup 'GitHub-Script - GitHub module configuration' { Get-GitHubConfig | Format-List } -Write-Host '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' +Write-Host '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' From 06a4de36c78af070a91b38b4230d0babeed41b39 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 22:30:28 +0100 Subject: [PATCH 08/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Update=20authen?= =?UTF-8?q?tication=20info=20logging=20to=20display=20properties=20in=20ke?= =?UTF-8?q?y-value=20format?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index a1679e0..0fe7438 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -52,7 +52,7 @@ Write-Host 'Provided authentication info:' Token = $providedToken ClientID = $providedClientID PrivateKey = $providedPrivateKey -} | Format-List +} | Format-List -Property Name, Value $providedToken = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Token) $providedClientID = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_ClientID) $providedPrivateKey = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_PrivateKey) From 88355280c0fdb9cc790305412f750d5bebdec697 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 22:39:38 +0100 Subject: [PATCH 09/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Sort=20installe?= =?UTF-8?q?d=20PowerShell=20resources=20by=20name=20for=20improved=20reada?= =?UTF-8?q?bility?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 0fe7438..fb15ba5 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -59,7 +59,7 @@ $providedPrivateKey = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Priv '::endgroup::' LogGroup 'GitHub-Script - Installed modules' { - Get-InstalledPSResource | Select-Object Name, Version, Prerelease | Format-Table -AutoSize + Get-InstalledPSResource | Select-Object Name, Version, Prerelease | Sort-Object -Property Name | Format-Table -AutoSize } if ($providedClientID -and $providedPrivateKey) { From 49fff0176809148f4b1835abc1a4b9d6fd1f30f6 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 22:42:46 +0100 Subject: [PATCH 10/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Enhance=20loggi?= =?UTF-8?q?ng=20for=20GitHub=20connection=20by=20using=20Write-Host=20for?= =?UTF-8?q?=20better=20visibility?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index fb15ba5..046ad4a 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -48,7 +48,7 @@ $providedToken = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Token) $providedClientID = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_ClientID) $providedPrivateKey = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_PrivateKey) Write-Host 'Provided authentication info:' -@{ +[pscustomobject]@{ Token = $providedToken ClientID = $providedClientID PrivateKey = $providedPrivateKey @@ -63,13 +63,13 @@ LogGroup 'GitHub-Script - Installed modules' { } if ($providedClientID -and $providedPrivateKey) { - LogGroup 'GitHub-Script - Connected using provided GitHub App' { - Connect-GitHub -ClientID $env:GITHUB_ACTION_INPUT_ClientID -PrivateKey $env:GITHUB_ACTION_INPUT_PrivateKey -Silent + LogGroup "$(Connect-GitHub -ClientID $env:GITHUB_ACTION_INPUT_ClientID -PrivateKey $env:GITHUB_ACTION_INPUT_PrivateKey)" { + Write-Host 'GitHub-Script - Connected using provided GitHub App' Get-GitHubContext | Select-Object -Property * | Format-List } } elseif ($providedToken) { - LogGroup 'GitHub-Script - Connected using provided token' { - Connect-GitHub -Token $env:GITHUB_ACTION_INPUT_Token -Silent + LogGroup "$(Connect-GitHub -Token $env:GITHUB_ACTION_INPUT_Token)" { + Write-Host 'GitHub-Script - Connected using provided token' Get-GitHubContext | Select-Object -Property * | Format-List } } From b425329bf67c98d6fd2dd5e791ec0ec1c9426084 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 22:44:55 +0100 Subject: [PATCH 11/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Refactor=20GitH?= =?UTF-8?q?ub=20connection=20logging=20to=20improve=20clarity=20and=20redu?= =?UTF-8?q?ce=20output=20noise?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 046ad4a..e9b28b6 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -63,13 +63,13 @@ LogGroup 'GitHub-Script - Installed modules' { } if ($providedClientID -and $providedPrivateKey) { - LogGroup "$(Connect-GitHub -ClientID $env:GITHUB_ACTION_INPUT_ClientID -PrivateKey $env:GITHUB_ACTION_INPUT_PrivateKey)" { - Write-Host 'GitHub-Script - Connected using provided GitHub App' + LogGroup 'GitHub-Script - Connected using provided GitHub App' { + Connect-GitHub -ClientID $env:GITHUB_ACTION_INPUT_ClientID -PrivateKey $env:GITHUB_ACTION_INPUT_PrivateKey -Silent Get-GitHubContext | Select-Object -Property * | Format-List } } elseif ($providedToken) { - LogGroup "$(Connect-GitHub -Token $env:GITHUB_ACTION_INPUT_Token)" { - Write-Host 'GitHub-Script - Connected using provided token' + LogGroup 'GitHub-Script - Connected using provided token' { + Connect-GitHub -Token $env:GITHUB_ACTION_INPUT_Token -Silent Get-GitHubContext | Select-Object -Property * | Format-List } } From 972f70a8f3072f5c6e6fc180dad00f9a0d7c2108 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 22:47:50 +0100 Subject: [PATCH 12/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Update=20log=20?= =?UTF-8?q?group=20formatting=20for=20consistency=20and=20improved=20reada?= =?UTF-8?q?bility?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index e9b28b6..6a23d6c 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -5,7 +5,7 @@ $DebugPreference = $env:GITHUB_ACTION_INPUT_Debug -eq 'true' ? 'Continue' : 'Sil $VerbosePreference = $env:GITHUB_ACTION_INPUT_Verbose -eq 'true' ? 'Continue' : 'SilentlyContinue' $env:PSMODULE_GITHUB_SCRIPT = $true -'::group::GitHub-Script - Setup GitHub PowerShell' +'::group::GitHub-Script | Setup GitHub PowerShell' $Name = 'GitHub' $Version = [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Version) ? $null : $env:GITHUB_ACTION_INPUT_Version @@ -58,23 +58,23 @@ $providedClientID = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Client $providedPrivateKey = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_PrivateKey) '::endgroup::' -LogGroup 'GitHub-Script - Installed modules' { +LogGroup 'GitHub-Script | Installed modules' { Get-InstalledPSResource | Select-Object Name, Version, Prerelease | Sort-Object -Property Name | Format-Table -AutoSize } if ($providedClientID -and $providedPrivateKey) { - LogGroup 'GitHub-Script - Connected using provided GitHub App' { + LogGroup 'GitHub-Script | Connected using provided GitHub App' { Connect-GitHub -ClientID $env:GITHUB_ACTION_INPUT_ClientID -PrivateKey $env:GITHUB_ACTION_INPUT_PrivateKey -Silent - Get-GitHubContext | Select-Object -Property * | Format-List + Get-GitHubContext | Format-List } } elseif ($providedToken) { - LogGroup 'GitHub-Script - Connected using provided token' { + LogGroup 'GitHub-Script | Connected using provided token' { Connect-GitHub -Token $env:GITHUB_ACTION_INPUT_Token -Silent - Get-GitHubContext | Select-Object -Property * | Format-List + Get-GitHubContext | Format-List } } -LogGroup 'GitHub-Script - GitHub module configuration' { +LogGroup 'GitHub-Script | GitHub module configuration' { Get-GitHubConfig | Format-List } From 54db67567385a372163f8e6ca9cb89481a0c0128 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 22:48:32 +0100 Subject: [PATCH 13/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Update=20log=20?= =?UTF-8?q?group=20formatting=20for=20improved=20consistency=20and=20reada?= =?UTF-8?q?bility?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 6a23d6c..4d7c303 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -5,7 +5,7 @@ $DebugPreference = $env:GITHUB_ACTION_INPUT_Debug -eq 'true' ? 'Continue' : 'Sil $VerbosePreference = $env:GITHUB_ACTION_INPUT_Verbose -eq 'true' ? 'Continue' : 'SilentlyContinue' $env:PSMODULE_GITHUB_SCRIPT = $true -'::group::GitHub-Script | Setup GitHub PowerShell' +'::group::GitHub-Script ┃ Setup GitHub PowerShell' $Name = 'GitHub' $Version = [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Version) ? $null : $env:GITHUB_ACTION_INPUT_Version @@ -58,17 +58,17 @@ $providedClientID = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Client $providedPrivateKey = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_PrivateKey) '::endgroup::' -LogGroup 'GitHub-Script | Installed modules' { +LogGroup 'GitHub-Script ┃ Installed modules' { Get-InstalledPSResource | Select-Object Name, Version, Prerelease | Sort-Object -Property Name | Format-Table -AutoSize } if ($providedClientID -and $providedPrivateKey) { - LogGroup 'GitHub-Script | Connected using provided GitHub App' { + LogGroup 'GitHub-Script ┃ Connected using provided GitHub App' { Connect-GitHub -ClientID $env:GITHUB_ACTION_INPUT_ClientID -PrivateKey $env:GITHUB_ACTION_INPUT_PrivateKey -Silent Get-GitHubContext | Format-List } } elseif ($providedToken) { - LogGroup 'GitHub-Script | Connected using provided token' { + LogGroup 'GitHub-Script ┃ Connected using provided token' { Connect-GitHub -Token $env:GITHUB_ACTION_INPUT_Token -Silent Get-GitHubContext | Format-List } From 4b1d8d36dffeb82ea2468d8112e908f106e450e2 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 22:50:18 +0100 Subject: [PATCH 14/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Update=20log=20?= =?UTF-8?q?group=20formatting=20for=20improved=20consistency=20and=20reada?= =?UTF-8?q?bility?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 4d7c303..2ffb50b 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -5,7 +5,7 @@ $DebugPreference = $env:GITHUB_ACTION_INPUT_Debug -eq 'true' ? 'Continue' : 'Sil $VerbosePreference = $env:GITHUB_ACTION_INPUT_Verbose -eq 'true' ? 'Continue' : 'SilentlyContinue' $env:PSMODULE_GITHUB_SCRIPT = $true -'::group::GitHub-Script ┃ Setup GitHub PowerShell' +'::group::GitHub-Script │ Setup GitHub PowerShell' $Name = 'GitHub' $Version = [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Version) ? $null : $env:GITHUB_ACTION_INPUT_Version @@ -58,23 +58,23 @@ $providedClientID = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Client $providedPrivateKey = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_PrivateKey) '::endgroup::' -LogGroup 'GitHub-Script ┃ Installed modules' { +LogGroup 'GitHub-Script │ Installed modules' { Get-InstalledPSResource | Select-Object Name, Version, Prerelease | Sort-Object -Property Name | Format-Table -AutoSize } if ($providedClientID -and $providedPrivateKey) { - LogGroup 'GitHub-Script ┃ Connected using provided GitHub App' { + LogGroup 'GitHub-Script │ Connected using provided GitHub App' { Connect-GitHub -ClientID $env:GITHUB_ACTION_INPUT_ClientID -PrivateKey $env:GITHUB_ACTION_INPUT_PrivateKey -Silent Get-GitHubContext | Format-List } } elseif ($providedToken) { - LogGroup 'GitHub-Script ┃ Connected using provided token' { + LogGroup 'GitHub-Script │ Connected using provided token' { Connect-GitHub -Token $env:GITHUB_ACTION_INPUT_Token -Silent Get-GitHubContext | Format-List } } -LogGroup 'GitHub-Script | GitHub module configuration' { +LogGroup 'GitHub-Script │ GitHub module configuration' { Get-GitHubConfig | Format-List } From b71f473be14a6bb1deb13227f0837b6237aa3e06 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 22:51:31 +0100 Subject: [PATCH 15/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Standardize=20l?= =?UTF-8?q?og=20group=20formatting=20for=20improved=20consistency=20and=20?= =?UTF-8?q?readability?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 2ffb50b..6a23d6c 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -5,7 +5,7 @@ $DebugPreference = $env:GITHUB_ACTION_INPUT_Debug -eq 'true' ? 'Continue' : 'Sil $VerbosePreference = $env:GITHUB_ACTION_INPUT_Verbose -eq 'true' ? 'Continue' : 'SilentlyContinue' $env:PSMODULE_GITHUB_SCRIPT = $true -'::group::GitHub-Script │ Setup GitHub PowerShell' +'::group::GitHub-Script | Setup GitHub PowerShell' $Name = 'GitHub' $Version = [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Version) ? $null : $env:GITHUB_ACTION_INPUT_Version @@ -58,23 +58,23 @@ $providedClientID = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Client $providedPrivateKey = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_PrivateKey) '::endgroup::' -LogGroup 'GitHub-Script │ Installed modules' { +LogGroup 'GitHub-Script | Installed modules' { Get-InstalledPSResource | Select-Object Name, Version, Prerelease | Sort-Object -Property Name | Format-Table -AutoSize } if ($providedClientID -and $providedPrivateKey) { - LogGroup 'GitHub-Script │ Connected using provided GitHub App' { + LogGroup 'GitHub-Script | Connected using provided GitHub App' { Connect-GitHub -ClientID $env:GITHUB_ACTION_INPUT_ClientID -PrivateKey $env:GITHUB_ACTION_INPUT_PrivateKey -Silent Get-GitHubContext | Format-List } } elseif ($providedToken) { - LogGroup 'GitHub-Script │ Connected using provided token' { + LogGroup 'GitHub-Script | Connected using provided token' { Connect-GitHub -Token $env:GITHUB_ACTION_INPUT_Token -Silent Get-GitHubContext | Format-List } } -LogGroup 'GitHub-Script │ GitHub module configuration' { +LogGroup 'GitHub-Script | GitHub module configuration' { Get-GitHubConfig | Format-List } From 05df7d59eb4b80b17060b604bc6b5f00725f2475 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 22:52:55 +0100 Subject: [PATCH 16/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Update=20log=20?= =?UTF-8?q?group=20separators=20for=20improved=20visual=20clarity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 6a23d6c..656ebf1 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -4,7 +4,7 @@ param() $DebugPreference = $env:GITHUB_ACTION_INPUT_Debug -eq 'true' ? 'Continue' : 'SilentlyContinue' $VerbosePreference = $env:GITHUB_ACTION_INPUT_Verbose -eq 'true' ? 'Continue' : 'SilentlyContinue' $env:PSMODULE_GITHUB_SCRIPT = $true - +Write-Host '━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' '::group::GitHub-Script | Setup GitHub PowerShell' $Name = 'GitHub' @@ -78,4 +78,4 @@ LogGroup 'GitHub-Script | GitHub module configuration' { Get-GitHubConfig | Format-List } -Write-Host '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' +Write-Host '━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' From 74a4ae5ca747e7382392d79e50fbae02b610aef3 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 22:54:28 +0100 Subject: [PATCH 17/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Update=20log=20?= =?UTF-8?q?group=20separators=20for=20improved=20visual=20consistency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 656ebf1..1552f57 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -5,7 +5,7 @@ $DebugPreference = $env:GITHUB_ACTION_INPUT_Debug -eq 'true' ? 'Continue' : 'Sil $VerbosePreference = $env:GITHUB_ACTION_INPUT_Verbose -eq 'true' ? 'Continue' : 'SilentlyContinue' $env:PSMODULE_GITHUB_SCRIPT = $true Write-Host '━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' -'::group::GitHub-Script | Setup GitHub PowerShell' +'::group::GitHub-Script ┃ Setup GitHub PowerShell' $Name = 'GitHub' $Version = [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Version) ? $null : $env:GITHUB_ACTION_INPUT_Version @@ -58,23 +58,23 @@ $providedClientID = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Client $providedPrivateKey = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_PrivateKey) '::endgroup::' -LogGroup 'GitHub-Script | Installed modules' { +LogGroup 'GitHub-Script ┃ Installed modules' { Get-InstalledPSResource | Select-Object Name, Version, Prerelease | Sort-Object -Property Name | Format-Table -AutoSize } if ($providedClientID -and $providedPrivateKey) { - LogGroup 'GitHub-Script | Connected using provided GitHub App' { + LogGroup 'GitHub-Script ┃ Connected using provided GitHub App' { Connect-GitHub -ClientID $env:GITHUB_ACTION_INPUT_ClientID -PrivateKey $env:GITHUB_ACTION_INPUT_PrivateKey -Silent Get-GitHubContext | Format-List } } elseif ($providedToken) { - LogGroup 'GitHub-Script | Connected using provided token' { + LogGroup 'GitHub-Script ┃ Connected using provided token' { Connect-GitHub -Token $env:GITHUB_ACTION_INPUT_Token -Silent Get-GitHubContext | Format-List } } -LogGroup 'GitHub-Script | GitHub module configuration' { +LogGroup 'GitHub-Script ┃ GitHub module configuration' { Get-GitHubConfig | Format-List } From 41ac2d8a247c8ac1bfdc8716c840dbad30b4ba7e Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 23:02:46 +0100 Subject: [PATCH 18/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Replace=20Write?= =?UTF-8?q?-Host=20with=20Write-Verbose=20for=20improved=20logging=20clari?= =?UTF-8?q?ty?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 1552f57..5ba7cc0 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -13,17 +13,16 @@ $Prerelease = $env:GITHUB_ACTION_INPUT_Prerelease -eq 'true' $alreadyInstalled = Get-InstalledPSResource -Name $Name -ErrorAction SilentlyContinue if ($Version) { - Write-Host "Filtering by version: $Version" + Write-Verbose "Filtering by version: $Version" $alreadyInstalled = $alreadyInstalled | Where-Object Version -EQ $Version } if ($Prerelease) { - Write-Host 'Filtering by prerelease' + Write-Verbose 'Filtering by prerelease' $alreadyInstalled = $alreadyInstalled | Where-Object Prerelease -EQ $Prerelease } -Write-Host 'Already installed:' +Write-Verbose 'Already installed:' $alreadyInstalled | Format-Table if (-not $alreadyInstalled) { - Write-Host "Installing module. Name: [$Name], Version: [$Version], Prerelease: [$Prerelease]" $params = @{ Name = $Name Repository = 'PSGallery' @@ -37,25 +36,26 @@ if (-not $alreadyInstalled) { } $alreadyImported = Get-Module -Name $Name -Write-Host 'Already imported:' +Write-Verbose 'Already imported:' $alreadyImported | Format-Table if (-not $alreadyImported) { - Write-Host "Importing module: $Name" + Write-Verbose "Importing module: $Name" Import-Module -Name $Name } $providedToken = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Token) $providedClientID = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_ClientID) $providedPrivateKey = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_PrivateKey) -Write-Host 'Provided authentication info:' [pscustomobject]@{ - Token = $providedToken - ClientID = $providedClientID - PrivateKey = $providedPrivateKey -} | Format-List -Property Name, Value -$providedToken = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Token) -$providedClientID = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_ClientID) -$providedPrivateKey = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_PrivateKey) + Name = $Name + Version = $Version + Prerelease = $Prerelease + 'Already installed' = $alreadyInstalled + 'Already imported' = $alreadyImported + 'Provided Token' = $providedToken + 'Provided ClientID' = $providedClientID + 'Provided PrivateKey' = $providedPrivateKey +} | Format-List '::endgroup::' LogGroup 'GitHub-Script ┃ Installed modules' { From 31cc45b0926ecbdc6f2cf54145042e206b11b592 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 23:04:35 +0100 Subject: [PATCH 19/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Move=20Debug=20?= =?UTF-8?q?and=20Verbose=20preference=20settings=20to=20the=20end=20of=20t?= =?UTF-8?q?he=20script=20for=20better=20organization?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 5ba7cc0..27df575 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -1,8 +1,6 @@ [CmdletBinding()] param() -$DebugPreference = $env:GITHUB_ACTION_INPUT_Debug -eq 'true' ? 'Continue' : 'SilentlyContinue' -$VerbosePreference = $env:GITHUB_ACTION_INPUT_Verbose -eq 'true' ? 'Continue' : 'SilentlyContinue' $env:PSMODULE_GITHUB_SCRIPT = $true Write-Host '━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' '::group::GitHub-Script ┃ Setup GitHub PowerShell' @@ -79,3 +77,6 @@ LogGroup 'GitHub-Script ┃ GitHub module configuration' { } Write-Host '━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' + +$DebugPreference = $env:GITHUB_ACTION_INPUT_Debug -eq 'true' ? 'Continue' : 'SilentlyContinue' +$VerbosePreference = $env:GITHUB_ACTION_INPUT_Verbose -eq 'true' ? 'Continue' : 'SilentlyContinue' From 3559a7e1e96dca33dfb29f04d4fe9d9f1181a376 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 23:09:52 +0100 Subject: [PATCH 20/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Replace=20Write?= =?UTF-8?q?-Host=20with=20Write-Verbose=20for=20improved=20logging=20clari?= =?UTF-8?q?ty=20and=20update=20log=20group=20formatting=20for=20consistenc?= =?UTF-8?q?y?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 27df575..845ea8f 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -3,7 +3,7 @@ param() $env:PSMODULE_GITHUB_SCRIPT = $true Write-Host '━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' -'::group::GitHub-Script ┃ Setup GitHub PowerShell' +Write-Host '::group::GitHub-Script ┃ Setup GitHub PowerShell' $Name = 'GitHub' $Version = [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Version) ? $null : $env:GITHUB_ACTION_INPUT_Version @@ -54,22 +54,21 @@ $providedPrivateKey = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Priv 'Provided ClientID' = $providedClientID 'Provided PrivateKey' = $providedPrivateKey } | Format-List -'::endgroup::' +Write-Host '::endgroup::' LogGroup 'GitHub-Script ┃ Installed modules' { Get-InstalledPSResource | Select-Object Name, Version, Prerelease | Sort-Object -Property Name | Format-Table -AutoSize } -if ($providedClientID -and $providedPrivateKey) { - LogGroup 'GitHub-Script ┃ Connected using provided GitHub App' { +LogGroup 'GitHub-Script ┃ Connected to GitHub' { + if ($providedClientID -and $providedPrivateKey) { + Write-Verbose 'Connected using provided GitHub App' Connect-GitHub -ClientID $env:GITHUB_ACTION_INPUT_ClientID -PrivateKey $env:GITHUB_ACTION_INPUT_PrivateKey -Silent - Get-GitHubContext | Format-List - } -} elseif ($providedToken) { - LogGroup 'GitHub-Script ┃ Connected using provided token' { + } elseif ($providedToken) { + Write-Verbose 'Connected using provided token' Connect-GitHub -Token $env:GITHUB_ACTION_INPUT_Token -Silent - Get-GitHubContext | Format-List } + Get-GitHubContext | Format-List } LogGroup 'GitHub-Script ┃ GitHub module configuration' { From f8b4b8c1496b5364351e50872881a5fe3c0c2ef4 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 23:11:59 +0100 Subject: [PATCH 21/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Simplify=20log?= =?UTF-8?q?=20group=20name=20for=20GitHub=20module=20configuration=20for?= =?UTF-8?q?=20improved=20clarity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 845ea8f..109584c 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -71,7 +71,7 @@ LogGroup 'GitHub-Script ┃ Connected to GitHub' { Get-GitHubContext | Format-List } -LogGroup 'GitHub-Script ┃ GitHub module configuration' { +LogGroup 'GitHub-Script ┃ Configuration' { Get-GitHubConfig | Format-List } From e0de540e8192347354993225d2bc08f356710de7 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 23:14:45 +0100 Subject: [PATCH 22/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Update=20versio?= =?UTF-8?q?n=20handling=20to=20default=20to=20'latest'=20if=20not=20provid?= =?UTF-8?q?ed=20and=20improve=20boolean=20checks=20for=20installation=20an?= =?UTF-8?q?d=20import=20status?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 109584c..f69a222 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -46,10 +46,10 @@ $providedClientID = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Client $providedPrivateKey = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_PrivateKey) [pscustomobject]@{ Name = $Name - Version = $Version + Version = [string]::IsNullOrEmpty($Version) ? 'latest' : $Version Prerelease = $Prerelease - 'Already installed' = $alreadyInstalled - 'Already imported' = $alreadyImported + 'Already installed' = $null -ne $alreadyInstalled + 'Already imported' = $null -ne $alreadyImported 'Provided Token' = $providedToken 'Provided ClientID' = $providedClientID 'Provided PrivateKey' = $providedPrivateKey From e49f9a78fc7965e5cfc15f33576be4379a06b9fc Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 23:21:24 +0100 Subject: [PATCH 23/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Refactor=20log?= =?UTF-8?q?=20group=20formatting=20for=20GitHub=20script=20to=20enhance=20?= =?UTF-8?q?clarity=20and=20consistency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index f69a222..f65a3e5 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -2,8 +2,9 @@ param() $env:PSMODULE_GITHUB_SCRIPT = $true -Write-Host '━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' -Write-Host '::group::GitHub-Script ┃ Setup GitHub PowerShell' +┫ GitHub-Script ┣ +Write-Host '━┳━━━━━━━━━━━━━━━━━━┫ GitHub-Script ┣━━━━━━━━━━━━━━━━━━━━' +Write-Host '::group:: ┃ Setup GitHub PowerShell' $Name = 'GitHub' $Version = [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Version) ? $null : $env:GITHUB_ACTION_INPUT_Version @@ -56,11 +57,11 @@ $providedPrivateKey = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Priv } | Format-List Write-Host '::endgroup::' -LogGroup 'GitHub-Script ┃ Installed modules' { +LogGroup ' ┃ Installed modules' { Get-InstalledPSResource | Select-Object Name, Version, Prerelease | Sort-Object -Property Name | Format-Table -AutoSize } -LogGroup 'GitHub-Script ┃ Connected to GitHub' { +LogGroup ' ┃ Connected to GitHub' { if ($providedClientID -and $providedPrivateKey) { Write-Verbose 'Connected using provided GitHub App' Connect-GitHub -ClientID $env:GITHUB_ACTION_INPUT_ClientID -PrivateKey $env:GITHUB_ACTION_INPUT_PrivateKey -Silent @@ -71,11 +72,11 @@ LogGroup 'GitHub-Script ┃ Connected to GitHub' { Get-GitHubContext | Format-List } -LogGroup 'GitHub-Script ┃ Configuration' { +LogGroup ' ┃ Configuration' { Get-GitHubConfig | Format-List } -Write-Host '━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' +Write-Host '━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' $DebugPreference = $env:GITHUB_ACTION_INPUT_Debug -eq 'true' ? 'Continue' : 'SilentlyContinue' $VerbosePreference = $env:GITHUB_ACTION_INPUT_Verbose -eq 'true' ? 'Continue' : 'SilentlyContinue' From 6a731a96c569fd31a156216a9ef2687c2277adb1 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 23:22:41 +0100 Subject: [PATCH 24/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Remove=20unnece?= =?UTF-8?q?ssary=20header=20line=20from=20GitHub=20script=20for=20improved?= =?UTF-8?q?=20readability?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index f65a3e5..a891c47 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -2,7 +2,6 @@ param() $env:PSMODULE_GITHUB_SCRIPT = $true -┫ GitHub-Script ┣ Write-Host '━┳━━━━━━━━━━━━━━━━━━┫ GitHub-Script ┣━━━━━━━━━━━━━━━━━━━━' Write-Host '::group:: ┃ Setup GitHub PowerShell' From 375f8e2f1650b36a3b16b126ef1fca7353fe18cc Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 23:23:48 +0100 Subject: [PATCH 25/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Fix=20formattin?= =?UTF-8?q?g=20of=20log=20group=20separators=20in=20GitHub=20script=20for?= =?UTF-8?q?=20improved=20visual=20consistency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index a891c47..fa2ccfc 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -2,7 +2,7 @@ param() $env:PSMODULE_GITHUB_SCRIPT = $true -Write-Host '━┳━━━━━━━━━━━━━━━━━━┫ GitHub-Script ┣━━━━━━━━━━━━━━━━━━━━' +Write-Host '━━┳━━━━━━━━━━━━━━━━━━┫ GitHub-Script ┣━━━━━━━━━━━━━━━━━━━━━' Write-Host '::group:: ┃ Setup GitHub PowerShell' $Name = 'GitHub' @@ -75,7 +75,7 @@ LogGroup ' ┃ Configuration' { Get-GitHubConfig | Format-List } -Write-Host '━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' +Write-Host '━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' $DebugPreference = $env:GITHUB_ACTION_INPUT_Debug -eq 'true' ? 'Continue' : 'SilentlyContinue' $VerbosePreference = $env:GITHUB_ACTION_INPUT_Verbose -eq 'true' ? 'Continue' : 'SilentlyContinue' From bd7223f6edbdf482c81469742f192d35ad255577 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 23:25:17 +0100 Subject: [PATCH 26/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Standardize=20l?= =?UTF-8?q?og=20group=20separator=20formatting=20in=20GitHub=20script=20fo?= =?UTF-8?q?r=20improved=20visual=20consistency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index fa2ccfc..cf9f0c9 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -2,7 +2,7 @@ param() $env:PSMODULE_GITHUB_SCRIPT = $true -Write-Host '━━┳━━━━━━━━━━━━━━━━━━┫ GitHub-Script ┣━━━━━━━━━━━━━━━━━━━━━' +Write-Host '━━━┳━━━━━━━━━━━━━━━━━━┫ GitHub-Script ┣━━━━━━━━━━━━━━━━━━━━━' Write-Host '::group:: ┃ Setup GitHub PowerShell' $Name = 'GitHub' @@ -75,7 +75,7 @@ LogGroup ' ┃ Configuration' { Get-GitHubConfig | Format-List } -Write-Host '━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' +Write-Host '━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' $DebugPreference = $env:GITHUB_ACTION_INPUT_Debug -eq 'true' ? 'Continue' : 'SilentlyContinue' $VerbosePreference = $env:GITHUB_ACTION_INPUT_Verbose -eq 'true' ? 'Continue' : 'SilentlyContinue' From 6d116ebe65f47e9e55f6a735d70112d10e4ca52f Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 23:46:11 +0100 Subject: [PATCH 27/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Update=20log=20?= =?UTF-8?q?group=20formatting=20in=20GitHub=20script=20for=20improved=20cl?= =?UTF-8?q?arity=20and=20consistency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index cf9f0c9..f69a222 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -2,8 +2,8 @@ param() $env:PSMODULE_GITHUB_SCRIPT = $true -Write-Host '━━━┳━━━━━━━━━━━━━━━━━━┫ GitHub-Script ┣━━━━━━━━━━━━━━━━━━━━━' -Write-Host '::group:: ┃ Setup GitHub PowerShell' +Write-Host '━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' +Write-Host '::group::GitHub-Script ┃ Setup GitHub PowerShell' $Name = 'GitHub' $Version = [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Version) ? $null : $env:GITHUB_ACTION_INPUT_Version @@ -56,11 +56,11 @@ $providedPrivateKey = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Priv } | Format-List Write-Host '::endgroup::' -LogGroup ' ┃ Installed modules' { +LogGroup 'GitHub-Script ┃ Installed modules' { Get-InstalledPSResource | Select-Object Name, Version, Prerelease | Sort-Object -Property Name | Format-Table -AutoSize } -LogGroup ' ┃ Connected to GitHub' { +LogGroup 'GitHub-Script ┃ Connected to GitHub' { if ($providedClientID -and $providedPrivateKey) { Write-Verbose 'Connected using provided GitHub App' Connect-GitHub -ClientID $env:GITHUB_ACTION_INPUT_ClientID -PrivateKey $env:GITHUB_ACTION_INPUT_PrivateKey -Silent @@ -71,11 +71,11 @@ LogGroup ' ┃ Connected to GitHub' { Get-GitHubContext | Format-List } -LogGroup ' ┃ Configuration' { +LogGroup 'GitHub-Script ┃ Configuration' { Get-GitHubConfig | Format-List } -Write-Host '━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' +Write-Host '━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' $DebugPreference = $env:GITHUB_ACTION_INPUT_Debug -eq 'true' ? 'Continue' : 'SilentlyContinue' $VerbosePreference = $env:GITHUB_ACTION_INPUT_Verbose -eq 'true' ? 'Continue' : 'SilentlyContinue' From 4fcaf2f680bb97081af191670133a6e2cd668cc0 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 23:48:52 +0100 Subject: [PATCH 28/43] test --- scripts/main.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index f69a222..522bd5e 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -2,7 +2,7 @@ param() $env:PSMODULE_GITHUB_SCRIPT = $true -Write-Host '━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' +LogGroup '━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' Write-Host '::group::GitHub-Script ┃ Setup GitHub PowerShell' $Name = 'GitHub' @@ -75,7 +75,7 @@ LogGroup 'GitHub-Script ┃ Configuration' { Get-GitHubConfig | Format-List } -Write-Host '━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' +LogGroup '━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' $DebugPreference = $env:GITHUB_ACTION_INPUT_Debug -eq 'true' ? 'Continue' : 'SilentlyContinue' $VerbosePreference = $env:GITHUB_ACTION_INPUT_Verbose -eq 'true' ? 'Continue' : 'SilentlyContinue' From c99810df280e1dc27f2a6125f836d96b07d87365 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 23:49:55 +0100 Subject: [PATCH 29/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Adjust=20log=20?= =?UTF-8?q?group=20formatting=20in=20GitHub=20script=20for=20improved=20vi?= =?UTF-8?q?sual=20consistency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 522bd5e..8b2bda5 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -2,7 +2,7 @@ param() $env:PSMODULE_GITHUB_SCRIPT = $true -LogGroup '━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' +LogGroup '━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' {} Write-Host '::group::GitHub-Script ┃ Setup GitHub PowerShell' $Name = 'GitHub' @@ -75,7 +75,7 @@ LogGroup 'GitHub-Script ┃ Configuration' { Get-GitHubConfig | Format-List } -LogGroup '━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' +LogGroup '━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' {} $DebugPreference = $env:GITHUB_ACTION_INPUT_Debug -eq 'true' ? 'Continue' : 'SilentlyContinue' $VerbosePreference = $env:GITHUB_ACTION_INPUT_Verbose -eq 'true' ? 'Continue' : 'SilentlyContinue' From 8a997c58257555044ef506aad1a421d949ce1a0f Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 23:51:15 +0100 Subject: [PATCH 30/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Replace=20LogGr?= =?UTF-8?q?oup=20with=20Write-Host=20for=20improved=20log=20group=20format?= =?UTF-8?q?ting=20in=20GitHub=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 8b2bda5..a42f570 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -2,7 +2,7 @@ param() $env:PSMODULE_GITHUB_SCRIPT = $true -LogGroup '━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' {} +Write-Host '::group::━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' {} Write-Host '::group::GitHub-Script ┃ Setup GitHub PowerShell' $Name = 'GitHub' From cc12d4502a6c63fb5f39d523f5b6d4824cd2c143 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 23:57:25 +0100 Subject: [PATCH 31/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Update=20log=20?= =?UTF-8?q?group=20indicators=20in=20GitHub=20script=20for=20improved=20cl?= =?UTF-8?q?arity=20and=20consistency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index a42f570..cffda1c 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -2,7 +2,7 @@ param() $env:PSMODULE_GITHUB_SCRIPT = $true -Write-Host '::group::━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' {} +Write-Host '▷━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' {} Write-Host '::group::GitHub-Script ┃ Setup GitHub PowerShell' $Name = 'GitHub' @@ -75,7 +75,7 @@ LogGroup 'GitHub-Script ┃ Configuration' { Get-GitHubConfig | Format-List } -LogGroup '━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' {} +Write-Host '▷━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' {} $DebugPreference = $env:GITHUB_ACTION_INPUT_Debug -eq 'true' ? 'Continue' : 'SilentlyContinue' $VerbosePreference = $env:GITHUB_ACTION_INPUT_Verbose -eq 'true' ? 'Continue' : 'SilentlyContinue' From 38224dd84c69063241e8ed8f8965c6d7c3664db3 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 4 Jan 2025 23:59:15 +0100 Subject: [PATCH 32/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Correct=20log?= =?UTF-8?q?=20group=20formatting=20in=20GitHub=20script=20for=20improved?= =?UTF-8?q?=20visual=20consistency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index cffda1c..9f4494a 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -2,7 +2,7 @@ param() $env:PSMODULE_GITHUB_SCRIPT = $true -Write-Host '▷━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' {} +Write-Host '▷━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' {} Write-Host '::group::GitHub-Script ┃ Setup GitHub PowerShell' $Name = 'GitHub' @@ -75,7 +75,7 @@ LogGroup 'GitHub-Script ┃ Configuration' { Get-GitHubConfig | Format-List } -Write-Host '▷━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' {} +Write-Host '▷━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' {} $DebugPreference = $env:GITHUB_ACTION_INPUT_Debug -eq 'true' ? 'Continue' : 'SilentlyContinue' $VerbosePreference = $env:GITHUB_ACTION_INPUT_Verbose -eq 'true' ? 'Continue' : 'SilentlyContinue' From 9e7c0c3271e93ac2b6f74ef6721ab3810a74465f Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 5 Jan 2025 00:01:25 +0100 Subject: [PATCH 33/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Add=20additiona?= =?UTF-8?q?l=20log=20group=20indicators=20for=20enhanced=20visual=20clarit?= =?UTF-8?q?y=20in=20GitHub=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 9f4494a..c5d59ee 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -2,6 +2,12 @@ param() $env:PSMODULE_GITHUB_SCRIPT = $true +Write-Host '▶' +Write-Host '▷' +Write-Host '▸' +Write-Host '▹' +Write-Host '►' +Write-Host '▻' Write-Host '▷━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' {} Write-Host '::group::GitHub-Script ┃ Setup GitHub PowerShell' From 809d28010168b8303f73d02a4ddfa038dcc8c54c Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 5 Jan 2025 00:13:48 +0100 Subject: [PATCH 34/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Simplify=20log?= =?UTF-8?q?=20group=20arrow=20indicators=20in=20GitHub=20script=20for=20im?= =?UTF-8?q?proved=20readability?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index c5d59ee..d171932 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -2,13 +2,9 @@ param() $env:PSMODULE_GITHUB_SCRIPT = $true -Write-Host '▶' -Write-Host '▷' -Write-Host '▸' -Write-Host '▹' -Write-Host '►' -Write-Host '▻' -Write-Host '▷━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' {} +$arrow = [char]0x25B8 +Write-Host $arrow +Write-Host "$arrow━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" Write-Host '::group::GitHub-Script ┃ Setup GitHub PowerShell' $Name = 'GitHub' @@ -81,7 +77,7 @@ LogGroup 'GitHub-Script ┃ Configuration' { Get-GitHubConfig | Format-List } -Write-Host '▷━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' {} +Write-Host "$arrow━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" $DebugPreference = $env:GITHUB_ACTION_INPUT_Debug -eq 'true' ? 'Continue' : 'SilentlyContinue' $VerbosePreference = $env:GITHUB_ACTION_INPUT_Verbose -eq 'true' ? 'Continue' : 'SilentlyContinue' From 47c0ac812fc9d04af98d45cb388132467596006f Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 5 Jan 2025 00:27:42 +0100 Subject: [PATCH 35/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Enhance=20log?= =?UTF-8?q?=20group=20indicators=20in=20GitHub=20script=20with=20additiona?= =?UTF-8?q?l=20arrow=20characters=20for=20improved=20visual=20hierarchy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index d171932..0cbb34c 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -2,9 +2,20 @@ param() $env:PSMODULE_GITHUB_SCRIPT = $true -$arrow = [char]0x25B8 -Write-Host $arrow -Write-Host "$arrow━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +# Black right-pointing pointer (U+25BA) +$BigRight = [char]0x25BA +Write-Host $BigRight + +# Black down-pointing triangle (U+25BC) +$BigDown = [char]0x25BC +Write-Host $BigDown + +# Black right-pointing triangle (U+23F5) +$LargerRight = [char]0x23F5 +Write-Host $LargerRight + +Write-Host '━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' +Write-Host ' ━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' Write-Host '::group::GitHub-Script ┃ Setup GitHub PowerShell' $Name = 'GitHub' @@ -77,7 +88,7 @@ LogGroup 'GitHub-Script ┃ Configuration' { Get-GitHubConfig | Format-List } -Write-Host "$arrow━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +Write-Host '━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' $DebugPreference = $env:GITHUB_ACTION_INPUT_Debug -eq 'true' ? 'Continue' : 'SilentlyContinue' $VerbosePreference = $env:GITHUB_ACTION_INPUT_Verbose -eq 'true' ? 'Continue' : 'SilentlyContinue' From 30b2ec333d45a6f715392e176f1bb285eb39eb14 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 5 Jan 2025 00:29:53 +0100 Subject: [PATCH 36/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Adjust=20log=20?= =?UTF-8?q?group=20formatting=20in=20GitHub=20script=20for=20improved=20vi?= =?UTF-8?q?sual=20alignment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 0cbb34c..10e91fd 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -14,8 +14,8 @@ Write-Host $BigDown $LargerRight = [char]0x23F5 Write-Host $LargerRight -Write-Host '━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' -Write-Host ' ━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' +Write-Host '━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' +Write-Host ' ━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' Write-Host '::group::GitHub-Script ┃ Setup GitHub PowerShell' $Name = 'GitHub' @@ -88,7 +88,8 @@ LogGroup 'GitHub-Script ┃ Configuration' { Get-GitHubConfig | Format-List } -Write-Host '━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' +Write-Host ' ━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' +Write-Host '━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' $DebugPreference = $env:GITHUB_ACTION_INPUT_Debug -eq 'true' ? 'Continue' : 'SilentlyContinue' $VerbosePreference = $env:GITHUB_ACTION_INPUT_Verbose -eq 'true' ? 'Continue' : 'SilentlyContinue' From e1d8f901acf4c0acc42ddbf5c689ae3829982fb9 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 5 Jan 2025 00:31:56 +0100 Subject: [PATCH 37/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Streamline=20lo?= =?UTF-8?q?g=20group=20formatting=20in=20GitHub=20script=20for=20improved?= =?UTF-8?q?=20visual=20consistency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 10e91fd..fdd6366 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -14,8 +14,7 @@ Write-Host $BigDown $LargerRight = [char]0x23F5 Write-Host $LargerRight -Write-Host '━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' -Write-Host ' ━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' +Write-Host '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' Write-Host '::group::GitHub-Script ┃ Setup GitHub PowerShell' $Name = 'GitHub' @@ -88,8 +87,7 @@ LogGroup 'GitHub-Script ┃ Configuration' { Get-GitHubConfig | Format-List } -Write-Host ' ━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' -Write-Host '━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' +Write-Host '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' $DebugPreference = $env:GITHUB_ACTION_INPUT_Debug -eq 'true' ? 'Continue' : 'SilentlyContinue' $VerbosePreference = $env:GITHUB_ACTION_INPUT_Verbose -eq 'true' ? 'Continue' : 'SilentlyContinue' From 58ebacfd2f0f5cabdf16a07cefbfae8de84cc0dd Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 5 Jan 2025 00:33:26 +0100 Subject: [PATCH 38/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Remove=20unused?= =?UTF-8?q?=20arrow=20character=20indicators=20in=20GitHub=20script=20for?= =?UTF-8?q?=20cleaner=20output?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index fdd6366..c236f2d 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -2,18 +2,6 @@ param() $env:PSMODULE_GITHUB_SCRIPT = $true -# Black right-pointing pointer (U+25BA) -$BigRight = [char]0x25BA -Write-Host $BigRight - -# Black down-pointing triangle (U+25BC) -$BigDown = [char]0x25BC -Write-Host $BigDown - -# Black right-pointing triangle (U+23F5) -$LargerRight = [char]0x23F5 -Write-Host $LargerRight - Write-Host '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' Write-Host '::group::GitHub-Script ┃ Setup GitHub PowerShell' From 41bde80b35e2c21c6a39b4f5f0e2bedbb6432e5d Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 5 Jan 2025 00:48:40 +0100 Subject: [PATCH 39/43] test --- scripts/main.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index c236f2d..fe3cae6 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -2,7 +2,8 @@ param() $env:PSMODULE_GITHUB_SCRIPT = $true -Write-Host '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' +$zwsp = [char]0x200B +Write-Host "$zwsp━━━━━━━━━━━━━━━━┃━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" Write-Host '::group::GitHub-Script ┃ Setup GitHub PowerShell' $Name = 'GitHub' From 4d91ff4704096e82bbb3ce07c02956c7678f7a58 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 5 Jan 2025 00:59:42 +0100 Subject: [PATCH 40/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Refine=20log=20?= =?UTF-8?q?group=20formatting=20in=20GitHub=20script=20for=20enhanced=20cl?= =?UTF-8?q?arity=20and=20visual=20appeal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index fe3cae6..4e5a47e 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -2,9 +2,8 @@ param() $env:PSMODULE_GITHUB_SCRIPT = $true -$zwsp = [char]0x200B -Write-Host "$zwsp━━━━━━━━━━━━━━━━┃━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" -Write-Host '::group::GitHub-Script ┃ Setup GitHub PowerShell' +Write-Host "┏━━━━━━━━━┫ GitHub-Script ┣━━━━━━━━━┓" +Write-Host '::group:: Setup GitHub PowerShell' $Name = 'GitHub' $Version = [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Version) ? $null : $env:GITHUB_ACTION_INPUT_Version @@ -57,11 +56,11 @@ $providedPrivateKey = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Priv } | Format-List Write-Host '::endgroup::' -LogGroup 'GitHub-Script ┃ Installed modules' { +LogGroup ' Installed modules' { Get-InstalledPSResource | Select-Object Name, Version, Prerelease | Sort-Object -Property Name | Format-Table -AutoSize } -LogGroup 'GitHub-Script ┃ Connected to GitHub' { +LogGroup ' Connected to GitHub' { if ($providedClientID -and $providedPrivateKey) { Write-Verbose 'Connected using provided GitHub App' Connect-GitHub -ClientID $env:GITHUB_ACTION_INPUT_ClientID -PrivateKey $env:GITHUB_ACTION_INPUT_PrivateKey -Silent @@ -72,11 +71,11 @@ LogGroup 'GitHub-Script ┃ Connected to GitHub' { Get-GitHubContext | Format-List } -LogGroup 'GitHub-Script ┃ Configuration' { +LogGroup ' Configuration' { Get-GitHubConfig | Format-List } -Write-Host '━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━' +Write-Host '┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛' $DebugPreference = $env:GITHUB_ACTION_INPUT_Debug -eq 'true' ? 'Continue' : 'SilentlyContinue' $VerbosePreference = $env:GITHUB_ACTION_INPUT_Verbose -eq 'true' ? 'Continue' : 'SilentlyContinue' From de1cb5314df50e46129cc107a8ab6c45b50df6c8 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 5 Jan 2025 01:03:14 +0100 Subject: [PATCH 41/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Update=20log=20?= =?UTF-8?q?group=20formatting=20in=20GitHub=20script=20for=20improved=20vi?= =?UTF-8?q?sual=20consistency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 4e5a47e..7f32fc0 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -2,8 +2,8 @@ param() $env:PSMODULE_GITHUB_SCRIPT = $true -Write-Host "┏━━━━━━━━━┫ GitHub-Script ┣━━━━━━━━━┓" -Write-Host '::group:: Setup GitHub PowerShell' +Write-Host "┏━━━━━━━┫ GitHub-Script ┣━━━━━━━┓" +Write-Host '::group:: - Setup GitHub PowerShell' $Name = 'GitHub' $Version = [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Version) ? $null : $env:GITHUB_ACTION_INPUT_Version @@ -75,7 +75,7 @@ LogGroup ' Configuration' { Get-GitHubConfig | Format-List } -Write-Host '┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛' +Write-Host '┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛' $DebugPreference = $env:GITHUB_ACTION_INPUT_Debug -eq 'true' ? 'Continue' : 'SilentlyContinue' $VerbosePreference = $env:GITHUB_ACTION_INPUT_Verbose -eq 'true' ? 'Continue' : 'SilentlyContinue' From 91b41e212d7e145f5fdb5b6d57f2d62fcc886513 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 5 Jan 2025 01:05:59 +0100 Subject: [PATCH 42/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Adjust=20log=20?= =?UTF-8?q?group=20formatting=20in=20GitHub=20script=20for=20improved=20re?= =?UTF-8?q?adability=20and=20consistency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 7f32fc0..7712149 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -2,7 +2,7 @@ param() $env:PSMODULE_GITHUB_SCRIPT = $true -Write-Host "┏━━━━━━━┫ GitHub-Script ┣━━━━━━━┓" +Write-Host "┏━━━━━┫ GitHub-Script ┣━━━━━┓" Write-Host '::group:: - Setup GitHub PowerShell' $Name = 'GitHub' @@ -56,11 +56,11 @@ $providedPrivateKey = -not [string]::IsNullOrEmpty($env:GITHUB_ACTION_INPUT_Priv } | Format-List Write-Host '::endgroup::' -LogGroup ' Installed modules' { +LogGroup ' - Installed modules' { Get-InstalledPSResource | Select-Object Name, Version, Prerelease | Sort-Object -Property Name | Format-Table -AutoSize } -LogGroup ' Connected to GitHub' { +LogGroup ' - Connected to GitHub' { if ($providedClientID -and $providedPrivateKey) { Write-Verbose 'Connected using provided GitHub App' Connect-GitHub -ClientID $env:GITHUB_ACTION_INPUT_ClientID -PrivateKey $env:GITHUB_ACTION_INPUT_PrivateKey -Silent @@ -71,11 +71,11 @@ LogGroup ' Connected to GitHub' { Get-GitHubContext | Format-List } -LogGroup ' Configuration' { +LogGroup ' - Configuration' { Get-GitHubConfig | Format-List } -Write-Host '┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛' +Write-Host '┗━━━━━━━━━━━━━━━━━━━━━━━━━━━┛' $DebugPreference = $env:GITHUB_ACTION_INPUT_Debug -eq 'true' ? 'Continue' : 'SilentlyContinue' $VerbosePreference = $env:GITHUB_ACTION_INPUT_Verbose -eq 'true' ? 'Continue' : 'SilentlyContinue' From f88fd09185a94b3db921cc89cff0767627dfe6fd Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 5 Jan 2025 01:10:13 +0100 Subject: [PATCH 43/43] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Rename=20log=20?= =?UTF-8?q?group=20for=20GitHub=20connection=20to=20enhance=20clarity=20an?= =?UTF-8?q?d=20consistency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 7712149..db873ff 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -60,7 +60,7 @@ LogGroup ' - Installed modules' { Get-InstalledPSResource | Select-Object Name, Version, Prerelease | Sort-Object -Property Name | Format-Table -AutoSize } -LogGroup ' - Connected to GitHub' { +LogGroup ' - GitHub connection' { if ($providedClientID -and $providedPrivateKey) { Write-Verbose 'Connected using provided GitHub App' Connect-GitHub -ClientID $env:GITHUB_ACTION_INPUT_ClientID -PrivateKey $env:GITHUB_ACTION_INPUT_PrivateKey -Silent