Skip to content

Commit f4e1d03

Browse files
committed
Fix GChat card. Switch to V2 card
1 parent 54ae266 commit f4e1d03

File tree

2 files changed

+64
-33
lines changed

2 files changed

+64
-33
lines changed

.github/workflows/gh-hosted-eclipse-distro-build.yml

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -342,12 +342,6 @@ jobs:
342342
name: Send GChat message
343343
runs-on: ubuntu-latest
344344
steps:
345-
- name: Setup AWS CLI 2.22
346-
run: |
347-
curl -s "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.22.35.zip" -o "awscliv2.zip"
348-
unzip -q awscliv2.zip
349-
sudo ./aws/install --update
350-
aws --version
351345
- name: Google Chat Notification
352346
run: |
353347
echo "P2 Update Site: ${DOWNLOAD_URL_ROOT}/${{ needs.eclipse-distro-build.outputs.p2_path }}"
@@ -364,7 +358,7 @@ jobs:
364358
filename=${file:${#s3_url}+1}
365359
echo $download_url
366360
echo $filename
367-
echo "<li><a href=${download_url}>${filename}</a></li>" >> $downloads_html
361+
echo "<a href=${download_url}>${filename}</a>" >> $downloads_html
368362
fi
369363
done
370364
distro_links=`cat ./$downloads_html`
@@ -378,33 +372,35 @@ jobs:
378372
curl --location --request POST '${{ secrets.TOOLS_TEAM_GCHAT_WEBHOOK_URL }}' \
379373
--header 'Content-Type: application/json' \
380374
--data-raw "{
381-
\"cards\": [
375+
\"cardsV2\": [
382376
{
383-
\"header\": {
384-
\"title\": \"STS ${{ needs.eclipse-distro-build.outputs.version }} ${build_type}\",
385-
\"subtitle\": \"Eclipse ${eclipse_version}\",
386-
\"imageUrl\": \"https://avatars.githubusercontent.com/u/317776?s=48&amp;v=4\",
387-
},
388-
\"sections\": [
389-
{
390-
\"widgets\": [
391-
{
392-
\"keyValue\": {
393-
\"topLabel\": \"P2 Update Site\",
394-
\"content\": \"<a href=${DOWNLOAD_URL_ROOT}/${{ needs.eclipse-distro-build.outputs.p2_path }}>${DOWNLOAD_URL_ROOT}/${{ needs.eclipse-distro-build.outputs.p2_path }}</a>\",
395-
\"contentMultiline\": true
396-
}
397-
},
398-
{
399-
\"keyValue\": {
400-
\"topLabel\": \"Distributions\",
401-
\"content\": \"${distro_links}\",
402-
\"contentMultiline\": true
377+
\"card\": {
378+
\"header\": {
379+
\"title\": \"STS ${{ needs.eclipse-distro-build.outputs.version }} ${build_type}\",
380+
\"subtitle\": \"Eclipse ${eclipse_version}\",
381+
\"imageUrl\": \"https://avatars.githubusercontent.com/u/317776?s=48&amp;v=4\",
382+
},
383+
\"sections\": [
384+
{
385+
\"widgets\": [
386+
{
387+
\"decoratedText\": {
388+
\"topLabel\": \"P2 Update Site\",
389+
\"text\": \"<a href=${DOWNLOAD_URL_ROOT}/${{ needs.eclipse-distro-build.outputs.p2_path }}>${DOWNLOAD_URL_ROOT}/${{ needs.eclipse-distro-build.outputs.p2_path }}</a>\",
390+
\"wrapText\": true
391+
}
392+
},
393+
{
394+
\"decoratedText\": {
395+
\"topLabel\": \"Distributions\",
396+
\"text\": \"${distro_links}\",
397+
\"wrapText\": true
398+
}
403399
}
404-
}
405-
]
406-
}
407-
]
400+
]
401+
}
402+
]
403+
}
408404
}
409405
]
410406
}"

.github/workflows/test-eclipse-distro-gchat-notification.yml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
filename=${file:${#s3_url}+1}
5959
echo $download_url
6060
echo $filename
61-
echo "<li><a href=${download_url}>${filename}</a></li>" >> $downloads_html
61+
echo "<a href=${download_url}>${filename}</a>" >> $downloads_html
6262
fi
6363
done
6464
distro_links=`cat ./$downloads_html`
@@ -100,4 +100,39 @@ jobs:
100100
]
101101
}
102102
]
103+
}"
104+
105+
curl --location --request POST '${{ secrets.TOOLS_TEAM_GCHAT_WEBHOOK_URL }}' \
106+
--header 'Content-Type: application/json' \
107+
--data-raw "{
108+
\"cardsV2\": [
109+
{
110+
\"card\": {
111+
\"header\": {
112+
\"title\": \"STS ${{ inputs.version }} ${build_type}\",
113+
\"subtitle\": \"Eclipse ${eclipse_version}\",
114+
\"imageUrl\": \"https://avatars.githubusercontent.com/u/317776?s=48&amp;v=4\",
115+
},
116+
\"sections\": [
117+
{
118+
\"widgets\": [
119+
{
120+
\"decoratedText\": {
121+
\"topLabel\": \"P2 Update Site\",
122+
\"text\": \"<a href=${DOWNLOAD_URL_ROOT}/${{ inputs.p2_path }}>${DOWNLOAD_URL_ROOT}/${{ inputs.p2_path }}</a>\"
123+
}
124+
},
125+
{
126+
\"decoratedText\": {
127+
\"topLabel\": \"Distributions\",
128+
\"text\": \"${distro_links}\",
129+
\"wrapText\": true
130+
}
131+
}
132+
]
133+
}
134+
]
135+
}
136+
}
137+
]
103138
}"

0 commit comments

Comments
 (0)