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

[Feature Request] environment variable support in when conditions #45

Open
andrewtremblay opened this issue Mar 7, 2024 · 2 comments
Open

Comments

@andrewtremblay
Copy link

when doesn't currently support environment variables. The current workaround is to add env var checks inside our own scripts.

if [ SOME_ENV_VAR = true ]; then run commands; else echo "skip commands"; fi

It would be very useful to have access to env variables in the when condition so that these scripts do not have to be more complicated.

...
blocks:
  - name: 'Distribute iOS build'
    skip: 
      when: $PLATFORM == 'android'
...

If other env notation is not usable, it could be at the same level as the change_in function:

...
blocks:
  - name: 'Distribute Android build'
    skip: 
      when: "env(PLATFORM) == 'ios'"
...
@andrewtremblay
Copy link
Author

I'm happy to make a PR of the env() function approach.

@lucianoliberti
Copy link

@andrewtremblay thanks, we'll add it to the list to be analized.

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

2 participants