Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ example:
```
SLACK_URL=guardian.slack.com
SLACK_TOKEN=dHb34auD64
TEAM_NAME=frontend
```
4 changes: 3 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ function parseMessage(msg) {
function isValidMessageType(body) {
if("Message" in body && body.type === "Notification") {
var message = JSON.parse(body.Message);
return /^frontend::/g.test(message.project) &&
var teamName = process.env.TEAM_NAME;
var teamNameRegExp = new RegExp('^' + teamName + '::', 'g');
return teamNameRegExp.test(message.project) &&
(message.event === "DeployCompleted" || message.event === "DeployStarted");
}
return false;
Expand Down