From 685eea3c694b50b313c323e15dd7d39b3b60f328 Mon Sep 17 00:00:00 2001 From: aboyko Date: Tue, 10 Sep 2024 22:02:02 -0400 Subject: [PATCH] [GHA] Announce workflow adjusted for GChat --- .github/workflows/announce-release.yml | 77 +++++++++++------------- .github/workflows/test-gchat-message.yml | 35 +++++++++++ 2 files changed, 69 insertions(+), 43 deletions(-) diff --git a/.github/workflows/announce-release.yml b/.github/workflows/announce-release.yml index 5eaffa00d1..bc8ac18253 100644 --- a/.github/workflows/announce-release.yml +++ b/.github/workflows/announce-release.yml @@ -13,47 +13,38 @@ jobs: notify: runs-on: ubuntu-latest steps: - - id: tools-team-slack - uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 - env: - SLACK_BOT_TOKEN: ${{ secrets.VMWARE_SLACK_BOT_TOKEN }} - with: - channel-id: "C0188MENU2J" - payload: | - { - "text": "Released `${{ inputs.version }}`", - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "Published `${{ inputs.version }}` successfully" - } + - 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 STS ${{ inputs.version }} release\" + } + } + ] + } + ] } - ] - } - - name: Announce Release on Slack - id: spring-tools-announcing - uses: slackapi/slack-github-action@e28cf165c92ffef168d23c5c9000cffc8a25e117 - with: - payload: | - { - "text": "spring-tools-4-announcing `${{ inputs.version }}`", - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "spring-tools-4-announcing `${{ inputs.version }}`" - } - } - ] - } - env: - SLACK_WEBHOOK_URL: ${{ secrets.SPRING_RELEASE_SLACK_WEBHOOK_URL }} - SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK - - name: Announce Release in Chat - uses: julb/action-post-googlechat-message@v1 - with: - message: "${{ github.event.repository.name }}-announcing `${{ inputs.version }}`" - gchat_webhook_url: ${{ secrets.SPRING_RELEASE_CHAT_WEBHOOK_URL }} + } + ] + }" + - name: Announce Release on `Spring-Releases` space + run: | + curl --location --request POST '${{ secrets.SPRING_RELEASE_GCHAT_WEBHOOK_URL }}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ text: "spring-tools-4-announcing `${{ inputs.version }}`"}' diff --git a/.github/workflows/test-gchat-message.yml b/.github/workflows/test-gchat-message.yml index 7600c8aca7..ce0ba51078 100644 --- a/.github/workflows/test-gchat-message.yml +++ b/.github/workflows/test-gchat-message.yml @@ -70,3 +70,38 @@ jobs: } ] }' + - 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 STS ${{ inputs.version }} 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 }}`"}' \ No newline at end of file