File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,11 @@ const PROXY_USER = "proxy_user";
1717const KEY_SIZE = 2048 ;
1818const KEY_EXPIRY_YEARS = 2 ;
1919
20+ const LANGUAGE_TO_REGISTRY_TYPE : Record < string , string > = {
21+ "java-kotlin" : "maven_repository" ,
22+ "csharp" : "nuget_feed" ,
23+ } ;
24+
2025type CertificateAuthority = {
2126 cert : string ;
2227 key : string ;
@@ -192,6 +197,7 @@ function getCredentials(logger: Logger): Credential[] {
192197 "registries_credentials" ,
193198 ) ;
194199 const registrySecrets = actionsUtil . getOptionalInput ( "registry_secrets" ) ;
200+ const language = actionsUtil . getOptionalInput ( "language" ) ;
195201
196202 let credentialsStr : string ;
197203 if ( registriesCredentials !== undefined ) {
@@ -212,6 +218,13 @@ function getCredentials(logger: Logger): Credential[] {
212218 if ( e . url === undefined && e . host === undefined ) {
213219 throw new Error ( "Invalid credentials - must specify host or url" ) ;
214220 }
221+
222+ // Filter credentials based on language if specified. `type` is the registry type.
223+ // E.g., "maven_feed" for Java/Kotlin, "nuget_repository" for C#.
224+ if ( language && LANGUAGE_TO_REGISTRY_TYPE [ language ] !== e . type ) {
225+ continue ;
226+ }
227+
215228 out . push ( {
216229 type : e . type ,
217230 host : e . host ,
Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ inputs:
1616 description : GitHub token to use for authenticating with this instance of GitHub, used to upload debug artifacts.
1717 default : ${{ github.token }}
1818 required : false
19+ language :
20+ description : The programming language to setup the proxy for the correct ecosystem
21+ required : false
1922outputs :
2023 proxy_host :
2124 description : The IP address of the proxy
You can’t perform that action at this time.
0 commit comments