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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃殌 Feature: enable environment variables or appConfig.yaml properties to be referred to from template.yaml files. #24812

Open
2 tasks done
monkeyhandz opened this issue May 16, 2024 · 1 comment
Labels
area:scaffolder Everything and all things related to the scaffolder project area enhancement New feature or request

Comments

@monkeyhandz
Copy link

monkeyhandz commented May 16, 2024

馃敄 Feature description

In template.yaml I would like to be able to refer to variables that are in appConfig.yaml and/or an environment variable.

馃帳 Context

I want to avoid hard coding values, especially api tokens and secrets, into template.yaml files.

鉁岋笍 Possible Implementation

Similar to template parameters, I was thinking the ${{ env.name }} and ${{ appConfig.name }} format, such as:

-  id: fetchAPISpec
    name: Fetch API yaml from SwaggerHub
    action: fetch:plain:file
    input:
        url: ${{ parameters.url }}
        targetPath: ${{ parameters.target }}
        token: ${{ env.MY_API_TOKEN }}

Or from appConfig:

-  id: fetchAPISpec
    name: Fetch API yaml from SwaggerHub
    action: fetch:plain:file
    input:
        url: ${{ parameters.url }}
        targetPath: ${{ parameters.target }}
        token: ${{ appConfig.myApiToken }}

An custom action is another possible solution, but I don't have details of how that would work. I raised this question on the support discord channel, and a user @drodil answered they had made their own action.

馃憖 Have you spent some time to check if this feature request has been raised before?

  • I checked and didn't find similar issue

馃彚 Have you read the Code of Conduct?

Are you willing to submit PR?

No, but I'm happy to collaborate on a PR with someone else

@monkeyhandz monkeyhandz added the enhancement New feature or request label May 16, 2024
@Rugvip Rugvip added the area:scaffolder Everything and all things related to the scaffolder project area label May 20, 2024
@benjdlambert
Copy link
Member

I think that this is probably most related to #9461

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:scaffolder Everything and all things related to the scaffolder project area enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants