How to retrieve a SECRET ENV VAR value from a script in GO

Hello all,

I want to make a simple script step in order to read a Secrets variable that I have added.

So Step 1 was to create the secret

Step2 : I create a simple script in go

package main

import (
func main() {
fmt.Println(“Hello World from go”)
fmt.Println(“1” + os.Getenv(“SPORT_TST”))

And I used the script step to make it running:

however i never succeed to retrieve the value => i always get a [REDACTED]

I do understand the fact that env variable have an order availability ! But Secrets are on top and available before the workflow start.

If somebody have any clue on this one.
Best regards

Hello @xro,

Can you please send us the log file or the URL of the related build and also enable Support Access on the Settings tab of the app ( Enabling the Bitrise Support user for your app | Bitrise DevCenter ) so that we can take a more in-depth look? :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.