|
| 1 | +# Slack Release Notifications Setup |
| 2 | + |
| 3 | +This guide shows how to securely set up Slack notifications for CLI releases without exposing webhook URLs. |
| 4 | + |
| 5 | +## 🔒 **Security First** |
| 6 | + |
| 7 | +- ✅ Webhook URLs stored in GitHub Secrets (never in code) |
| 8 | +- ✅ Private repository settings |
| 9 | +- ✅ Environment variables for sensitive data |
| 10 | + |
| 11 | +## 📋 **Setup Steps** |
| 12 | + |
| 13 | +### 1. Create Slack Webhook |
| 14 | + |
| 15 | +1. **Go to your Slack workspace** |
| 16 | +2. **Navigate to:** https://api.slack.com/apps |
| 17 | +3. **Create a new app** → "From scratch" |
| 18 | +4. **App Name:** `Vapi Release Bot` |
| 19 | +5. **Choose workspace:** Your internal Vapi workspace |
| 20 | + |
| 21 | +### 2. Configure Incoming Webhooks |
| 22 | + |
| 23 | +1. **In your app settings** → "Incoming Webhooks" |
| 24 | +2. **Toggle "Activate Incoming Webhooks"** → ON |
| 25 | +3. **Click "Add New Webhook to Workspace"** |
| 26 | +4. **Choose channel:** `#releases` (or create it) |
| 27 | +5. **Copy the webhook URL** (looks like: `https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX`) |
| 28 | + |
| 29 | +### 3. Add Webhook to GitHub Secrets |
| 30 | + |
| 31 | +**🚨 CRITICAL: Keep webhook URL secret!** |
| 32 | + |
| 33 | +1. **Go to:** https://github.com/VapiAI/cli/settings/secrets/actions |
| 34 | +2. **Click "New repository secret"** |
| 35 | +3. **Name:** `SLACK_WEBHOOK` |
| 36 | +4. **Value:** [paste your webhook URL] |
| 37 | +5. **Click "Add secret"** |
| 38 | + |
| 39 | +### 4. Customize Notification Settings |
| 40 | + |
| 41 | +Edit `.goreleaser.yaml` to customize: |
| 42 | + |
| 43 | +```yaml |
| 44 | +announce: |
| 45 | + slack: |
| 46 | + enabled: true |
| 47 | + channel: "#releases" # Change to your preferred channel |
| 48 | + username: "Vapi Release Bot" # Change bot name |
| 49 | + icon_emoji: ":rocket:" # Change emoji |
| 50 | + message_template: | # Customize message format |
| 51 | + 🚀 **Vapi CLI {{.Tag}} Released!** |
| 52 | +
|
| 53 | + 📦 **Installation:** |
| 54 | + • Universal: `curl -sSL https://vapi.ai/install.sh | bash` |
| 55 | + • npm: `npm install -g @vapi-ai/cli` |
| 56 | +
|
| 57 | + 🔗 **Release:** {{ .ReleaseURL }} |
| 58 | +``` |
| 59 | +
|
| 60 | +## 📱 **Notification Preview** |
| 61 | +
|
| 62 | +When a release is published, your team will see: |
| 63 | +
|
| 64 | +``` |
| 65 | +🚀 Vapi CLI v0.0.5 Released! |
| 66 | + |
| 67 | +📦 Distribution: |
| 68 | +• Universal: curl -sSL https://vapi.ai/install.sh | bash |
| 69 | +• npm: npm install -g @vapi-ai/cli |
| 70 | +• Homebrew: brew tap vapi/tap && brew install vapi-cli |
| 71 | +• Docker: docker run -it ghcr.io/vapiai/cli:v0.0.5 --help |
| 72 | + |
| 73 | +🔗 Links: |
| 74 | +• Release: https://github.com/VapiAI/cli/releases/tag/v0.0.5 |
| 75 | +• Changelog: https://github.com/VapiAI/cli/releases/tag/v0.0.5#changelog |
| 76 | + |
| 77 | +Built with ❤️ by the Vapi team |
| 78 | +``` |
| 79 | + |
| 80 | +## 🧪 **Testing** |
| 81 | + |
| 82 | +### Test the Slack App |
| 83 | + |
| 84 | +1. **In Slack app settings** → "Incoming Webhooks" |
| 85 | +2. **Scroll down to "Sample curl request"** |
| 86 | +3. **Run the curl command** to test posting |
| 87 | + |
| 88 | +### Test with GoReleaser |
| 89 | + |
| 90 | +```bash |
| 91 | +# Test locally (without publishing) |
| 92 | +goreleaser release --snapshot --clean --skip-publish |
| 93 | +``` |
| 94 | + |
| 95 | +## 🔧 **Advanced Configuration** |
| 96 | + |
| 97 | +### Multiple Channels |
| 98 | + |
| 99 | +```yaml |
| 100 | +announce: |
| 101 | + slack: |
| 102 | + enabled: true |
| 103 | + channel: "#releases,#engineering" # Multiple channels |
| 104 | +``` |
| 105 | +
|
| 106 | +### Conditional Notifications |
| 107 | +
|
| 108 | +```yaml |
| 109 | +announce: |
| 110 | + slack: |
| 111 | + enabled: true |
| 112 | + message_template: | |
| 113 | + {{if not .Prerelease}} |
| 114 | + 🚀 **Vapi CLI {{.Tag}} Released!** |
| 115 | + {{else}} |
| 116 | + 🧪 **Vapi CLI {{.Tag}} Pre-release** |
| 117 | + {{end}} |
| 118 | +``` |
| 119 | +
|
| 120 | +### Rich Formatting |
| 121 | +
|
| 122 | +````yaml |
| 123 | +announce: |
| 124 | + slack: |
| 125 | + enabled: true |
| 126 | + message_template: | |
| 127 | + 🚀 *Vapi CLI {{.Tag}} Released!* |
| 128 | +
|
| 129 | + *📦 Quick Install:* |
| 130 | + ``` |
| 131 | + curl -sSL https://vapi.ai/install.sh | bash |
| 132 | + ``` |
| 133 | + |
| 134 | + <{{ .ReleaseURL }}|View Release Notes> |
| 135 | +```` |
| 136 | + |
| 137 | +## 🔐 **Security Best Practices** |
| 138 | + |
| 139 | +### ✅ **Do This:** |
| 140 | + |
| 141 | +- Store webhook URL in GitHub Secrets |
| 142 | +- Use repository secrets (not environment secrets) |
| 143 | +- Limit webhook permissions to specific channels |
| 144 | +- Rotate webhook URLs periodically |
| 145 | + |
| 146 | +### ❌ **Don't Do This:** |
| 147 | + |
| 148 | +- Put webhook URLs in code |
| 149 | +- Share webhook URLs in public channels |
| 150 | +- Use personal Slack apps for team notifications |
| 151 | +- Commit secrets or tokens |
| 152 | + |
| 153 | +## 🛠️ **Troubleshooting** |
| 154 | + |
| 155 | +### **Notifications Not Appearing** |
| 156 | + |
| 157 | +1. **Check GitHub Actions logs** for Slack errors |
| 158 | +2. **Verify secret name** matches exactly: `SLACK_WEBHOOK` |
| 159 | +3. **Test webhook manually** with curl |
| 160 | +4. **Check Slack app permissions** |
| 161 | + |
| 162 | +### **Wrong Channel** |
| 163 | + |
| 164 | +1. **Update `channel` setting** in `.goreleaser.yaml` |
| 165 | +2. **Ensure bot has access** to target channel |
| 166 | +3. **Public channels:** Use `#channel-name` |
| 167 | +4. **Private channels:** Invite bot first |
| 168 | + |
| 169 | +### **Formatting Issues** |
| 170 | + |
| 171 | +1. **Use Slack markdown** format |
| 172 | +2. **Test templates** with GoReleaser snapshots |
| 173 | +3. **Check GoReleaser docs** for available variables |
| 174 | + |
| 175 | +## 📊 **Monitoring** |
| 176 | + |
| 177 | +Track notification delivery: |
| 178 | + |
| 179 | +- GitHub Actions logs |
| 180 | +- Slack app dashboard |
| 181 | +- Team feedback |
| 182 | + |
| 183 | +## 🔄 **Maintenance** |
| 184 | + |
| 185 | +- **Monthly:** Review webhook usage in Slack app dashboard |
| 186 | +- **Quarterly:** Rotate webhook URLs for security |
| 187 | +- **Yearly:** Review and update notification content |
| 188 | + |
| 189 | +--- |
| 190 | + |
| 191 | +**Need help?** Check the [GoReleaser Slack documentation](https://goreleaser.com/customization/announce/slack/) or ask in #engineering. |
0 commit comments