@@ -23,6 +23,7 @@ export class Updater {
2323 this . docker = new Docker ( )
2424 this . outputHostPath = path . join ( workingDirectory , 'output' )
2525 this . repoHostPath = path . join ( workingDirectory , 'repo' )
26+ this . details [ 'credentials-metadata' ] = this . generateCredentialsMetadata ( )
2627 }
2728
2829 /**
@@ -57,6 +58,51 @@ export class Updater {
5758 }
5859 }
5960
61+ private generateCredentialsMetadata ( ) : Credential [ ] {
62+ const unique : Set < string > = new Set ( )
63+ const result : Credential [ ] = [ ]
64+ for ( const credential of this . credentials ) {
65+ if ( credential . type === 'jit_access' ) {
66+ continue
67+ }
68+
69+ const obj : any = { type : credential . type }
70+ if ( credential . host !== undefined ) {
71+ obj . host = credential . host
72+ }
73+ if ( credential . registry !== undefined ) {
74+ obj . registry = credential . registry
75+ }
76+ if ( credential [ 'index-url' ] !== undefined ) {
77+ obj [ 'index-url' ] = credential [ 'index-url' ]
78+ }
79+ if ( credential [ 'env-key' ] !== undefined ) {
80+ obj [ 'env-key' ] = credential [ 'env-key' ]
81+ }
82+ if ( credential . url !== undefined ) {
83+ obj . url = credential . url
84+ }
85+ if ( credential . organization !== undefined ) {
86+ obj . organization = credential . organization
87+ }
88+ if ( credential [ 'replaces-base' ] !== undefined ) {
89+ obj [ 'replaces-base' ] = credential [ 'replaces-base' ]
90+ }
91+ if ( credential [ 'public-key-fingerprint' ] !== undefined ) {
92+ obj [ 'public-key-fingerprint' ] = credential [ 'public-key-fingerprint' ]
93+ }
94+ if ( credential . repo !== undefined ) {
95+ obj . repo = credential . repo
96+ }
97+ const key = JSON . stringify ( obj )
98+ if ( ! unique . has ( key ) ) {
99+ unique . add ( key )
100+ result . push ( obj as Credential )
101+ }
102+ }
103+ return result
104+ }
105+
60106 private async runUpdate ( proxy : Proxy ) : Promise < void > {
61107 const name = `dependabot-job-${ this . apiClient . params . jobId } `
62108 const container = await this . createContainer ( proxy , name , {
0 commit comments