integrity/integrity — Issue #151: Deleted Branches Triggers Build
Author: grahamc
Created: 2012-01-05 01:46:16+00:00
State: open

Here's what happens when I delete a branch on the remote, GitHub pushes:

```json
{
"after":"0000000000000000000000000000000000000000",
"before":"fed343a1adff08d0fc0ed27a2c9275f98da380b9",
"commits":[

],
"compare":"https://github.com/integrity/integrity/compare/fed343a...0000000",
"created":false,
"deleted":true,
"forced":true,
"pusher":{
"email":"graham@grahamc.com",
"name":"grahamc"
},
"ref":"refs/heads/icons",
"repository":{
"created_at":"2009/04/07 03:08:23 -0700",
"description":"Continuous Integration server",
"fork":true,
"forks":123,
"has_downloads":true,
"has_issues":true,
"has_wiki":true,
"homepage":"http://integrityapp.com",
"integrate_branch":"master",
"language":"Ruby",
"name":"integrity",
"open_issues":18,
"organization":"integrity",
"owner":{
"email":"info@integrityapp.com",
"name":"integrity"
},
"private":false,
"pushed_at":"2012/01/04 17:24:19 -0800",
"size":196,
"url":"https://github.com/integrity/integrity",
"watchers":489
}
}
```

My thought is to detect that the after is 00000 and that the `deleted` flag is true, and if so - prune the project. What do you think? Where do you suppose that code should go? `Payload.build` doesn't feel quite right. I also understand some people might want to disable this feature, so maybe a new config option?