I have this on my condition where if the build/source pipeline has null or ‘’ value for this CI variable: SPECS then it should skip running the command. However, it seems it still triggers the command.
I’ve also tried out those exact steps for my triggering/triggered pipelines on 3.47.0 too - an the original null check for a environment variable that isn’t set doesn’t print as expected (doesn’t matter if I add the build.env attributes or leave those attributes empty and have a simple trigger:
Curious - are you setting any additional attributes on your trigger step - or is it just the one-liner as you’ve shown above?
trigger: "e2e-tests" # triggers the e2e tests sitting on a separate repo
build:
env:
SPEC: ${SPEC} # pass the variables set in Build Steps
soft_fail: true # even if tests fail, it can still move to the next CI steps below
Also, I’m happy to share the whole thing and the builds via support email if that makes it easier to help debug.
Cheers - looks as what I’d expect normally! (assuming as it’s said there that the SPEC variable is defined in the build’s commands)
You could implement a default in the build.env attribute of the trigger to look something like SPEC: ${SPEC:-} (note the :-) as when thats passed through, the variable will be set as an empty string on the triggering build. That way if its defaulted (hence not set) - the npm command can be bypassed:
In that definition above, the SPEC variable isn’t defined and thus will be resultant as "" on the trigger, and will skip the command with said conditional. If it is set of course, either by upper level env (like in my example) or set on the command steps itself before the trigger - that conditional will resolve true and will run.