Creating a private recipe that uses publice recipes doesn't seem to pass parameters to the public recipes.

I have created a recipe based on two build steps that uses public recipes. The first recipe type="tc:recipe:jetbrains/tag-build@1.0.1" uses an input parameter:  "env.input_access_token" this is set in my recipe like this <param name="env.input_access_token" value="value removed ;)" /> when defining the public recipe usage (this is from the extract of the build steps.)

however it isn't used in the public recipe cause it uses the builder.withGuestAuth in below code snippet.

The public recipe extract the value and evalutes it:

 val accessToken = input("access_token")
     
         val server = when {
             accessToken.isNotEmpty() -> builder.withTokenAuth(accessToken)
             else -> builder.withGuestAuth()
         }.build()

 

How can I parse the parameter as an input value to the public recipe in my recipe ?

0
1 comment

Hi Dennis, 

Recommended for any input except for those asking for user credentials or other sensitive data. Sensitive values should not be stored in environment variables as they expose these values to all child processes and system tools, which presents a security concern

According to the documentation – Regular build parameters.

• Declared without any prefix. For example, `accessToken`.

• Steps must use parameter references to retrieve their values (for example, `string myVal = "%accessToken%";`). This syntax can be abused to inject malicious code disguised as an input value. For that reason, regular build parameters are recommended for trusted user inputs only. 

The password type is defined as follows

 <param name = "accessToken" value = "value removed" spec="password display='normal'"/>
0

Please sign in to leave a comment.