grumphp icon indicating copy to clipboard operation
grumphp copied to clipboard

Using Dotenv in yaml config does not provide value of env var

Open benr77 opened this issue 3 years ago • 0 comments

Q A
Version 1.13.0
Bug? maybe
New feature? no
Question? yes
Documentation? no
Related tickets #1040

A new issue to try and resolve my question in the final comment of #1040 as it's likely an unrelated issue.

As per your suggestion in https://github.com/phpro/grumphp/issues/1040#issuecomment-1228604767 I am trying to inject the value of an environment variable into the GrumPHP yaml configuration file.

I have encountered a strange issue trying to get this setup. Instead of making the actual value of my GITLAB_TOKEN env var available, I get a strange string which looks like env_e7937a168f382d27_GITLAB_TOKEN_4e06944bcec1f665r4a82bf0125e3f8d.

# .env.local

GITLAB_TOKEN=XXXXXX
# grumphp.yml

grumphp:
    tasks:
        gitlab_lint:
            api_token: '%env(GITLAB_TOKEN)%'
    environment:
        files:
            - .env.local

Any pointers much appreciated. Thank you.

benr77 avatar Sep 08 '22 05:09 benr77