Skip to content

Commit 86edb45

Browse files
authored
feat: allow setting originalEnvironment in webhook deployments (#8600)
Makes sense to me. Thanks for your contribution.
1 parent 17837c0 commit 86edb45

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

backend/plugins/webhook/api/deployments.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,12 @@ import (
3939
)
4040

4141
type WebhookDeploymentReq struct {
42-
Id string `mapstructure:"id" validate:"required"`
43-
DisplayTitle string `mapstructure:"displayTitle"`
44-
Result string `mapstructure:"result"`
45-
Environment string `validate:"omitempty,oneof=PRODUCTION STAGING TESTING DEVELOPMENT"`
46-
Name string `mapstructure:"name"`
42+
Id string `mapstructure:"id" validate:"required"`
43+
DisplayTitle string `mapstructure:"displayTitle"`
44+
Result string `mapstructure:"result"`
45+
Environment string `validate:"omitempty,oneof=PRODUCTION STAGING TESTING DEVELOPMENT"`
46+
OriginalEnvironment string `mapstructure:"originalEnvironment"`
47+
Name string `mapstructure:"name"`
4748
// DeploymentCommits is used for multiple commits in one deployment
4849
DeploymentCommits []WebhookDeploymentCommitReq `mapstructure:"deploymentCommits" validate:"omitempty,dive"`
4950
CreatedDate *time.Time `mapstructure:"createdDate"`
@@ -219,7 +220,7 @@ func CreateDeploymentAndDeploymentCommits(connection *models.WebhookConnection,
219220
DisplayTitle: commit.DisplayTitle,
220221
RepoUrl: commit.RepoUrl,
221222
Environment: request.Environment,
222-
OriginalEnvironment: request.Environment,
223+
OriginalEnvironment: request.OriginalEnvironment,
223224
RefName: commit.RefName,
224225
CommitSha: commit.CommitSha,
225226
CommitMsg: commit.CommitMsg,

0 commit comments

Comments
 (0)