/* eslint-disable no-console */ const { IncomingWebhook } = require('@slack/webhook') // Read a url from the environment variables const url = process.env.SLACK_WEBHOOK_URL // Initialize const webhook = new IncomingWebhook(url) console.log('Messaging Slack channel #deployment about production deployment.'); (async () => { await webhook.send( { blocks: [ { type: 'section', text: { type: 'mrkdwn', text: ':rocket: *PRODUCTION DEPLOYMENT COMPLETE* :rocket:', }, }, { type: 'divider', }, { type: 'section', text: { type: 'mrkdwn', text: `:exclamation: *${process.env.CI_PROJECT_TITLE}*\n:morty: *${process.env.CI_COMMIT_AUTHOR}*\n:branch: *${process.env.CI_COMMIT_BRANCH}*`, }, accessory: { type: 'button', text: { type: 'plain_text', text: 'View Deployment', emoji: true, }, url: process.env.CI_PIPELINE_URL, }, }, { type: 'divider', }, ], }, ) })()