File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
components/server/src/prebuilds Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ export class BitbucketServerApp {
126
126
span . setTag ( "contextUrl" , contextUrl ) ;
127
127
const context = await this . contextParser . handle ( { span } , user , contextUrl ) ;
128
128
if ( ! CommitContext . is ( context ) ) {
129
- throw new Error ( "CommitContext exprected ." ) ;
129
+ throw new Error ( "CommitContext expected ." ) ;
130
130
}
131
131
const commit = context . revision ;
132
132
await this . webhookEvents . updateEvent ( event . id , {
@@ -240,7 +240,24 @@ export class BitbucketServerApp {
240
240
}
241
241
242
242
protected getCloneUrl ( event : PushEventPayload ) : string {
243
- return event . repository . links . clone [ 0 ] . href ;
243
+ // "links": {
244
+ // "clone": [
245
+ // {
246
+ // "href": "ssh://[email protected] :7999/tes/hello-world-zz-1.git",
247
+ // "name": "ssh"
248
+ // },
249
+ // {
250
+ // "href": "https://bitbucket.gitpod-dev.com/scm/tes/hello-world-zz-1.git",
251
+ // "name": "http"
252
+ // }
253
+ // ],
254
+ // "self": [...]
255
+ // }
256
+ const cloneURL = event . repository ?. links ?. clone ?. find ( ( link ) => link ?. name === "http" ) ?. href ;
257
+ if ( ! cloneURL ) {
258
+ throw new Error ( `Expected to read clone URL from push event. Repository: ${ event ?. repository ?. name } ` ) ;
259
+ }
260
+ return cloneURL ;
244
261
}
245
262
246
263
get router ( ) : express . Router {
You can’t perform that action at this time.
0 commit comments