Skip to content

Commit

Permalink
Merge pull request #145 from pulumi/pgavlin/pull-request-template
Browse files Browse the repository at this point in the history
Add PR template support to deployment settings
  • Loading branch information
pgavlin authored Jun 6, 2023
2 parents 9802e4b + 8b0c8be commit 0b8c2be
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 0 deletions.
5 changes: 5 additions & 0 deletions provider/cmd/pulumi-resource-pulumiservice/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,11 @@
"description": "Trigger a deployment running `pulumi preview` when a PR is opened.",
"default": true
},
"pullRequestTemplate": {
"type": "boolean",
"description": "Use this stack as a template for pull request review stacks.",
"default": false
},
"paths": {
"type": "array",
"items": {
Expand Down
1 change: 1 addition & 0 deletions provider/pkg/internal/pulumiapi/deployment_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ type GitHubConfiguration struct {
Repository string `json:"repository,omitempty"`
DeployCommits bool `json:"deployCommits,omitempty"`
PreviewPullRequests bool `json:"previewPullRequests,omitempty"`
PullRequestTemplate bool `json:"pullRequestTemplate,omitempty"`
Paths []string `json:"paths,omitempty"`
}

Expand Down
4 changes: 4 additions & 0 deletions provider/pkg/provider/deployment_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ func (ds *PulumiServiceDeploymentSettingsInput) ToPropertyMap() resource.Propert
githubMap := resource.PropertyMap{}
githubMap["previewPullRequests"] = resource.NewPropertyValue(ds.GitHub.PreviewPullRequests)
githubMap["deployCommits"] = resource.NewPropertyValue(ds.GitHub.DeployCommits)
githubMap["pullRequestTemplate"] = resource.NewPropertyValue(ds.GitHub.PullRequestTemplate)
if ds.GitHub.Repository != "" {
githubMap["repository"] = resource.NewPropertyValue(ds.GitHub.Repository)
}
Expand Down Expand Up @@ -229,6 +230,9 @@ func toGitHubConfig(inputMap resource.PropertyMap) *pulumiapi.GitHubConfiguratio
if githubInput["previewPullRequests"].HasValue() && githubInput["previewPullRequests"].IsBool() {
github.PreviewPullRequests = githubInput["previewPullRequests"].BoolValue()
}
if githubInput["pullRequestTemplate"].HasValue() && githubInput["pullRequestTemplate"].IsBool() {
github.PullRequestTemplate = githubInput["pullRequestTemplate"].BoolValue()
}
if githubInput["paths"].HasValue() && githubInput["paths"].IsArray() {
pathsInput := githubInput["paths"].ArrayValue()
paths := make([]string, len(pathsInput))
Expand Down
7 changes: 7 additions & 0 deletions sdk/dotnet/Inputs/DeploymentSettingsGithubArgs.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions sdk/go/pulumiservice/pulumiTypes.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions sdk/nodejs/types/input.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions sdk/python/pulumi_pulumiservice/_inputs.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0b8c2be

Please sign in to comment.