Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use jinja loop variable as env variable name? #12

Open
bodomic2 opened this issue Oct 25, 2021 · 0 comments
Open

How to use jinja loop variable as env variable name? #12

bodomic2 opened this issue Oct 25, 2021 · 0 comments

Comments

@bodomic2
Copy link

bodomic2 commented Oct 25, 2021

Hi guys, this could be more a question to Github actions than to your project, but maybe you have some handy answer...

I am trying to understand how to use sensitive data together with Jinja and Actions so I'm gonna hide the hashed passwords in github env variables:

{% for project in projects %}
{% if project.auth.enabled=true|default(false) %}
       {{ project.dashedname }}-auth.basicauth.users={{ env['HERE-GOES-MY-QUESTION'] }}
{% endif %}
{% endfor %}

So I'm gonna have some yamled structure to fill this template and a list of variables named like 'my-project1-hashed-password' in github env, How can I use loop variable to pick the env variable?

Alternatively - maybe I'm just doing it wrong and I can just put env names into data_file somehow?

Please advise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant