Skip to content

Commit

Permalink
adding functionality to filter notifications by full git ref
Browse files Browse the repository at this point in the history
  • Loading branch information
crackalak committed Jan 22, 2015
1 parent f924133 commit 1c31c46
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Arnie/Arnie.svc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ string IRestService.DoItNow(GitHubPushWebhook pushInfo)

try
{
repositories = config.repos.Where(repo => (string)pushInfo.repository[repo.repo_key] == repo.repo_value).ToList();
// get list of repos by matching key
// and ref if present
repositories = config.repos.Where(repo => (string)pushInfo.repository[repo.repo_key] == repo.repo_value
&& string.IsNullOrEmpty(repo.ref_) ? true : pushInfo.ref_ == repo.ref_).ToList();
}
catch (Exception exc)
{
Expand Down
3 changes: 3 additions & 0 deletions Arnie/Repos.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ public class RepositoryConfig

[DataMember(Name = "repo_value")]
public string repo_value { get; set; }

[DataMember(Name = "ref")]
public string ref_ { get; set; }
}

[DataContract]
Expand Down

0 comments on commit 1c31c46

Please sign in to comment.