buck2 icon indicating copy to clipboard operation
buck2 copied to clipboard

how can I pass environment variables to test scripts?

Open BrianHicks opened this issue 2 years ago • 4 comments

I need to be able to access a specific environment variable (it's a Percy API key) in an invocation of buck test //... in GitHub actions, but I'm having some trouble. It doesn't look like there's a way to forward an environment variable from the containing environment? Is there, and I'm just missing something?

BrianHicks avatar May 04 '23 14:05 BrianHicks

Something like this should work:

buck2 test //... -- --env FOO=$FOO

stepancheg avatar May 04 '23 14:05 stepancheg

Ah! Yes, that does it. Are those extra args documented somewhere?

BrianHicks avatar May 04 '23 16:05 BrianHicks

I'm afraid not. It should be.

stepancheg avatar May 04 '23 16:05 stepancheg

I'll add to buck2 test --help.

stepancheg avatar May 04 '23 19:05 stepancheg