Skip to content

Commit

Permalink
feat: bypass branch rules as default for file ops (#321)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinav-harness authored Aug 29, 2024
1 parent 44424ac commit 756f053
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions scm/driver/harness/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,11 @@ func (s *contentService) Create(ctx context.Context, repo, path string, params *
Encoding: "string",
}
in := editFile{
Branch: params.Branch,
Message: params.Message,
Title: params.Message,
Actions: []action{a},
Branch: params.Branch,
Message: params.Message,
Title: params.Message,
Actions: []action{a},
BypassRules: true,
}

res, err := s.client.do(ctx, "POST", endpoint, in, nil)
Expand All @@ -75,10 +76,11 @@ func (s *contentService) Update(ctx context.Context, repo, path string, params *
Sha: params.BlobID,
}
in := editFile{
Branch: params.Branch,
Message: params.Message,
Title: params.Message,
Actions: []action{a},
Branch: params.Branch,
Message: params.Message,
Title: params.Message,
Actions: []action{a},
BypassRules: true,
}

res, err := s.client.do(ctx, "POST", endpoint, in, nil)
Expand All @@ -98,10 +100,11 @@ func (s *contentService) Delete(ctx context.Context, repo, path string, params *
Encoding: "string",
}
in := editFile{
Branch: params.Branch,
Message: params.Message,
Title: params.Message,
Actions: []action{a},
Branch: params.Branch,
Message: params.Message,
Title: params.Message,
Actions: []action{a},
BypassRules: true,
}

res, err := s.client.do(ctx, "POST", endpoint, in, nil)
Expand All @@ -126,6 +129,8 @@ type editFile struct {
Message string `json:"message"`
NewBranch string `json:"new_branch"`
Title string `json:"title"`

BypassRules bool `json:"bypass_rules"`
}

type action struct {
Expand Down

0 comments on commit 756f053

Please sign in to comment.