Skip to content

Commit a2abf6f

Browse files
authored
URL encode password
1 parent 6b251c6 commit a2abf6f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ runs:
4848
shell: bash
4949
- name: Log in to spacedock
5050
run: |
51-
login_response=$(curl -F username=${{ inputs.username }} -F password=${{ inputs.password }} -c ./cookies "https://${{ inputs.spacedock_website }}/api/login")
51+
encoded_password=$(printf '%s' "${{ inputs.password }}" | jq -sRr @uri)
52+
echo "::add-mask::$encoded_password"
53+
login_response=$(curl -F "username=${{ inputs.username }}" -F "password=$encoded_password" -c ./cookies "https://${{ inputs.spacedock_website }}/api/login")
5254
login_errored=$(echo $login_response | jq .error)
5355
if [ "$login_errored" == "true" ]; then
5456
echo "Login to space dock errored: $(echo $login_response | jq .reason)"
@@ -57,6 +59,7 @@ runs:
5759
echo "Login to space dock successful"
5860
fi
5961
shell: bash
62+
6063
- name: Query latest game version
6164
run: |
6265
echo "LATEST_GAME_VERSION=$(curl 'https://${{ inputs.spacedock_website }}/api/${{ inputs.game_id }}/versions' | jq '.[0].friendly_version' | tr -d \")" >> $GITHUB_ENV

0 commit comments

Comments
 (0)