Skip to content

Commit 0d1959a

Browse files
committed
chore: prevent shell escaping
1 parent 0af7be8 commit 0d1959a

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

.github/workflows/wc-build-push.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,16 @@ jobs:
124124
type=semver,pattern={{major}}
125125
- name: Create manifest list and push
126126
working-directory: ${{ runner.temp }}/digests
127-
128127
run: |
129-
set -xo pipefail
128+
set -xEeuo pipefail
130129
131-
readarray -t annotations < <(echo '${{ steps.metadata.outputs.json }}' | jq -r '.annotations[] | "--annotation " + @sh')
132-
readarray -t tags < <(echo '${{ steps.metadata.outputs.json }}' | jq -r '.tags[] | "--tag " + @sh')
133-
source=$(printf '${{ env.REGISTRY }}/${{ github.repository }}-${{ inputs.flavor }}@sha256:%s ' *)
130+
echo '${{ steps.metadata.outputs.json }}' | jq -r '.annotations | map("--annotation " + @sh) | join(" ")' > annotations
134131
132+
# shellcheck disable=SC2046
135133
docker buildx imagetools create \
136-
"${annotations[@]}" \
137-
"${tags[@]}" \
138-
$source
134+
$(cat annotations) \
135+
$(echo '${{ steps.metadata.outputs.json }}' | jq -r '.tags | map("--tag " + @sh) | join(" ")') \
136+
$(printf '${{ env.REGISTRY }}/${{ github.repository }}-${{ inputs.flavor }}@sha256:%s ' *)
139137
- name: Inspect manifest and extract digest
140138
id: inspect-manifest
141139
run: |

0 commit comments

Comments
 (0)