Skip to content

Commit 8a051c0

Browse files
committed
another go
1 parent dd18620 commit 8a051c0

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

actions/caprover-setup/action.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,16 @@ runs:
6262
- name: Update App Settings
6363
shell: bash
6464
run: |
65-
# Build JSON payload using jq to properly handle multiline values in env vars
66-
PAYLOAD=$(jq -n \
65+
# Escape newlines in ENV_VARS (handles multiline secrets like PEM keys)
66+
ENV_VARS_ESCAPED=$(printf '%s' "$ENV_VARS" | jq -Rsa 'gsub("\n"; "\\n") | fromjson')
67+
68+
PAYLOAD=$(jq -nc \
6769
--arg appName "$APP_NAME" \
6870
--argjson websocketSupport "$WEBSOCKET_SUPPORT" \
6971
--argjson containerHttpPort "$CONTAINER_HTTP_PORT" \
7072
--argjson instanceCount "$INSTANCE_COUNT" \
71-
--argjson envVars "$ENV_VARS" \
72-
'{appName: $appName, websocketSupport: $websocketSupport, containerHttpPort: $containerHttpPort, instanceCount: $instanceCount, envVars: $envVars}')
73+
--argjson envVars "$ENV_VARS_ESCAPED" \
74+
'$ARGS.named')
7375
7476
bunx caprover api \
7577
--path=/user/apps/appDefinitions/update \

0 commit comments

Comments
 (0)