5
5
6
6
"github.com/SAP/jenkins-library/pkg/config"
7
7
"github.com/SAP/jenkins-library/pkg/log"
8
+
8
9
"github.com/spf13/cobra"
9
10
)
10
11
@@ -23,11 +24,11 @@ type githubCreatePullRequestOptions struct {
23
24
}
24
25
25
26
var myGithubCreatePullRequestOptions githubCreatePullRequestOptions
26
- var githubCreatePullRequestStepConfigJSON string
27
27
28
28
// GithubCreatePullRequestCommand Create a pull request on GitHub
29
29
func GithubCreatePullRequestCommand () * cobra.Command {
30
30
metadata := githubCreatePullRequestMetadata ()
31
+
31
32
var createGithubCreatePullRequestCmd = & cobra.Command {
32
33
Use : "githubCreatePullRequest" ,
33
34
Short : "Create a pull request on GitHub" ,
@@ -40,6 +41,7 @@ It can for example be used for GitOps scenarios or for scenarios where you want
40
41
return PrepareConfig (cmd , & metadata , "githubCreatePullRequest" , & myGithubCreatePullRequestOptions , config .OpenPiperFile )
41
42
},
42
43
RunE : func (cmd * cobra.Command , args []string ) error {
44
+
43
45
return githubCreatePullRequest (myGithubCreatePullRequestOptions )
44
46
},
45
47
}
@@ -79,81 +81,92 @@ func githubCreatePullRequestMetadata() config.StepData {
79
81
Inputs : config.StepInputs {
80
82
Parameters : []config.StepParameters {
81
83
{
82
- Name : "assignees" ,
83
- Scope : []string {"PARAMETERS" , "STAGES" , "STEPS" },
84
- Type : "[]string" ,
85
- Mandatory : false ,
86
- Aliases : []config.Alias {},
84
+ Name : "assignees" ,
85
+ ResourceRef : []config.ResourceReference {},
86
+ Scope : []string {"PARAMETERS" , "STAGES" , "STEPS" },
87
+ Type : "[]string" ,
88
+ Mandatory : false ,
89
+ Aliases : []config.Alias {},
87
90
},
88
91
{
89
- Name : "base" ,
90
- Scope : []string {"PARAMETERS" , "STAGES" , "STEPS" },
91
- Type : "string" ,
92
- Mandatory : true ,
93
- Aliases : []config.Alias {},
92
+ Name : "base" ,
93
+ ResourceRef : []config.ResourceReference {},
94
+ Scope : []string {"PARAMETERS" , "STAGES" , "STEPS" },
95
+ Type : "string" ,
96
+ Mandatory : true ,
97
+ Aliases : []config.Alias {},
94
98
},
95
99
{
96
- Name : "body" ,
97
- Scope : []string {"PARAMETERS" , "STAGES" , "STEPS" },
98
- Type : "string" ,
99
- Mandatory : true ,
100
- Aliases : []config.Alias {},
100
+ Name : "body" ,
101
+ ResourceRef : []config.ResourceReference {},
102
+ Scope : []string {"PARAMETERS" , "STAGES" , "STEPS" },
103
+ Type : "string" ,
104
+ Mandatory : true ,
105
+ Aliases : []config.Alias {},
101
106
},
102
107
{
103
- Name : "apiUrl" ,
104
- Scope : []string {"GENERAL" , "PARAMETERS" , "STAGES" , "STEPS" },
105
- Type : "string" ,
106
- Mandatory : true ,
107
- Aliases : []config.Alias {{Name : "githubApiUrl" }},
108
+ Name : "apiUrl" ,
109
+ ResourceRef : []config.ResourceReference {},
110
+ Scope : []string {"GENERAL" , "PARAMETERS" , "STAGES" , "STEPS" },
111
+ Type : "string" ,
112
+ Mandatory : true ,
113
+ Aliases : []config.Alias {{Name : "githubApiUrl" }},
108
114
},
109
115
{
110
- Name : "head" ,
111
- Scope : []string {"PARAMETERS" , "STAGES" , "STEPS" },
112
- Type : "string" ,
113
- Mandatory : true ,
114
- Aliases : []config.Alias {},
116
+ Name : "head" ,
117
+ ResourceRef : []config.ResourceReference {},
118
+ Scope : []string {"PARAMETERS" , "STAGES" , "STEPS" },
119
+ Type : "string" ,
120
+ Mandatory : true ,
121
+ Aliases : []config.Alias {},
115
122
},
116
123
{
117
- Name : "owner" ,
118
- Scope : []string {"PARAMETERS" , "STAGES" , "STEPS" },
119
- Type : "string" ,
120
- Mandatory : true ,
121
- Aliases : []config.Alias {{Name : "githubOrg" }},
124
+ Name : "owner" ,
125
+ ResourceRef : []config.ResourceReference {},
126
+ Scope : []string {"PARAMETERS" , "STAGES" , "STEPS" },
127
+ Type : "string" ,
128
+ Mandatory : true ,
129
+ Aliases : []config.Alias {{Name : "githubOrg" }},
122
130
},
123
131
{
124
- Name : "repository" ,
125
- Scope : []string {"PARAMETERS" , "STAGES" , "STEPS" },
126
- Type : "string" ,
127
- Mandatory : true ,
128
- Aliases : []config.Alias {{Name : "githubRepo" }},
132
+ Name : "repository" ,
133
+ ResourceRef : []config.ResourceReference {},
134
+ Scope : []string {"PARAMETERS" , "STAGES" , "STEPS" },
135
+ Type : "string" ,
136
+ Mandatory : true ,
137
+ Aliases : []config.Alias {{Name : "githubRepo" }},
129
138
},
130
139
{
131
- Name : "serverUrl" ,
132
- Scope : []string {"GENERAL" , "PARAMETERS" , "STAGES" , "STEPS" },
133
- Type : "string" ,
134
- Mandatory : true ,
135
- Aliases : []config.Alias {{Name : "githubServerUrl" }},
140
+ Name : "serverUrl" ,
141
+ ResourceRef : []config.ResourceReference {},
142
+ Scope : []string {"GENERAL" , "PARAMETERS" , "STAGES" , "STEPS" },
143
+ Type : "string" ,
144
+ Mandatory : true ,
145
+ Aliases : []config.Alias {{Name : "githubServerUrl" }},
136
146
},
137
147
{
138
- Name : "title" ,
139
- Scope : []string {"PARAMETERS" , "STAGES" , "STEPS" },
140
- Type : "string" ,
141
- Mandatory : true ,
142
- Aliases : []config.Alias {},
148
+ Name : "title" ,
149
+ ResourceRef : []config.ResourceReference {},
150
+ Scope : []string {"PARAMETERS" , "STAGES" , "STEPS" },
151
+ Type : "string" ,
152
+ Mandatory : true ,
153
+ Aliases : []config.Alias {},
143
154
},
144
155
{
145
- Name : "token" ,
146
- Scope : []string {"GENERAL" , "PARAMETERS" , "STAGES" , "STEPS" },
147
- Type : "string" ,
148
- Mandatory : true ,
149
- Aliases : []config.Alias {{Name : "githubToken" }},
156
+ Name : "token" ,
157
+ ResourceRef : []config.ResourceReference {},
158
+ Scope : []string {"GENERAL" , "PARAMETERS" , "STAGES" , "STEPS" },
159
+ Type : "string" ,
160
+ Mandatory : true ,
161
+ Aliases : []config.Alias {{Name : "githubToken" }},
150
162
},
151
163
{
152
- Name : "labels" ,
153
- Scope : []string {"PARAMETERS" , "STAGES" , "STEPS" },
154
- Type : "[]string" ,
155
- Mandatory : false ,
156
- Aliases : []config.Alias {},
164
+ Name : "labels" ,
165
+ ResourceRef : []config.ResourceReference {},
166
+ Scope : []string {"PARAMETERS" , "STAGES" , "STEPS" },
167
+ Type : "[]string" ,
168
+ Mandatory : false ,
169
+ Aliases : []config.Alias {},
157
170
},
158
171
},
159
172
},
0 commit comments