From a0839b9b931582699b858576359f90b392e2a667 Mon Sep 17 00:00:00 2001 From: Ian Knighton Date: Thu, 10 Oct 2024 09:59:40 -0600 Subject: [PATCH] feat: add release notifier --- .github/workflows/release-tagging.yml | 52 ++++++++++++++++++++++++++- output.tf | 6 ++-- 2 files changed, 55 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-tagging.yml b/.github/workflows/release-tagging.yml index b1f84bc..a7d58db 100644 --- a/.github/workflows/release-tagging.yml +++ b/.github/workflows/release-tagging.yml @@ -34,4 +34,54 @@ jobs: with: tag: ${{ needs.release-tag.outputs.RELEASE_TAG }} name: Release ${{ needs.release-tag.outputs.RELEASE_TAG }} - body: ${{ needs.release-tag.outputs.RELEASE_TAG }} \ No newline at end of file + body: ${{ needs.release-tag.outputs.RELEASE_TAG }} + + release-notifier: + runs-on: ubuntu-latest + needs: ['release-tag', 'create-release'] + name: 'Release Notifier' + steps: + - name: Send Notification + uses: slackapi/slack-github-action@v1.27.0 + env: + SLACK_BOT_TOKEN: ${{ secrets.RELEASE_SLACKBOT_TOKEN }} + with: + channel-id: release + payload: | + { + "blocks": [ + { + "type": "header", + "text": { + "type": "plain_text", + "text": ":terraform: ${{github.event.repository.name}} release", + "emoji": true + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "*${{github.event.repository.name}}* release." + }, + "accessory": { + "type": "button", + "text": { + "type": "plain_text", + "text": "${{needs.release-tag.outputs.RELEASE_TAG}}", + "emoji": true + }, + "url": "https://github.com/deseretdigital/${{github.event.repository.name}}/releases/tag/${{needs.release-tag.outputs.RELEASE_TAG}}" + } + }, + { + "type": "context", + "elements": [ + { + "type": "mrkdwn", + "text": "_This is an automated message. It does not indicate the deploy was successful, and it will not post here if it has failed. Please check the action run for more details._" + } + ] + } + ] + } \ No newline at end of file diff --git a/output.tf b/output.tf index 96f27b0..ddcff0d 100644 --- a/output.tf +++ b/output.tf @@ -1,7 +1,9 @@ output "subscription_id" { - value = google_pubsub_subscription.subscription.id + value = google_pubsub_subscription.subscription.id + description = "The ID of the created subscription." } output "subscription_name" { - value = google_pubsub_subscription.subscription.name + value = google_pubsub_subscription.subscription.name + description = "The name of the created subscription." } \ No newline at end of file