You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This workflow (`pages-build-notification.yml`) automatically sends a Slack notification whenever GitHub Pages finishes building your site after a new release note is added.
6
+
7
+
### Features
8
+
9
+
- 🚀 Triggers automatically when GitHub Pages build completes
10
+
- 📱 Sends rich Slack notifications with all relevant links
11
+
- 🔗 Includes links to:
12
+
- The specific new release note
13
+
- The complete release notes index page
14
+
- GitHub changelog/releases page
15
+
- The repository
16
+
- 🛡️ Robust error handling and fallback notification methods
17
+
- 🐛 Debug information for troubleshooting
18
+
19
+
### Setup Instructions
20
+
21
+
#### 1. Create a Slack Webhook
22
+
23
+
1. Go to your Slack workspace
24
+
2. Navigate to **Apps** → **Incoming Webhooks**
25
+
3. Click **Add to Slack**
26
+
4. Choose the channel where you want notifications
27
+
5. Copy the webhook URL
28
+
29
+
#### 2. Add Slack Webhook to GitHub Secrets
30
+
31
+
1. Go to your GitHub repository
32
+
2. Navigate to **Settings** → **Secrets and variables** → **Actions**
33
+
3. Click **New repository secret**
34
+
4. Name: `SLACK_WEBHOOK_URL`
35
+
5. Value: Your Slack webhook URL
36
+
6. Click **Add secret**
37
+
38
+
#### 3. Enable GitHub Pages (if not already enabled)
39
+
40
+
1. Go to **Settings** → **Pages**
41
+
2. Select your source (usually `main` branch)
42
+
3. Save the configuration
43
+
44
+
### How It Works
45
+
46
+
1.**Trigger**: The workflow triggers on the `page_build` event, which fires when GitHub Pages finishes building
47
+
2.**Data Extraction**: It reads your `release-notes/manifest.json` to find the latest release note
48
+
3.**URL Generation**: It constructs URLs for:
49
+
- Your GitHub Pages site index
50
+
- The specific release note
51
+
- GitHub releases page
52
+
4.**Notification**: Sends a formatted Slack message with all the information
53
+
54
+
### Notification Format
55
+
56
+
The Slack notification includes:
57
+
58
+
```
59
+
🚀 GitHub Pages Build Complete
60
+
Release Notes Published - Version [VERSION]
61
+
62
+
📋 All Release Notes: [Link to index.html]
63
+
📝 GitHub Changelog: [Link to GitHub releases]
64
+
🆕 Latest Release Note: [Link to specific release note]
65
+
🏗️ Repository: [Link to repository]
66
+
Build Time: [Timestamp]
67
+
```
68
+
69
+
### Troubleshooting
70
+
71
+
If the workflow fails:
72
+
73
+
1. Check the **Actions** tab in your GitHub repository
74
+
2. Look at the workflow run logs for error messages
75
+
3. The workflow includes debug information that will show:
76
+
- Repository information
77
+
- Directory contents
78
+
- Manifest file contents
79
+
80
+
### Customization
81
+
82
+
You can customize the workflow by:
83
+
84
+
-**Changing the Slack message format**: Edit the `custom_payload` section
85
+
-**Adding more information**: Extract additional data from your release notes
86
+
-**Changing notification conditions**: Modify the trigger conditions
87
+
-**Adding other notification channels**: Add steps for email, Discord, etc.
88
+
89
+
### File Structure Expected
90
+
91
+
The workflow expects this structure:
92
+
```
93
+
/
94
+
├── index.html (GitHub Pages index)
95
+
├── release-notes/
96
+
│ ├── manifest.json
97
+
│ ├── release-notes-v1.0.0.html
98
+
│ └── release-notes-v1.1.0.html
99
+
└── .github/
100
+
└── workflows/
101
+
└── pages-build-notification.yml
102
+
```
103
+
104
+
### Manifest.json Format
105
+
106
+
Your `manifest.json` should look like:
107
+
```json
108
+
{
109
+
"files": [
110
+
"release-notes-v1.0.0.html",
111
+
"release-notes-v1.1.0.html"
112
+
],
113
+
"lastUpdated": "2025-01-01T12:00:00.000Z",
114
+
"description": "Manifest file for release notes",
115
+
"count": 2
116
+
}
117
+
```
118
+
119
+
The workflow will use the last file in the `files` array as the latest release.
0 commit comments