File tree Expand file tree Collapse file tree 4 files changed +37
-0
lines changed Expand file tree Collapse file tree 4 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,19 @@ jobs:
132
132
133
133
- `description` : (Optional) Include a description of the release.
134
134
135
+ - `deploy_parameters` : (Optional) Additional parameters to supply at release creation time.
136
+
137
+ ` ` ` yaml
138
+ with:
139
+ deploy_parameters: |-
140
+ parameter1=value1
141
+ parameter2=value2
142
+ ` ` `
143
+
144
+ See the [Deploy Parameters](https://cloud.google.com/deploy/docs/parameters)
145
+ section in the Cloud Deploy documentation for details of how to use the corresponding
146
+ placeholders in your manifest(s).
147
+
135
148
- `flags` : (Optional) Space separated list of other Cloud Deploy flags,
136
149
examples can be found [here][cd-flags]. This can be used to access features
137
150
that are not exposed via this GitHub Action.
Original file line number Diff line number Diff line change @@ -79,6 +79,11 @@ inputs:
79
79
Include a description of the release.
80
80
required : false
81
81
82
+ deploy_parameters :
83
+ description : |-
84
+ Additional parameters to supply at release creation time.
85
+ required : false
86
+
82
87
flags :
83
88
description : |-
84
89
Space separated list of other Cloud Deploy flags, examples can be found:
Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ export async function run(): Promise<void> {
87
87
const annotations = parseKVString ( getInput ( 'annotations' ) ) ;
88
88
const labels = parseKVString ( getInput ( 'labels' ) ) ;
89
89
const description = getInput ( 'description' ) ;
90
+ const deployParameters = parseKVString ( getInput ( 'deploy_parameters' ) ) ;
90
91
const flags = getInput ( 'flags' ) ;
91
92
const gcloudComponent = presence ( getInput ( 'gcloud_component' ) ) ;
92
93
const gcloudVersion = getInput ( 'gcloud_version' ) ;
@@ -140,6 +141,9 @@ export async function run(): Promise<void> {
140
141
if ( skaffoldFile ) {
141
142
cmd . push ( '--skaffold-file' , skaffoldFile ) ;
142
143
}
144
+ if ( deployParameters ) {
145
+ cmd . push ( '--deploy-parameters' , joinKVString ( deployParameters ) ) ;
146
+ }
143
147
144
148
const allAnnotations = Object . assign ( { } , getDefaultAnnotations ( ) , annotations ) ;
145
149
cmd . push ( '--annotations' , joinKVString ( allAnnotations ) ) ;
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ const fakeInputs: { [key: string]: string } = {
39
39
sourceStagingDir : '' ,
40
40
skaffoldFile : '' ,
41
41
description : '' ,
42
+ deploy_parameters : '' ,
42
43
flags : '' ,
43
44
annotations : '' ,
44
45
labels : '' ,
@@ -266,6 +267,20 @@ describe('#run', function () {
266
267
expect ( args ) . to . include . members ( [ '--description' , 'My description' ] ) ;
267
268
} ) ;
268
269
270
+ it ( 'sets deploy parameters if given' , async function ( ) {
271
+ this . stubs . getInput . withArgs ( 'deploy_parameters' ) . returns ( 'param-key=param-value' ) ;
272
+
273
+ const expectedParameters = {
274
+ 'param-key' : 'param-value' ,
275
+ } ;
276
+
277
+ await run ( ) ;
278
+ const call = this . stubs . getExecOutput . getCall ( 0 ) ;
279
+ expect ( call ) . to . be ;
280
+ const args = call . args [ 1 ] ;
281
+ expect ( args ) . to . include . members ( [ '--deploy-parameters' , joinKVString ( expectedParameters ) ] ) ;
282
+ } ) ;
283
+
269
284
it ( 'sets flags if given' , async function ( ) {
270
285
this . stubs . getInput . withArgs ( 'flags' ) . returns ( '--flag1=value1 --flag2=value2' ) ;
271
286
await run ( ) ;
You can’t perform that action at this time.
0 commit comments