File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -241,6 +241,15 @@ export function createAppContext({
241241 ] . filter ( Boolean ) . join ( '\n' ) ;
242242 }
243243
244+ /**
245+ * @param {string | null | undefined } repo
246+ * @returns {string }
247+ */
248+ function readRepositoryOwner ( repo ) {
249+ const owner = String ( repo || '' ) . split ( '/' ) [ 0 ] ?. trim ( ) ;
250+ return owner && owner !== String ( repo || '' ) . trim ( ) ? owner : '' ;
251+ }
252+
244253 /**
245254 * @param {unknown } principal
246255 * @returns {string | undefined }
@@ -645,6 +654,8 @@ export function createAppContext({
645654 const author = String ( body . author || '' ) . trim ( )
646655 || authSession ?. operatorLogin
647656 || authSession ?. installationAccountLogin
657+ || ( hasRepositoryRevisionSelection ? readRepositoryOwner ( sourceRepo ) : '' )
658+ || signerAddress
648659 || '' ;
649660 if ( ! author ) {
650661 /** @type {StatusError } */
Original file line number Diff line number Diff line change @@ -60,7 +60,6 @@ test('@bitcode/protocol accepts live repository revision deposits without demo i
6060
6161 const result = app . createDeposit ( {
6262 title : 'ENGI repository revision' ,
63- author : 'engineeredsoftware' ,
6463 sourceProvider : 'github' ,
6564 sourceRepo : 'engineeredsoftware/ENGI' ,
6665 sourceBranch : 'main' ,
@@ -76,6 +75,7 @@ test('@bitcode/protocol accepts live repository revision deposits without demo i
7675 } ) ;
7776
7877 assert . equal ( result . ok , true ) ;
78+ assert . equal ( result . asset . metadata . author , 'engineeredsoftware' ) ;
7979 assert . equal ( result . asset . artifactKind , 'repository-revision' ) ;
8080 assert . equal ( result . asset . artifactType , 'vcs-source-anchor' ) ;
8181 assert . equal ( result . asset . addressingSurface . repo , 'engineeredsoftware/ENGI' ) ;
You can’t perform that action at this time.
0 commit comments