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 access a env variable? #142

Closed
xrow opened this issue Jul 14, 2022 · 8 comments
Closed

How to access a env variable? #142

xrow opened this issue Jul 14, 2022 · 8 comments
Labels
info required Further information is requested stale No news, closing useful tip A how-to, good to know

Comments

@xrow
Copy link

xrow commented Jul 14, 2022

{{ git.tag }} was not working for me inside a gitlab pipeline but outside...

My idea was to access a env var instead, but I did not know how. I read a couple of sources on the internet but nothing worked for me. Maybe you can include a howto in the docs.

@xrow xrow changed the title How to acces env How to access a env variable? Jul 14, 2022
@github-actions
Copy link

Welcome to this project and thank you!' first issue

@xrow
Copy link
Author

xrow commented Jul 14, 2022

I made it work like...

extra:
  scm:
    latest: !ENV [CI_LATEST_TAG, '3.0.1']

{{ scm.latest }}

I think it sould be easier.

@fralau fralau added the useful tip A how-to, good to know label Jul 14, 2022
@fralau
Copy link
Owner

fralau commented Jul 14, 2022

Well done for the workaround.

mkdocs-macros converts git.tag into git describe --tags.

What error message do you get? What would you get, if you ran the command from the shell?

@xrow
Copy link
Author

xrow commented Jul 14, 2022

I get no error just in empty string.

@fralau
Copy link
Owner

fralau commented Jul 14, 2022

Also from the shell?

@xrow
Copy link
Author

xrow commented Jul 14, 2022

There is no warning or else in the cli just the confirmation that is is loading

DEBUG - [macros] - Variables: ['extra', 'config', 'environment', 'plugin', 'git', 'generator', 'social', 'consent']

@xrow
Copy link
Author

xrow commented Jul 14, 2022

Acutally for the git.tag thing I opened also #143

@fralau
Copy link
Owner

fralau commented Jul 22, 2022

What is the situation of this issue?

@fralau fralau added the info required Further information is requested label Jul 22, 2022
@fralau fralau added the stale No news, closing label Apr 23, 2023
@fralau fralau closed this as completed Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info required Further information is requested stale No news, closing useful tip A how-to, good to know
Projects
None yet
Development

No branches or pull requests

2 participants