107 lines
4.3 KiB
YAML
107 lines
4.3 KiB
YAML
name: Test GChat Message
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: version
|
|
required: true
|
|
type: string
|
|
|
|
jobs:
|
|
slack-message:
|
|
name: Send GChat message
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Google Chat Notification
|
|
run: |
|
|
curl --location --request POST '${{ secrets.TOOLS_TEAM_GCHAT_WEBHOOK_URL }}' \
|
|
--header 'Content-Type: application/json' \
|
|
--data-raw '{
|
|
"cards": [
|
|
{
|
|
"header": {
|
|
"title": "Test Release Message",
|
|
"subtitle": "Version: #${{ inputs.version }}"
|
|
},
|
|
"sections": [
|
|
{
|
|
"widgets": [
|
|
{
|
|
"keyValue": {
|
|
"topLabel": "Creator",
|
|
"content": "Alex Boyko"
|
|
},
|
|
},
|
|
{
|
|
"keyValue": {
|
|
"topLabel": "Title",
|
|
"content": "All the best and cool features"
|
|
}
|
|
},
|
|
{
|
|
"buttons": [
|
|
{
|
|
"textButton": {
|
|
"text": "Button 1",
|
|
"onClick": {
|
|
"openLink": {
|
|
"url": "https://github.com/spring-projects/sts4"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"textButton": {
|
|
"text": "Button 2",
|
|
"onClick": {
|
|
"openLink": {
|
|
"url": "https://github.com/spring-projects/sts4"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}'
|
|
- name: Spring Tools Team GChat Notification
|
|
run: |
|
|
curl --location --request POST '${{ secrets.TOOLS_TEAM_GCHAT_WEBHOOK_URL }}' \
|
|
--header 'Content-Type: application/json' \
|
|
--data-raw "{
|
|
"cardsV2": [
|
|
{
|
|
\"card\": {
|
|
\"header\": {
|
|
\"title\": \"Published STS ${{ inputs.version }}\",
|
|
\"imageUrl\": \"https://avatars.githubusercontent.com/u/317776?s=48&v=4\",
|
|
\"imageType\": \"CIRCLE\",
|
|
\"imageAltText\": \"Avatar for STS\"
|
|
},
|
|
\"sections\": [
|
|
{
|
|
\"collapsible\": false,
|
|
\"widgets\": [
|
|
{
|
|
\"textParagraph\": {
|
|
\"text\": \"Successfully published <b>STS ${{ inputs.version }}</b> release\"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}"
|
|
- name: Announce Release on `Spring-Releases` space
|
|
run: |
|
|
curl --location --request POST '${{ secrets.TOOLS_TEAM_GCHAT_WEBHOOK_URL }}' \
|
|
--header 'Content-Type: application/json' \
|
|
--data-raw '{ text: "spring-tools-4-announcing `${{ inputs.version }}`"}' |