Skip to content

Commit

Permalink
workflows/docker: use safer delimiters
Browse files Browse the repository at this point in the history
Co-authored-by: Carlo Cabrera <[email protected]>
  • Loading branch information
ZhongRuoyu and carlocab committed Aug 27, 2024
1 parent d452cd9 commit 73b8950
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ jobs:
date="$(date --rfc-3339=seconds --utc)"
brew_version="$(git describe --tags --dirty --abbrev=7)"
DELIMITER="END_LABELS_$(LC_ALL=C tr -dc '[:alnum:]' </dev/urandom | head -c20)"
cat <<EOS | tee -a "${GITHUB_OUTPUT}"
labels<<END_LABELS
labels<<${DELIMITER}
org.opencontainers.image.created=${date}
org.opencontainers.image.url=https://brew.sh
org.opencontainers.image.documentation=https://docs.brew.sh
Expand All @@ -50,7 +51,7 @@ jobs:
org.opencontainers.image.revision=${GITHUB_SHA}
org.opencontainers.image.vendor=${GITHUB_REPOSITORY_OWNER}
org.opencontainers.image.licenses=BSD-2-Clause
END_LABELS
${DELIMITER}
EOS
tags=()
Expand Down Expand Up @@ -80,9 +81,10 @@ jobs:
{
if [[ "${#tags[@]}" -ne 0 ]]; then
echo "tags<<END_TAGS"
DELIMITER="END_TAGS_$(LC_ALL=C tr -dc '[:alnum:]' </dev/urandom | head -c20)"
echo "tags<<${DELIMITER}"
printf "%s\n" "${tags[@]}"
echo "END_TAGS"
echo "${DELIMITER}"
echo "push=true"
else
echo "push=false"
Expand Down

0 comments on commit 73b8950

Please sign in to comment.