Skip to content

Commit 685eea3

Browse files
committed
[GHA] Announce workflow adjusted for GChat
1 parent 0f7ebf9 commit 685eea3

File tree

2 files changed

+69
-43
lines changed

2 files changed

+69
-43
lines changed

.github/workflows/announce-release.yml

Lines changed: 34 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -13,47 +13,38 @@ jobs:
1313
notify:
1414
runs-on: ubuntu-latest
1515
steps:
16-
- id: tools-team-slack
17-
uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117
18-
env:
19-
SLACK_BOT_TOKEN: ${{ secrets.VMWARE_SLACK_BOT_TOKEN }}
20-
with:
21-
channel-id: "C0188MENU2J"
22-
payload: |
23-
{
24-
"text": "Released `${{ inputs.version }}`",
25-
"blocks": [
26-
{
27-
"type": "section",
28-
"text": {
29-
"type": "mrkdwn",
30-
"text": "Published `${{ inputs.version }}` successfully"
31-
}
16+
- name: Spring Tools Team GChat Notification
17+
run: |
18+
curl --location --request POST '${{ secrets.TOOLS_TEAM_GCHAT_WEBHOOK_URL }}' \
19+
--header 'Content-Type: application/json' \
20+
--data-raw "{
21+
"cardsV2": [
22+
{
23+
\"card\": {
24+
\"header\": {
25+
\"title\": \"Published STS ${{ inputs.version }}\",
26+
\"imageUrl\": \"https://avatars.githubusercontent.com/u/317776?s=48&v=4\",
27+
\"imageType\": \"CIRCLE\",
28+
\"imageAltText\": \"Avatar for STS\"
29+
},
30+
\"sections\": [
31+
{
32+
\"collapsible\": false,
33+
\"widgets\": [
34+
{
35+
\"textParagraph\": {
36+
\"text\": \"Successfully published <b>STS ${{ inputs.version }}</b> release\"
37+
}
38+
}
39+
]
40+
}
41+
]
3242
}
33-
]
34-
}
35-
- name: Announce Release on Slack
36-
id: spring-tools-announcing
37-
uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117
38-
with:
39-
payload: |
40-
{
41-
"text": "spring-tools-4-announcing `${{ inputs.version }}`",
42-
"blocks": [
43-
{
44-
"type": "section",
45-
"text": {
46-
"type": "mrkdwn",
47-
"text": "spring-tools-4-announcing `${{ inputs.version }}`"
48-
}
49-
}
50-
]
51-
}
52-
env:
53-
SLACK_WEBHOOK_URL: ${{ secrets.SPRING_RELEASE_SLACK_WEBHOOK_URL }}
54-
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
55-
- name: Announce Release in Chat
56-
uses: julb/action-post-googlechat-message@v1
57-
with:
58-
message: "${{ github.event.repository.name }}-announcing `${{ inputs.version }}`"
59-
gchat_webhook_url: ${{ secrets.SPRING_RELEASE_CHAT_WEBHOOK_URL }}
43+
}
44+
]
45+
}"
46+
- name: Announce Release on `Spring-Releases` space
47+
run: |
48+
curl --location --request POST '${{ secrets.SPRING_RELEASE_GCHAT_WEBHOOK_URL }}' \
49+
--header 'Content-Type: application/json' \
50+
--data-raw '{ text: "spring-tools-4-announcing `${{ inputs.version }}`"}'

.github/workflows/test-gchat-message.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,38 @@ jobs:
7070
}
7171
]
7272
}'
73+
- name: Spring Tools Team GChat Notification
74+
run: |
75+
curl --location --request POST '${{ secrets.TOOLS_TEAM_GCHAT_WEBHOOK_URL }}' \
76+
--header 'Content-Type: application/json' \
77+
--data-raw "{
78+
"cardsV2": [
79+
{
80+
\"card\": {
81+
\"header\": {
82+
\"title\": \"Published STS ${{ inputs.version }}\",
83+
\"imageUrl\": \"https://avatars.githubusercontent.com/u/317776?s=48&amp;v=4\",
84+
\"imageType\": \"CIRCLE\",
85+
\"imageAltText\": \"Avatar for STS\"
86+
},
87+
\"sections\": [
88+
{
89+
\"collapsible\": false,
90+
\"widgets\": [
91+
{
92+
\"textParagraph\": {
93+
\"text\": \"Successfully published <b>STS ${{ inputs.version }}</b> release\"
94+
}
95+
}
96+
]
97+
}
98+
]
99+
}
100+
}
101+
]
102+
}"
103+
- name: Announce Release on `Spring-Releases` space
104+
run: |
105+
curl --location --request POST '${{ secrets.TOOLS_TEAM_GCHAT_WEBHOOK_URL }}' \
106+
--header 'Content-Type: application/json' \
107+
--data-raw '{ text: "spring-tools-4-announcing `${{ inputs.version }}`"}'

0 commit comments

Comments
 (0)