Secrets in matrix #26302
-
The above yaml file causes the following error.
According to the documentation that is how you pass a secrets reference? Any thoughts what I did wrong here? |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 3 replies
-
It seems that the values of matrix parameters should be specified only with actual values, and can’t use variables (secrets, environment variables). And in the example you shared, the parameters envs and VAR_API_KEY are at the same level and no affiliation. So the expression ${{maxtrix.envs.VAR_API_KEY}} you used to call VAR_API_KEY is incorrect, you should use ${{maxtrix.VAR_API_KEY}}. |
Beta Was this translation helpful? Give feedback.
-
You can define the Secret name in your matrix configuration and then dereference it in the Steps using array notation. This is what ours looks like:
|
Beta Was this translation helpful? Give feedback.
-
We’ve tried this exact same construct but in a |
Beta Was this translation helpful? Give feedback.
-
Magic! :slight_smile: more characters |
Beta Was this translation helpful? Give feedback.
-
@daveespo you save my day! tks. |
Beta Was this translation helpful? Give feedback.
-
@daveespo thanks! |
Beta Was this translation helpful? Give feedback.
-
instead of the this here just set a seret with matrix config, this is how i do it {"hostnames":["a","b"]}"
|
Beta Was this translation helpful? Give feedback.
-
@daveespo you saved my day! THANK YOU!!! |
Beta Was this translation helpful? Give feedback.
It seems that the values of matrix parameters should be specified only with actual values, and can’t use variables (secrets, environment variables).
And in the example you shared, the parameters envs and VAR_API_KEY are at the same level and no affiliation. So the expression ${{maxtrix.envs.VAR_API_KEY}} you used to call VAR_API_KEY is incorrect, you should use ${{maxtrix.VAR_API_KEY}}.