Skip to content

Commit

Permalink
github deployment optional automerge
Browse files Browse the repository at this point in the history
  • Loading branch information
carloscastrojumo committed Aug 9, 2023
1 parent e3e9fda commit 7c39ccc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/services/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ type GitHubDeployment struct {
EnvironmentURL string `json:"environmentURL,omitempty"`
LogURL string `json:"logURL,omitempty"`
RequiredContexts []string `json:"requiredContexts"`
AutoMerge bool `json:"autoMerge,omitempty"`
}

const (
Expand Down Expand Up @@ -191,6 +192,7 @@ func (g *GitHubNotification) GetTemplater(name string, f texttemplate.FuncMap) (
}
notification.GitHub.Deployment.LogURL = logURLData.String()

notification.GitHub.Deployment.AutoMerge = g.Deployment.AutoMerge
notification.GitHub.Deployment.RequiredContexts = g.Deployment.RequiredContexts
}

Expand Down
2 changes: 2 additions & 0 deletions pkg/services/github_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ func TestGetTemplater_GitHub_Deployment(t *testing.T) {
EnvironmentURL: "https://argoproj.github.io",
LogURL: "https://argoproj.github.io/log",
RequiredContexts: []string{},
AutoMerge: false,
},
},
}
Expand Down Expand Up @@ -156,6 +157,7 @@ func TestGetTemplater_GitHub_Deployment(t *testing.T) {
assert.Equal(t, "https://argoproj.github.io", notification.GitHub.Deployment.EnvironmentURL)
assert.Equal(t, "https://argoproj.github.io/log", notification.GitHub.Deployment.LogURL)
assert.Len(t, notification.GitHub.Deployment.RequiredContexts, 0)
assert.Equal(t, false, notification.GitHub.Deployment.AutoMerge)
}

func TestNewGitHubService_GitHubOptions(t *testing.T) {
Expand Down

0 comments on commit 7c39ccc

Please sign in to comment.