Skip to content

Commit e0cff1d

Browse files
committed
fix: use array splatting for docker build tag arguments
PowerShell -join collapses all -t args into a single string. Use @tagArgList splatting so each -t and tag are separate args.
1 parent 15685f3 commit e0cff1d

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

.github/workflows/docker-build-ims.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,16 @@ jobs:
6767
run: |
6868
$tags = @"
6969
${{ steps.tags.outputs.tags }}
70-
"@ -split "`n" | Where-Object { $_.Trim() }
70+
"@ -split "`n" | ForEach-Object { $_.Trim() } | Where-Object { $_ }
7171
72-
$tagArgs = ($tags | ForEach-Object { "-t", $_.Trim() }) -join " "
72+
# Build tag arguments as an array for proper splatting
73+
$tagArgList = @()
74+
foreach ($tag in $tags) {
75+
$tagArgList += @('-t', $tag)
76+
}
7377
7478
Write-Host "Building with tags: $($tags -join ', ')"
75-
docker build $tagArgs --build-arg GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} docker/
79+
docker build @tagArgList --build-arg GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} docker/
7680
7781
- name: Push Docker image
7882
if: >-
@@ -83,11 +87,11 @@ jobs:
8387
run: |
8488
$tags = @"
8589
${{ steps.tags.outputs.tags }}
86-
"@ -split "`n" | Where-Object { $_.Trim() }
90+
"@ -split "`n" | ForEach-Object { $_.Trim() } | Where-Object { $_ }
8791
8892
foreach ($tag in $tags) {
89-
Write-Host "Pushing $($tag.Trim())"
90-
docker push $tag.Trim()
93+
Write-Host "Pushing $tag"
94+
docker push $tag
9195
}
9296
9397
- name: Output image details

0 commit comments

Comments
 (0)