-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use double quotes consistently for shell scripts #14938
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,7 +72,7 @@ jobs: | |
- name: Normalize Platform Pair (replace / with -) | ||
run: | | ||
platform=${{ matrix.platform }} | ||
echo "PLATFORM_TUPLE=${platform//\//-}" >> $GITHUB_ENV | ||
echo "PLATFORM_TUPLE=${platform//\//-}" >> "$GITHUB_ENV" | ||
|
||
# Adapted from https://docs.docker.com/build/ci/github-actions/multi-platform/ | ||
- name: Build and push by digest | ||
|
@@ -143,8 +143,8 @@ jobs: | |
# The final command becomes `docker buildx imagetools create -t tag1 -t tag2 ... <RUFF_BASE_IMG>@sha256:<sha256_1> <RUFF_BASE_IMG>@sha256:<sha256_2> ...` | ||
run: | | ||
docker buildx imagetools create \ | ||
$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ | ||
$(printf '${RUFF_BASE_IMG}@sha256:%s ' *) | ||
"$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ | ||
"$(printf "${RUFF_BASE_IMG}@sha256:%s " *)" | ||
Comment on lines
+146
to
+147
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is where the release failure happened. |
||
|
||
docker-publish-extra: | ||
name: Publish additional Docker image based on ${{ matrix.image-mapping }} | ||
|
@@ -203,14 +203,14 @@ jobs: | |
TAG_PATTERNS="${TAG_PATTERNS%\\n}" | ||
|
||
# Export image cache name | ||
echo "IMAGE_REF=${BASE_IMAGE//:/-}" >> $GITHUB_ENV | ||
echo "IMAGE_REF=${BASE_IMAGE//:/-}" >> "$GITHUB_ENV" | ||
|
||
# Export tag patterns using the multiline env var syntax | ||
{ | ||
echo "TAG_PATTERNS<<EOF" | ||
echo -e "${TAG_PATTERNS}" | ||
echo EOF | ||
} >> $GITHUB_ENV | ||
} >> "$GITHUB_ENV" | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
|
@@ -288,5 +288,5 @@ jobs: | |
readarray -t lines <<< "$DOCKER_METADATA_OUTPUT_ANNOTATIONS"; annotations=(); for line in "${lines[@]}"; do annotations+=(--annotation "$line"); done | ||
docker buildx imagetools create \ | ||
"${annotations[@]}" \ | ||
$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ | ||
$(printf '${RUFF_BASE_IMG}@sha256:%s ' *) | ||
"$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON")" \ | ||
"$(printf "${RUFF_BASE_IMG}@sha256:%s " *)" | ||
Comment on lines
+291
to
+292
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And here as well. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -268,9 +268,9 @@ jobs: | |
RELEASE_COMMIT: "${{ github.sha }}" | ||
run: | | ||
# Write and read notes from a file to avoid quoting breaking things | ||
echo "$ANNOUNCEMENT_BODY" > $RUNNER_TEMP/notes.txt | ||
echo "$ANNOUNCEMENT_BODY" > "$RUNNER_TEMP/notes.txt" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't this file auto generated? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, right. Not sure why one is quoted while the other isn't. I'll revert. |
||
|
||
gh release create "${{ needs.plan.outputs.tag }}" --target "$RELEASE_COMMIT" $PRERELEASE_FLAG --title "$ANNOUNCEMENT_TITLE" --notes-file "$RUNNER_TEMP/notes.txt" artifacts/* | ||
gh release create "${{ needs.plan.outputs.tag }}" --target "$RELEASE_COMMIT" "$PRERELEASE_FLAG" --title "$ANNOUNCEMENT_TITLE" --notes-file "$RUNNER_TEMP/notes.txt" artifacts/* | ||
|
||
custom-notify-dependents: | ||
needs: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the nested double quotes here not an issue because they're inside of a
$( )
construct? I would have naively assumed you'd need to backslash-escape them.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think no because
$( )
should start a new context but I think in this specific case I should revert because of the glob.