From 11e02fa98cd5abff6b74da0029c6e77884a11e73 Mon Sep 17 00:00:00 2001 From: Shuhei Kitagawa Date: Thu, 1 Nov 2018 09:29:37 +0900 Subject: [PATCH] Add BranchName option to BuildsByRepositoryOption --- builds.go | 2 ++ builds_integration_test.go | 1 + 2 files changed, 3 insertions(+) diff --git a/builds.go b/builds.go index 3eba890..e6231e9 100644 --- a/builds.go +++ b/builds.go @@ -103,6 +103,8 @@ type BuildsOption struct { // BuildsByRepositoryOption specifies the optional parameters for builds endpoint type BuildsByRepositoryOption struct { + // Filters builds by name of the git branch + BranchName string `url:"branch.name,omitempty"` // The User or Organization that created the build CreatedBy []string `url:"created_by,omitempty,brackets"` // Event that triggered the build diff --git a/builds_integration_test.go b/builds_integration_test.go index 7fc1096..f961c7b 100644 --- a/builds_integration_test.go +++ b/builds_integration_test.go @@ -65,6 +65,7 @@ func TestBuildsService_Integration_ListByRepoId(t *testing.T) { {PreviousState: []string{BuildStatePassed}}, {EventType: []string{BuildEventTypePush}}, {CreatedBy: []string{"shuheiktgwtest"}}, + {BranchName: "master"}, } for i, opt := range cases {