File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -295,6 +295,14 @@ func TestSecretVars(t *testing.T) {
295295 ),
296296 WithTask ("test-deferred-secret" ),
297297 )
298+ NewExecutorTest (t ,
299+ WithName ("env secret limitation" ),
300+ WithExecutorOptions (
301+ task .WithDir ("testdata/secrets" ),
302+ ),
303+ WithTask ("test-env-secret-limitation" ),
304+ )
305+
298306}
299307
300308func TestRequires (t * testing.T ) {
Original file line number Diff line number Diff line change @@ -50,3 +50,17 @@ tasks:
5050 - echo "Starting task"
5151 - defer : echo "Cleanup with secret={{.DEFERRED_SECRET}} and app={{.APP_NAME}}"
5252 - echo "Main command executed"
53+
54+ test-env-secret-limitation :
55+ desc : Test showing that env vars with secret flag are NOT masked (limitation)
56+ env :
57+ SECRET_TOKEN :
58+ value : " env-secret-token-123"
59+ secret : true # This flag does NOT work for env vars!
60+ PUBLIC_ENV : " public-value"
61+ cmds :
62+ # Templates {{.VAR}} don't work with env - they're empty
63+ - echo "Token via template is {{.SECRET_TOKEN}}"
64+ # Shell $VAR works but is NOT masked (env vars not in template system)
65+ - echo "Token via shell is $SECRET_TOKEN"
66+ - echo "Public env is {{.PUBLIC_ENV}}"
Original file line number Diff line number Diff line change 1+ task: [test-env-secret-limitation] echo "Token via template is "
2+ Token via template is
3+ task: [test-env-secret-limitation] echo "Token via shell is $SECRET_TOKEN"
4+ Token via shell is env-secret-token-123
5+ task: [test-env-secret-limitation] echo "Public env is "
6+ Public env is
You can’t perform that action at this time.
0 commit comments