Skip to content
This repository was archived by the owner on Feb 18, 2021. It is now read-only.

Commit 1147e6c

Browse files
committed
Escape password in case it contains special chars
1 parent 6986230 commit 1147e6c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

azure-pipelines.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ steps:
1313
inputs:
1414
targetType: 'inline'
1515
script: |
16-
sed -e "s/%USERNAME%/$USERNAME/" -e "s/%PASSWORD%/$PASSWORD/" check-udi.side > parsed.side
16+
echo "Username is $UDI_USERNAME"
17+
ESCAPED_PW=$(printf '%s\n' "$UDI_PASSWORD" | sed -e 's/[\/&]/\\&/g')
18+
sed -e "s/%UDI_USERNAME%/$UDI_USERNAME/" -e "s/%UDI_PASSWORD%/$ESCAPED_PW/" check-udi.side > parsed.side
1719
- task: Bash@3
1820
inputs:
1921
targetType: 'inline'

check-udi.side

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
["xpath=//div[@id='api']/div/div[4]/div/input", "xpath:idRelative"],
2727
["xpath=//input", "xpath:position"]
2828
],
29-
"value": "%USERNAME%"
29+
"value": "%UDI_USERNAME%"
3030
}, {
3131
"id": "ae667d98-b610-4cc8-84ab-b0c3d80a0a79",
3232
"comment": "",
@@ -40,7 +40,7 @@
4040
["xpath=//div[@id='api']/div/div[4]/div[2]/input", "xpath:idRelative"],
4141
["xpath=//div[2]/input", "xpath:position"]
4242
],
43-
"value": "%PASSWORD%"
43+
"value": "%UDI_PASSWORD%"
4444
}, {
4545
"id": "0fe27702-39db-4573-bc03-ba508a183ba3",
4646
"comment": "",

0 commit comments

Comments
 (0)