From d280ff3a9ccedf415245f199337a8a20b0477ee3 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Mon, 13 Jan 2025 12:40:48 +0100 Subject: [PATCH 01/32] Add GitConfig to boiler plate --- scripts/main.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index bc28c3c..5ac6485 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -95,6 +95,10 @@ process { Get-GitHubConfig | Format-List } + LogGroup ' - Git Configuration' { + Get-GitHubGitConfig | Format-List + } + Write-Host '┗━━━━━━━━━━━━━━━━━━━━━━━━━━━┛' } catch { throw $_ From a07d8a035384f977a6ef4efdbd2c250523ac8bb2 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Mon, 13 Jan 2025 17:22:03 +0100 Subject: [PATCH 02/32] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Enhance=20Git?= =?UTF-8?q?=20configuration=20logging=20to=20include=20system,=20global,?= =?UTF-8?q?=20and=20local=20scopes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.ps1 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 5ac6485..7c009d4 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -95,7 +95,15 @@ process { Get-GitHubConfig | Format-List } - LogGroup ' - Git Configuration' { + LogGroup ' - Git Configuration - System' { + Get-GitHubGitConfig -Scope system | Format-List + } + + LogGroup ' - Git Configuration - Global' { + Get-GitHubGitConfig -Scope global | Format-List + } + + LogGroup ' - Git Configuration - Local' { Get-GitHubGitConfig | Format-List } From 0959bd83a557fe22f1ecee75d8f71f9386fd4956 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Mon, 13 Jan 2025 17:24:10 +0100 Subject: [PATCH 03/32] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Remove=20GitCon?= =?UTF-8?q?fig=20output=20logging=20from=20TestWorkflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/TestWorkflow.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/TestWorkflow.yml b/.github/workflows/TestWorkflow.yml index 0103305..6ed09e5 100644 --- a/.github/workflows/TestWorkflow.yml +++ b/.github/workflows/TestWorkflow.yml @@ -104,10 +104,6 @@ jobs: Set-GitHubOutput -Name 'Context' -Value (Get-GitHubContext) } - LogGroup 'Set outputs - GitConfig' { - Set-GitHubOutput -Name 'GitConfig' -Value (Get-GitHubGitConfig | Where-Object { $_.Name -in 'user.name','user.email' }) - } - LogGroup 'Set outputs - Zen2' { Set-GitHubOutput -Name 'Zen2' -Value $zen } From 07275305bebb7d6ba062adbc718380402b6a7e27 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 14 Jan 2025 20:01:08 +0100 Subject: [PATCH 04/32] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Add=20GitConfig?= =?UTF-8?q?=20output=20to=20workflow=20for=20user=20name=20and=20email?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/TestWorkflow.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/TestWorkflow.yml b/.github/workflows/TestWorkflow.yml index 6ed09e5..5f94bf4 100644 --- a/.github/workflows/TestWorkflow.yml +++ b/.github/workflows/TestWorkflow.yml @@ -104,6 +104,10 @@ jobs: Set-GitHubOutput -Name 'Context' -Value (Get-GitHubContext) } + LogGroup 'Set outputs - GitConfig' { + Set-GitHubOutput -Name 'GitConfig' -Value (Get-GitHubGitConfig | Select-Object -Property 'user.name','user.email') + } + LogGroup 'Set outputs - Zen2' { Set-GitHubOutput -Name 'Zen2' -Value $zen } From c87da6fdfa4ce7ba1c7576657395f409b023ba73 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 14 Jan 2025 21:17:56 +0100 Subject: [PATCH 05/32] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Refactor=20Acti?= =?UTF-8?q?on-Test=20workflow=20to=20include=20Git=20configuration=20loggi?= =?UTF-8?q?ng=20for=20local,=20global,=20and=20system=20scopes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/Action-Test.yml | 44 +++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 8 deletions(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index 77b6918..8a28e05 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -17,12 +17,40 @@ permissions: pull-requests: read jobs: + # ActionTest: + # uses: ./.github/workflows/TestWorkflow.yml + # secrets: inherit + # strategy: + # fail-fast: false + # matrix: + # os: [ubuntu-latest, macos-latest, windows-latest] + # with: + # runs-on: ${{ matrix.os }} + ActionTest: - uses: ./.github/workflows/TestWorkflow.yml - secrets: inherit - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - with: - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Action-Test + uses: ./ + with: + Script: | + LogGroup 'GitConfig - Local' { + $configList = git config --local --list 2>&1 + $configList + $LASTEXITCODE + } + + LogGroup 'GitConfig - Global' { + $configList = git config --global --list 2>&1 + $configList + $LASTEXITCODE + } + + LogGroup 'GitConfig - System' { + $configList = git config --system --list 2>&1 + $configList + $LASTEXITCODE + } From c9966c9bdcff6bf2beebc45eb7d638edef899cb7 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 14 Jan 2025 21:21:21 +0100 Subject: [PATCH 06/32] Refactor Git configuration logging to use a loop for local, global, and system scopes --- .github/workflows/Action-Test.yml | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index 8a28e05..b63ad2f 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -37,20 +37,11 @@ jobs: uses: ./ with: Script: | - LogGroup 'GitConfig - Local' { - $configList = git config --local --list 2>&1 - $configList - $LASTEXITCODE - } - - LogGroup 'GitConfig - Global' { - $configList = git config --global --list 2>&1 - $configList - $LASTEXITCODE - } - - LogGroup 'GitConfig - System' { - $configList = git config --system --list 2>&1 + $scopes = 'local', 'global', 'system' + $scopes | ForEach-Object { + LogGroup "GitConfig - $_" { + $configList = git config --$_ --list 2>&1 $configList $LASTEXITCODE } + } From d9a72355ae3af8890be2607ed9e60b3ed857ba35 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 14 Jan 2025 21:22:15 +0100 Subject: [PATCH 07/32] Refactor Action-Test workflow to improve Git configuration logging structure --- .github/workflows/Action-Test.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index b63ad2f..9e59410 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -37,11 +37,11 @@ jobs: uses: ./ with: Script: | - $scopes = 'local', 'global', 'system' - $scopes | ForEach-Object { - LogGroup "GitConfig - $_" { - $configList = git config --$_ --list 2>&1 - $configList - $LASTEXITCODE + $scopes = 'local', 'global', 'system' + $scopes | ForEach-Object { + LogGroup "GitConfig - $_" { + $configList = git config --$_ --list 2>&1 + $configList + $LASTEXITCODE + } } - } From d3f2a6dfffbe842624b5eaf42a859f59bf29d241 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 14 Jan 2025 21:24:55 +0100 Subject: [PATCH 08/32] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Update=20Action?= =?UTF-8?q?-Test=20workflow=20to=20handle=20Git=20config=20command=20error?= =?UTF-8?q?s=20and=20sort=20output?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/Action-Test.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index 9e59410..9cac0d1 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -41,7 +41,11 @@ jobs: $scopes | ForEach-Object { LogGroup "GitConfig - $_" { $configList = git config --$_ --list 2>&1 + if ($LASTEXITCODE -ne 0) { + $global:LASTEXITCODE = 0 + $configList = $null + } + $configList = $configList | Sort-Object $configList - $LASTEXITCODE } } From 6bb8937a20f4a2e53862651b71d0fcfc69a03c21 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 14 Jan 2025 21:29:25 +0100 Subject: [PATCH 09/32] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Add=20type=20in?= =?UTF-8?q?spection=20for=20Git=20configuration=20list=20in=20Action-Test?= =?UTF-8?q?=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/Action-Test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index 9cac0d1..8daa88d 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -46,6 +46,8 @@ jobs: $configList = $null } $configList = $configList | Sort-Object + $configList | Get-Member + $configList.GetType() $configList } } From b4689224511bd44af99411a7f15c01a7c3c042a7 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 14 Jan 2025 21:32:00 +0100 Subject: [PATCH 10/32] Fix sorting of Git configuration list in Action-Test workflow --- .github/workflows/Action-Test.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index 8daa88d..efe1d6e 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -44,10 +44,11 @@ jobs: if ($LASTEXITCODE -ne 0) { $global:LASTEXITCODE = 0 $configList = $null + } else { + $configList = $configList | Sort-Object + $configList | Get-Member + $configList.GetType() + $configList } - $configList = $configList | Sort-Object - $configList | Get-Member - $configList.GetType() - $configList } } From 16987527cde83fa2c7dcb285a6f750256906e6a9 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 14 Jan 2025 21:35:59 +0100 Subject: [PATCH 11/32] Enhance output formatting for Git configuration list in Action-Test workflow --- .github/workflows/Action-Test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index efe1d6e..a7f95c2 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -46,9 +46,9 @@ jobs: $configList = $null } else { $configList = $configList | Sort-Object - $configList | Get-Member - $configList.GetType() - $configList + $configList | Get-Member | Format-Table -AutoSize + $configList.GetType() | Format-Table -AutoSize + $configList | Format-Table -AutoSize } } } From c3a16f5b9f1c00574ef0eb682fc3ab24dfdb33ad Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 14 Jan 2025 21:36:18 +0100 Subject: [PATCH 12/32] Refactor Action-Test workflow to improve output display of Git configuration list --- .github/workflows/Action-Test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index a7f95c2..de0c3ce 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -48,7 +48,7 @@ jobs: $configList = $configList | Sort-Object $configList | Get-Member | Format-Table -AutoSize $configList.GetType() | Format-Table -AutoSize - $configList | Format-Table -AutoSize + Write-Host $configList } } } From 98ca86e1779639645792aaedd1a8c42c99b97014 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 14 Jan 2025 21:40:51 +0100 Subject: [PATCH 13/32] Refactor Action-Test workflow to parse and format Git configuration list into a structured object --- .github/workflows/Action-Test.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index de0c3ce..ed10e1f 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -44,11 +44,16 @@ jobs: if ($LASTEXITCODE -ne 0) { $global:LASTEXITCODE = 0 $configList = $null - } else { + } else {¨ + $config = @() $configList = $configList | Sort-Object - $configList | Get-Member | Format-Table -AutoSize - $configList.GetType() | Format-Table -AutoSize - Write-Host $configList + $configList | ForEach-Object { + $name, $value += $_ -split '=' + $config += @{ + $name = $value + } + } + $config } } } From 2b042c852bc063797b9c996715da0a1d567e44bf Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 14 Jan 2025 21:41:03 +0100 Subject: [PATCH 14/32] Fix syntax error in Action-Test workflow for Git configuration list processing --- .github/workflows/Action-Test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index ed10e1f..9563881 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -44,7 +44,7 @@ jobs: if ($LASTEXITCODE -ne 0) { $global:LASTEXITCODE = 0 $configList = $null - } else {¨ + } else { $config = @() $configList = $configList | Sort-Object $configList | ForEach-Object { From 7e5501f982a33e4f00475b68816719b51041bbe9 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 14 Jan 2025 21:42:13 +0100 Subject: [PATCH 15/32] Fix assignment operator in Action-Test workflow for Git configuration parsing --- .github/workflows/Action-Test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index 9563881..daf2deb 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -48,7 +48,7 @@ jobs: $config = @() $configList = $configList | Sort-Object $configList | ForEach-Object { - $name, $value += $_ -split '=' + $name, $value = $_ -split '=' $config += @{ $name = $value } From 773d1aeecee25fe30c599351c03fda6169f7345d Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 14 Jan 2025 21:43:31 +0100 Subject: [PATCH 16/32] Enhance output formatting in Action-Test workflow to display Git configuration as a formatted table --- .github/workflows/Action-Test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index daf2deb..6d11012 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -53,7 +53,7 @@ jobs: $name = $value } } - $config + $config | Format-Table -AutoSize } } } From 7c0afd557a109528e270bd19c554ad7a30990aeb Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 14 Jan 2025 21:53:05 +0100 Subject: [PATCH 17/32] Change output formatting in Action-Test workflow to display Git configuration as a list --- .github/workflows/Action-Test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index 6d11012..8224916 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -53,7 +53,7 @@ jobs: $name = $value } } - $config | Format-Table -AutoSize + $config | Select-Object Name,Value | Format-List } } } From a4ae13cbc95204f99f0a4f30dcb1c1d348d44522 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 14 Jan 2025 21:57:03 +0100 Subject: [PATCH 18/32] Refactor Action-Test workflow to use PSCustomObject for Git configuration storage --- .github/workflows/Action-Test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index 8224916..7222e70 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -49,11 +49,11 @@ jobs: $configList = $configList | Sort-Object $configList | ForEach-Object { $name, $value = $_ -split '=' - $config += @{ + $config += [pscustomobject]@{ $name = $value } } - $config | Select-Object Name,Value | Format-List + $config | Format-List } } } From 80e3550dfb0984325e860a2a808bbc84003ea584 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 14 Jan 2025 22:02:04 +0100 Subject: [PATCH 19/32] Refactor Action-Test workflow to improve Git configuration object handling --- .github/workflows/Action-Test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index 7222e70..6c3908a 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -49,11 +49,11 @@ jobs: $configList = $configList | Sort-Object $configList | ForEach-Object { $name, $value = $_ -split '=' - $config += [pscustomobject]@{ + $config += @{ $name = $value } } - $config | Format-List + $config.GetEnumerator() | Format-List } } } From 2c3abebb872e6bc25750b451271fde6e939333a7 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 14 Jan 2025 22:03:00 +0100 Subject: [PATCH 20/32] Refactor Action-Test workflow to improve Git configuration output formatting --- .github/workflows/Action-Test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index 6c3908a..19dc416 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -53,7 +53,9 @@ jobs: $name = $value } } - $config.GetEnumerator() | Format-List + $config | ForEach-Object { + $_.GetEnumerator() + } | Format-List } } } From d9d6f76ee0a7cf2f126ccf527c85c7dbf20eba36 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 14 Jan 2025 22:30:25 +0100 Subject: [PATCH 21/32] Refactor Action-Test workflow to improve Git configuration handling and output formatting --- .github/workflows/Action-Test.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index 19dc416..7cebf7a 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -40,7 +40,8 @@ jobs: $scopes = 'local', 'global', 'system' $scopes | ForEach-Object { LogGroup "GitConfig - $_" { - $configList = git config --$_ --list 2>&1 + $Scope = $_ + $configList = git config --$Scope --list 2>&1 if ($LASTEXITCODE -ne 0) { $global:LASTEXITCODE = 0 $configList = $null @@ -48,14 +49,16 @@ jobs: $config = @() $configList = $configList | Sort-Object $configList | ForEach-Object { - $name, $value = $_ -split '=' + $name, $value = $_ -split '=', 2 + if ($value -match '(?i)AUTHORIZATION:\s*(?[^\s]+)\s+(?.*)') { + $secret = $matches['token'] + Add-GitHubMask -Value $secret + } $config += @{ - $name = $value + ($name.Trim()) = ($value.Trim()) } } - $config | ForEach-Object { - $_.GetEnumerator() - } | Format-List + $config } } } From 137af43d3fbaaf2164fe3b453a22562de06ab6cc Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 14 Jan 2025 22:31:49 +0100 Subject: [PATCH 22/32] Change output formatting in Action-Test workflow to display Git configuration as a formatted list --- .github/workflows/Action-Test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index 7cebf7a..b7bae0e 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -58,7 +58,7 @@ jobs: ($name.Trim()) = ($value.Trim()) } } - $config + $config | Format-List } } } From 13823840115faa2931ea590bd12f7b5cac5b51db Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 14 Jan 2025 22:45:33 +0100 Subject: [PATCH 23/32] Add debug output to Action-Test workflow for Git configuration --- .github/workflows/Action-Test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index b7bae0e..8699b9f 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -36,6 +36,7 @@ jobs: - name: Action-Test uses: ./ with: + Debug: true Script: | $scopes = 'local', 'global', 'system' $scopes | ForEach-Object { @@ -50,6 +51,8 @@ jobs: $configList = $configList | Sort-Object $configList | ForEach-Object { $name, $value = $_ -split '=', 2 + Write-Debug "Name: $name" + Write-Debug "Value: $value" if ($value -match '(?i)AUTHORIZATION:\s*(?[^\s]+)\s+(?.*)') { $secret = $matches['token'] Add-GitHubMask -Value $secret From 57afd3bf937aef80ae86bf88a2e518f9bcf5f542 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 14 Jan 2025 22:48:17 +0100 Subject: [PATCH 24/32] Fix token masking in Action-Test workflow to use correct match variable --- .github/workflows/Action-Test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index 8699b9f..8adda80 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -54,8 +54,7 @@ jobs: Write-Debug "Name: $name" Write-Debug "Value: $value" if ($value -match '(?i)AUTHORIZATION:\s*(?[^\s]+)\s+(?.*)') { - $secret = $matches['token'] - Add-GitHubMask -Value $secret + Add-GitHubMask -Value $matches['token'] } $config += @{ ($name.Trim()) = ($value.Trim()) From 376d6798fc7913b8ada46152f56c0e0d904a7612 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 14 Jan 2025 22:52:49 +0100 Subject: [PATCH 25/32] Change output formatting in Action-Test workflow to use a table for Git configuration --- .github/workflows/Action-Test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index 8adda80..1aff78b 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -60,7 +60,7 @@ jobs: ($name.Trim()) = ($value.Trim()) } } - $config | Format-List + $config | Format-Table } } } From 8894c841b2688d47a39ee18674fb1761d44d4dc3 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 14 Jan 2025 23:01:26 +0100 Subject: [PATCH 26/32] test --- .github/workflows/Action-Test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index 1aff78b..f9101d1 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -60,7 +60,7 @@ jobs: ($name.Trim()) = ($value.Trim()) } } - $config | Format-Table + $config | Format-Table -Property * -AutoSize } } } From 788c31664f6dc83a84a2331e93d22f2f01b756ce Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 14 Jan 2025 23:01:43 +0100 Subject: [PATCH 27/32] Remove debug output from Action-Test workflow to streamline execution --- .github/workflows/Action-Test.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index f9101d1..7982e62 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -36,7 +36,6 @@ jobs: - name: Action-Test uses: ./ with: - Debug: true Script: | $scopes = 'local', 'global', 'system' $scopes | ForEach-Object { @@ -51,8 +50,6 @@ jobs: $configList = $configList | Sort-Object $configList | ForEach-Object { $name, $value = $_ -split '=', 2 - Write-Debug "Name: $name" - Write-Debug "Value: $value" if ($value -match '(?i)AUTHORIZATION:\s*(?[^\s]+)\s+(?.*)') { Add-GitHubMask -Value $matches['token'] } From b240a12fd3d6f567686ed711cd3756b9470e8b3d Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 14 Jan 2025 23:02:42 +0100 Subject: [PATCH 28/32] Change output formatting in Action-Test workflow to display only Name and Value properties --- .github/workflows/Action-Test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index 7982e62..a1428a0 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -57,7 +57,7 @@ jobs: ($name.Trim()) = ($value.Trim()) } } - $config | Format-Table -Property * -AutoSize + $config | Format-Table -Property Name, Value -AutoSize } } } From b8b53dde1cbd6f1449851b82675da9d81aefd27f Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 14 Jan 2025 23:04:17 +0100 Subject: [PATCH 29/32] Remove AutoSize option from table formatting in Action-Test workflow --- .github/workflows/Action-Test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index a1428a0..ecb15bb 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -57,7 +57,7 @@ jobs: ($name.Trim()) = ($value.Trim()) } } - $config | Format-Table -Property Name, Value -AutoSize + $config | Format-Table -Property Name, Value } } } From 4b04662e6e4610522139fdbee5a7b18f4e723989 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Wed, 15 Jan 2025 15:16:42 +0100 Subject: [PATCH 30/32] Revert --- .github/workflows/Action-Test.yml | 51 +++++-------------------------- scripts/main.ps1 | 12 -------- 2 files changed, 8 insertions(+), 55 deletions(-) diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index ecb15bb..77b6918 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -17,47 +17,12 @@ permissions: pull-requests: read jobs: - # ActionTest: - # uses: ./.github/workflows/TestWorkflow.yml - # secrets: inherit - # strategy: - # fail-fast: false - # matrix: - # os: [ubuntu-latest, macos-latest, windows-latest] - # with: - # runs-on: ${{ matrix.os }} - ActionTest: - runs-on: ubuntu-latest - steps: - - name: Checkout repo - uses: actions/checkout@v4 - - - name: Action-Test - uses: ./ - with: - Script: | - $scopes = 'local', 'global', 'system' - $scopes | ForEach-Object { - LogGroup "GitConfig - $_" { - $Scope = $_ - $configList = git config --$Scope --list 2>&1 - if ($LASTEXITCODE -ne 0) { - $global:LASTEXITCODE = 0 - $configList = $null - } else { - $config = @() - $configList = $configList | Sort-Object - $configList | ForEach-Object { - $name, $value = $_ -split '=', 2 - if ($value -match '(?i)AUTHORIZATION:\s*(?[^\s]+)\s+(?.*)') { - Add-GitHubMask -Value $matches['token'] - } - $config += @{ - ($name.Trim()) = ($value.Trim()) - } - } - $config | Format-Table -Property Name, Value - } - } - } + uses: ./.github/workflows/TestWorkflow.yml + secrets: inherit + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + with: + runs-on: ${{ matrix.os }} diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 7c009d4..bc28c3c 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -95,18 +95,6 @@ process { Get-GitHubConfig | Format-List } - LogGroup ' - Git Configuration - System' { - Get-GitHubGitConfig -Scope system | Format-List - } - - LogGroup ' - Git Configuration - Global' { - Get-GitHubGitConfig -Scope global | Format-List - } - - LogGroup ' - Git Configuration - Local' { - Get-GitHubGitConfig | Format-List - } - Write-Host '┗━━━━━━━━━━━━━━━━━━━━━━━━━━━┛' } catch { throw $_ From d846ecc40b46982d53b19363bcf7da398c16b7c6 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Wed, 15 Jan 2025 15:19:34 +0100 Subject: [PATCH 31/32] Refactor GitConfig output to filter properties by name --- .github/workflows/TestWorkflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/TestWorkflow.yml b/.github/workflows/TestWorkflow.yml index 5f94bf4..0103305 100644 --- a/.github/workflows/TestWorkflow.yml +++ b/.github/workflows/TestWorkflow.yml @@ -105,7 +105,7 @@ jobs: } LogGroup 'Set outputs - GitConfig' { - Set-GitHubOutput -Name 'GitConfig' -Value (Get-GitHubGitConfig | Select-Object -Property 'user.name','user.email') + Set-GitHubOutput -Name 'GitConfig' -Value (Get-GitHubGitConfig | Where-Object { $_.Name -in 'user.name','user.email' }) } LogGroup 'Set outputs - Zen2' { From 457b5c6baf87415293b7d0224e6aa80d3c8319a2 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Wed, 15 Jan 2025 15:25:06 +0100 Subject: [PATCH 32/32] Update GitConfig output to retrieve system scope settings --- .github/workflows/TestWorkflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/TestWorkflow.yml b/.github/workflows/TestWorkflow.yml index 0103305..93a6fbd 100644 --- a/.github/workflows/TestWorkflow.yml +++ b/.github/workflows/TestWorkflow.yml @@ -105,7 +105,7 @@ jobs: } LogGroup 'Set outputs - GitConfig' { - Set-GitHubOutput -Name 'GitConfig' -Value (Get-GitHubGitConfig | Where-Object { $_.Name -in 'user.name','user.email' }) + Set-GitHubOutput -Name 'GitConfig' -Value (Get-GitHubGitConfig -Scope system) } LogGroup 'Set outputs - Zen2' {