Skip to content

Commit 756f053

Browse files
feat: bypass branch rules as default for file ops (#321)
1 parent 44424ac commit 756f053

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

scm/driver/harness/content.go

+17-12
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,11 @@ func (s *contentService) Create(ctx context.Context, repo, path string, params *
5050
Encoding: "string",
5151
}
5252
in := editFile{
53-
Branch: params.Branch,
54-
Message: params.Message,
55-
Title: params.Message,
56-
Actions: []action{a},
53+
Branch: params.Branch,
54+
Message: params.Message,
55+
Title: params.Message,
56+
Actions: []action{a},
57+
BypassRules: true,
5758
}
5859

5960
res, err := s.client.do(ctx, "POST", endpoint, in, nil)
@@ -75,10 +76,11 @@ func (s *contentService) Update(ctx context.Context, repo, path string, params *
7576
Sha: params.BlobID,
7677
}
7778
in := editFile{
78-
Branch: params.Branch,
79-
Message: params.Message,
80-
Title: params.Message,
81-
Actions: []action{a},
79+
Branch: params.Branch,
80+
Message: params.Message,
81+
Title: params.Message,
82+
Actions: []action{a},
83+
BypassRules: true,
8284
}
8385

8486
res, err := s.client.do(ctx, "POST", endpoint, in, nil)
@@ -98,10 +100,11 @@ func (s *contentService) Delete(ctx context.Context, repo, path string, params *
98100
Encoding: "string",
99101
}
100102
in := editFile{
101-
Branch: params.Branch,
102-
Message: params.Message,
103-
Title: params.Message,
104-
Actions: []action{a},
103+
Branch: params.Branch,
104+
Message: params.Message,
105+
Title: params.Message,
106+
Actions: []action{a},
107+
BypassRules: true,
105108
}
106109

107110
res, err := s.client.do(ctx, "POST", endpoint, in, nil)
@@ -126,6 +129,8 @@ type editFile struct {
126129
Message string `json:"message"`
127130
NewBranch string `json:"new_branch"`
128131
Title string `json:"title"`
132+
133+
BypassRules bool `json:"bypass_rules"`
129134
}
130135

131136
type action struct {

0 commit comments

Comments
 (0)