Skip to content

Commit

Permalink
Fix GChat card. Switch to V2 card
Browse files Browse the repository at this point in the history
  • Loading branch information
BoykoAlex committed Mar 10, 2025
1 parent 54ae266 commit f4e1d03
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 33 deletions.
60 changes: 28 additions & 32 deletions .github/workflows/gh-hosted-eclipse-distro-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -342,12 +342,6 @@ jobs:
name: Send GChat message
runs-on: ubuntu-latest
steps:
- name: Setup AWS CLI 2.22
run: |
curl -s "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.22.35.zip" -o "awscliv2.zip"
unzip -q awscliv2.zip
sudo ./aws/install --update
aws --version
- name: Google Chat Notification
run: |
echo "P2 Update Site: ${DOWNLOAD_URL_ROOT}/${{ needs.eclipse-distro-build.outputs.p2_path }}"
Expand All @@ -364,7 +358,7 @@ jobs:
filename=${file:${#s3_url}+1}
echo $download_url
echo $filename
echo "<li><a href=${download_url}>${filename}</a></li>" >> $downloads_html
echo "<a href=${download_url}>${filename}</a>" >> $downloads_html
fi
done
distro_links=`cat ./$downloads_html`
Expand All @@ -378,33 +372,35 @@ jobs:
curl --location --request POST '${{ secrets.TOOLS_TEAM_GCHAT_WEBHOOK_URL }}' \
--header 'Content-Type: application/json' \
--data-raw "{
\"cards\": [
\"cardsV2\": [
{
\"header\": {
\"title\": \"STS ${{ needs.eclipse-distro-build.outputs.version }} ${build_type}\",
\"subtitle\": \"Eclipse ${eclipse_version}\",
\"imageUrl\": \"https://avatars.githubusercontent.com/u/317776?s=48&amp;v=4\",
},
\"sections\": [
{
\"widgets\": [
{
\"keyValue\": {
\"topLabel\": \"P2 Update Site\",
\"content\": \"<a href=${DOWNLOAD_URL_ROOT}/${{ needs.eclipse-distro-build.outputs.p2_path }}>${DOWNLOAD_URL_ROOT}/${{ needs.eclipse-distro-build.outputs.p2_path }}</a>\",
\"contentMultiline\": true
}
},
{
\"keyValue\": {
\"topLabel\": \"Distributions\",
\"content\": \"${distro_links}\",
\"contentMultiline\": true
\"card\": {
\"header\": {
\"title\": \"STS ${{ needs.eclipse-distro-build.outputs.version }} ${build_type}\",
\"subtitle\": \"Eclipse ${eclipse_version}\",
\"imageUrl\": \"https://avatars.githubusercontent.com/u/317776?s=48&amp;v=4\",
},
\"sections\": [
{
\"widgets\": [
{
\"decoratedText\": {
\"topLabel\": \"P2 Update Site\",
\"text\": \"<a href=${DOWNLOAD_URL_ROOT}/${{ needs.eclipse-distro-build.outputs.p2_path }}>${DOWNLOAD_URL_ROOT}/${{ needs.eclipse-distro-build.outputs.p2_path }}</a>\",
\"wrapText\": true
}
},
{
\"decoratedText\": {
\"topLabel\": \"Distributions\",
\"text\": \"${distro_links}\",
\"wrapText\": true
}
}
}
]
}
]
]
}
]
}
}
]
}"
Expand Down
37 changes: 36 additions & 1 deletion .github/workflows/test-eclipse-distro-gchat-notification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
filename=${file:${#s3_url}+1}
echo $download_url
echo $filename
echo "<li><a href=${download_url}>${filename}</a></li>" >> $downloads_html
echo "<a href=${download_url}>${filename}</a>" >> $downloads_html
fi
done
distro_links=`cat ./$downloads_html`
Expand Down Expand Up @@ -100,4 +100,39 @@ jobs:
]
}
]
}"
curl --location --request POST '${{ secrets.TOOLS_TEAM_GCHAT_WEBHOOK_URL }}' \
--header 'Content-Type: application/json' \
--data-raw "{
\"cardsV2\": [
{
\"card\": {
\"header\": {
\"title\": \"STS ${{ inputs.version }} ${build_type}\",
\"subtitle\": \"Eclipse ${eclipse_version}\",
\"imageUrl\": \"https://avatars.githubusercontent.com/u/317776?s=48&amp;v=4\",
},
\"sections\": [
{
\"widgets\": [
{
\"decoratedText\": {
\"topLabel\": \"P2 Update Site\",
\"text\": \"<a href=${DOWNLOAD_URL_ROOT}/${{ inputs.p2_path }}>${DOWNLOAD_URL_ROOT}/${{ inputs.p2_path }}</a>\"
}
},
{
\"decoratedText\": {
\"topLabel\": \"Distributions\",
\"text\": \"${distro_links}\",
\"wrapText\": true
}
}
]
}
]
}
}
]
}"

0 comments on commit f4e1d03

Please sign in to comment.