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

#1

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 (
“fmt”
“os”
)
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
Xavier

0 Likes