#Secrets | Dagger - Resolved

1 messages · Page 1 of 1 (latest)

coral mauve
#

I was doing secrets 'wrong' just passing string, which was working.

#

I swapped to *dagger.Secret but Github Actions is now not working, well, even running locally its saying, something about the env var not found.

#

the odd part is, it is saying it cant find it, but it IS finding it, because it exposes part of the secret, or so it looks like (i was using test as the value)

#

failed to get value for argument "appSecret": secret env var not found: "tes..."

#

okay, silly me. I've resolved it

#

I misunderstood the env, cmd, part. Kind of a "mini feature" of the secrets arg which must be followed.

#

Secrets | Dagger - Resolved

oblique stag
#

Glad you were able to figure it out @coral mauve thanks for sharing your experience its always nice to see things from a fresh perspective.

Is there anything you think we could have done better in the docs or error output to make it more obvious that you needed to use env:?

coral mauve
#

Yes, it's in a small amount of text, and to me it didnt jump out like it must follow these strategies. I actually mistook it for a common way of using $env: (Powershell) or env (Linux) so I was thinking oh i could just put a "string" since thats what an $env returns. So it was a mixture of dev jumping ahead too confidently and clumsiness.

Maybe the page could have like a bootstrap 'notice' alert type

"env:" "cmd:" or "file:" must be used for a *dagger.Secret. Passing string values via the CLI will not work.

#

Hard to strike the right balance between too much docs or too little as sometimes too much is overwhelming, but many CLI tools, im very used to things like {{ $env: }} or env: or {{ secrets.ENV }} and so usually those just resolve to strings. So i was too "yeah yeah, ez pz, i'll just put a string for now". (I didnt read enough and slow enough)