diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index a0411a1..cd0a41a 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -198,10 +198,14 @@ jobs: run: | set -euo pipefail ls -l - tag_args=$(jq -r '.tags[]? | "-t \(.)"' <<< "${{ steps.meta.outputs.tags }}" | tr '\n' ' ') - echo "tags: $tag_args" + # metadata 的 tags 是多行文本,逐行转成 -t 参数(不能用 jq:它不是 JSON) + tag_args=() + while IFS= read -r tag; do + [ -n "$tag" ] && tag_args+=(-t "$tag") + done <<< "${{ steps.meta.outputs.tags }}" + printf 'tag: %s\n' "${tag_args[@]}" docker buildx imagetools create \ - $tag_args \ + "${tag_args[@]}" \ $(printf "${IMAGE}@sha256:%s " *) - name: Inspect published manifest