Skip to content

Commit 10e1235

Browse files
committed
Fix deployment workflow by escaping everything for awk
1 parent c5d42dd commit 10e1235

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
- name: Test
2727
run: npm run test
28-
28+
2929
- name: Set up publishing
3030
run: npm install vsce --save-dev
3131

@@ -54,6 +54,11 @@ jobs:
5454
changelog1="${changelog1//$'\r'/'%0D'}"
5555
changelog2="${changelog//$'\n'/'\\n'}"
5656
changelog2="${changelog2//$'\r'/'\\r'}"
57+
changelog2="${changelog2//$'('/'\('}"
58+
changelog2="${changelog2//$')'/'\)'}"
59+
changelog2="${changelog2//$'`'/'\`'}"
60+
changelog2="${changelog2//$'"'/'\"'}"
61+
changelog2="${changelog2//"'"/"'\''"}"
5762
echo "::set-output name=escaped::$changelog"
5863
echo "::set-output name=unescaped::$changelog1"
5964
echo "::set-output name=doubleescaped::$changelog2"
@@ -69,10 +74,10 @@ jobs:
6974
id: discord-msg
7075
run: |
7176
awk '{
72-
gsub("#VERSION#","${{fromJson(steps.package-json.outputs.packageJson).version}}",$0)
73-
gsub("#DESCRIPTION#","${{steps.changelog.outputs.doubleescaped}}",$0)
74-
gsub("#URL#","${{steps.release.outputs.url}}",$0)
75-
print $0
77+
gsub("#VERSION#","${{fromJson(steps.package-json.outputs.packageJson).version}}",$0);
78+
gsub("#DESCRIPTION#","${{steps.changelog.outputs.doubleescaped}}",$0);
79+
gsub("#URL#","${{steps.release.outputs.url}}",$0);
80+
print $0;
7681
}' ./.github/workflows/deploy_discord_message.json > ./.github/workflows/deploy_discord_message2.json
7782
7883
- name: Send Discord Message

0 commit comments

Comments
 (0)