Skip to content

Commit

Permalink
[Codeship] fix status checking regexp & add new statuses (#1662)
Browse files Browse the repository at this point in the history
* [Codeship] fix status checking regexp

we don't need to match the file extension to determine the status

* [Codeship] handle new build statuses

based on https://documentation.codeship.com/general/account/notifications/#webhook
  • Loading branch information
zosiu authored and RedSparr0w committed Apr 26, 2018
1 parent a24d42a commit 14bdaf3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -4934,7 +4934,7 @@ cache(function(data, match, sendBadge, request) {
}
try {
var statusMatch = res.headers['content-disposition']
.match(/filename="status_(.+)\.png"/);
.match(/filename="status_(.+)\./);
if (!statusMatch) {
badgeData.text[1] = 'unknown';
sendBadge(format, badgeData);
Expand All @@ -4954,13 +4954,17 @@ cache(function(data, match, sendBadge, request) {
break;
case 'testing':
case 'waiting':
case 'initiated':
badgeData.text[1] = 'pending';
break;
case 'error':
case 'infrastructure_failure':
badgeData.text[1] = 'failing';
badgeData.colorscheme = 'red';
break;
case 'stopped':
case 'ignored':
case 'blocked':
badgeData.text[1] = 'not built';
break;
}
Expand Down

0 comments on commit 14bdaf3

Please sign in to comment.