@@ -205,33 +205,48 @@ async function post() {
205
205
auth : github_token
206
206
} ) ;
207
207
208
- const deployment = await client . repos . createDeployment ( {
209
- owner,
210
- repo,
211
- ref,
212
- environment : 'polar-signals-cloud' ,
213
- required_contexts : [ ] ,
214
- auto_merge : false ,
215
- description : 'Polar Signals Profiling Results' ,
216
- transient_environment : true ,
217
- production_environment : false
218
- } ) ;
219
-
220
- // Create a deployment status
221
- if ( deployment . data . id ) {
222
- const deploymentId = deployment . data . id ;
223
- await client . repos . createDeploymentStatus ( {
208
+ try {
209
+ core . info ( 'Creating deployment...' ) ;
210
+ const deployment = await client . repos . createDeployment ( {
224
211
owner,
225
212
repo,
226
- deployment_id : deploymentId ,
227
- state : 'success' ,
228
- description : 'Profiling data is available' ,
229
- environment_url : queryUrl ,
230
- log_url : queryUrl ,
231
- auto_inactive : true
213
+ ref,
214
+ environment : 'polar-signals-cloud' ,
215
+ required_contexts : [ ] ,
216
+ auto_merge : false ,
217
+ description : 'Polar Signals Profiling Results' ,
218
+ transient_environment : true ,
219
+ production_environment : false
232
220
} ) ;
233
221
234
- core . info ( `Created deployment with ID: ${ deploymentId } ` ) ;
222
+ // Create a deployment status
223
+ if ( deployment . data . id ) {
224
+ const deploymentId = deployment . data . id ;
225
+ core . info ( `Deployment created with ID: ${ deploymentId } . Creating deployment status...` ) ;
226
+
227
+ try {
228
+ await client . repos . createDeploymentStatus ( {
229
+ owner,
230
+ repo,
231
+ deployment_id : deploymentId ,
232
+ state : 'success' ,
233
+ description : 'Profiling data is available' ,
234
+ environment_url : queryUrl ,
235
+ log_url : queryUrl ,
236
+ auto_inactive : true
237
+ } ) ;
238
+
239
+ core . info ( `Deployment status created successfully for ID: ${ deploymentId } ` ) ;
240
+ } catch ( statusError ) {
241
+ core . error ( `Failed to create deployment status: ${ statusError . message } ` ) ;
242
+ core . error ( `Status error details: ${ JSON . stringify ( statusError ) } ` ) ;
243
+ }
244
+ } else {
245
+ core . warning ( 'Deployment was created but no deployment ID was returned' ) ;
246
+ }
247
+ } catch ( createError ) {
248
+ core . error ( `Failed to create deployment: ${ createError . message } ` ) ;
249
+ core . error ( `Create error details: ${ JSON . stringify ( createError ) } ` ) ;
235
250
}
236
251
} else {
237
252
core . info ( 'Skipping GitHub deployment creation due to missing required parameters:' ) ;
0 commit comments