File tree Expand file tree Collapse file tree 3 files changed +34
-7
lines changed Expand file tree Collapse file tree 3 files changed +34
-7
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,30 @@ spec:
143
143
ui:options :
144
144
allowedHosts :
145
145
- dev.azure.com
146
+ - title : Choose Pipeline Parameters
147
+ description : Please select some pipeline parameters
148
+ properties :
149
+ pipelineParameters :
150
+ title : Pipeline Parameters
151
+ type : object
152
+ properties :
153
+ name :
154
+ type : string
155
+ id :
156
+ type : number
157
+ - title : Choose Pipeline Variables
158
+ description : Please select some pipeline variables
159
+ properties :
160
+ pipelineParameters :
161
+ title : Pipeline Variables
162
+ type : object
163
+ properties :
164
+ name :
165
+ type : string
166
+ id :
167
+ type : number
168
+
169
+ ***note these properties for parameters and variables are just examples, you can use whatever key values that your pipeline will accept@!"
146
170
147
171
steps :
148
172
- id : fetch
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @parfuemerie-douglas/scaffolder-backend-module-azure-pipelines" ,
3
- "version" : " 1.0.0-next.1 " ,
3
+ "version" : " 1.0.0-next.3 " ,
4
4
"description" : " A collection of Backstage scaffolder backend modules for Azure pipelines." ,
5
5
"main" : " dist/index.cjs.js" ,
6
6
"types" : " dist/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -34,9 +34,7 @@ interface RunPipelineRequest {
34
34
templateParameters ?: {
35
35
[ key : string ] : string ;
36
36
} ;
37
- variables ?: {
38
- [ key : string ] : string ;
39
- } ;
37
+ variables ?: string ;
40
38
yamlOverrides ?: string ;
41
39
}
42
40
@@ -161,6 +159,8 @@ export const runAzurePipelineAction = (options: {
161
159
const token = ctx . input . token ?? integrationConfig . config . token ! ;
162
160
163
161
ctx . logger . info ( `Running Azure pipeline with the ID ${ pipelineId } .` ) ;
162
+
163
+ const variablesString = JSON . stringify ( pipelineVariables )
164
164
165
165
const request : RunPipelineRequest = {
166
166
resources : {
@@ -171,16 +171,19 @@ export const runAzurePipelineAction = (options: {
171
171
} ,
172
172
} ,
173
173
templateParameters : pipelineParameters as Record < string , string > ,
174
- variables : pipelineVariables as Record < string , string > ,
175
174
yamlOverrides : "" ,
176
175
} ;
177
176
177
+ if ( variablesString !== null ) {
178
+ request . variables = variablesString ;
179
+ }
180
+
178
181
const body = JSON . stringify ( request ) ;
179
182
180
183
// See the Azure DevOps documentation for more information about the REST API:
181
- // https://docs.microsoft.com/en-us/rest/api/azure/devops/pipelines/runs/run-pipeline?view=azure-devops-rest-6.1
184
+ // https://docs.microsoft.com/en-us/rest/api/azure/devops/pipelines/runs/run-pipeline?view=azure-devops-rest-7.0
182
185
await fetch (
183
- `https://${ host } /${ organization } /${ project } /_apis/pipelines/${ pipelineId } /runs?api-version=6.1-preview.1 ` ,
186
+ `https://${ host } /${ organization } /${ project } /_apis/pipelines/${ pipelineId } /runs?api-version=7.0 ` ,
184
187
{
185
188
method : "POST" ,
186
189
headers : {
You can’t perform that action at this time.
0 commit comments