Skip to content

Commit c9966c9

Browse files
Refactor Git configuration logging to use a loop for local, global, and system scopes
1 parent c87da6f commit c9966c9

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

.github/workflows/Action-Test.yml

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,11 @@ jobs:
3737
uses: ./
3838
with:
3939
Script: |
40-
LogGroup 'GitConfig - Local' {
41-
$configList = git config --local --list 2>&1
42-
$configList
43-
$LASTEXITCODE
44-
}
45-
46-
LogGroup 'GitConfig - Global' {
47-
$configList = git config --global --list 2>&1
48-
$configList
49-
$LASTEXITCODE
50-
}
51-
52-
LogGroup 'GitConfig - System' {
53-
$configList = git config --system --list 2>&1
40+
$scopes = 'local', 'global', 'system'
41+
$scopes | ForEach-Object {
42+
LogGroup "GitConfig - $_" {
43+
$configList = git config --$_ --list 2>&1
5444
$configList
5545
$LASTEXITCODE
5646
}
47+
}

0 commit comments

Comments
 (0)