Skip to content

Commit 5bff653

Browse files
committed
fix: format issue
1 parent c2e4b64 commit 5bff653

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

.github/workflows/deploy-circleci.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,30 @@ jobs:
3434
store_secret() {
3535
local secret_name=$1
3636
local secret_value=$2
37+
local needs_quotes=$3
38+
3739
if [ -n "$secret_value" ]; then
3840
echo "Storing secret: $secret_name"
39-
echo "$secret_value" | circleci context store-secret --org-id "$ORG_ID" checkincontext "$secret_name"
41+
if [ "$needs_quotes" = "true" ]; then
42+
# Some secrets need to be wrapped in single quotes
43+
echo "'$secret_value'" | circleci context store-secret --org-id "$ORG_ID" checkincontext "$secret_name"
44+
else
45+
echo "$secret_value" | circleci context store-secret --org-id "$ORG_ID" checkincontext "$secret_name"
46+
fi
4047
else
4148
echo "Warning: $secret_name is empty, skipping"
4249
fi
4350
}
4451
4552
# List of secrets to migrate
46-
store_secret "TELEGRAM_TOKEN" "${{ secrets.TELEGRAM_TOKEN }}"
47-
store_secret "TELEGRAM_CHAT_ID" "${{ secrets.TELEGRAM_CHAT_ID }}"
48-
store_secret "NODESEEK_COOKIE" "${{ secrets.NODESEEK_COOKIE }}"
49-
store_secret "V2EX_COOKIE" "${{ secrets.V2EX_COOKIE }}"
50-
store_secret "ONEPOINT3ACRES_COOKIE" "${{ secrets.ONEPOINT3ACRES_COOKIE }}"
51-
store_secret "TWOCAPTCHA_APIKEY" "${{ secrets.TWOCAPTCHA_APIKEY }}"
53+
store_secret "TELEGRAM_TOKEN" "${{ secrets.TELEGRAM_TOKEN }}" "false"
54+
store_secret "TELEGRAM_CHAT_ID" "${{ secrets.TELEGRAM_CHAT_ID }}" "false"
55+
store_secret "NODESEEK_COOKIE" "${{ secrets.NODESEEK_COOKIE }}" "false"
56+
store_secret "V2EX_COOKIE" "${{ secrets.V2EX_COOKIE }}" "true"
57+
store_secret "ONEPOINT3ACRES_COOKIE" "${{ secrets.ONEPOINT3ACRES_COOKIE }}" "false"
58+
store_secret "TWOCAPTCHA_APIKEY" "${{ secrets.TWOCAPTCHA_APIKEY }}" "false"
59+
60+
- name: Verify Context
61+
run: |
62+
circleci context list --org-id ${{ secrets.CIRCLECI_ORG_ID }}
63+
echo "Context setup completed. Please verify the secrets in CircleCI web interface."

0 commit comments

Comments
 (0)