Skip to content

Commit 803fc84

Browse files
committed
Fix LongBridge env sync delimiter handling
1 parent 2eb1d10 commit 803fc84

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

.github/workflows/sync-cloud-run-env.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,21 @@ jobs:
582582
run: |
583583
set -euo pipefail
584584
585+
join_by_delimiter() {
586+
local delimiter="$1"
587+
shift
588+
local output=""
589+
local item
590+
for item in "$@"; do
591+
if [ -z "${output}" ]; then
592+
output="${item}"
593+
else
594+
output="${output}${delimiter}${item}"
595+
fi
596+
done
597+
printf '%s' "${output}"
598+
}
599+
585600
env_pairs=(
586601
"GLOBAL_TELEGRAM_CHAT_ID=${GLOBAL_TELEGRAM_CHAT_ID}"
587602
"NOTIFY_LANG=${NOTIFY_LANG}"
@@ -666,7 +681,7 @@ jobs:
666681
run services update "${CLOUD_RUN_SERVICE}"
667682
--region "${CLOUD_RUN_REGION}"
668683
--remove-env-vars "$(IFS=,; echo "${remove_env_vars[*]}")"
669-
--update-env-vars "$(IFS=,; echo "${env_pairs[*]}")"
684+
--update-env-vars "^|^$(join_by_delimiter "|" "${env_pairs[@]}")"
670685
)
671686
672687
if [ "${#remove_secret_vars[@]}" -gt 0 ]; then

0 commit comments

Comments
 (0)