red-airline-54646
10/25/2023, 8:20 AMfmt.Print(string(githubPAT.Value()))
plain-parrot-21984
10/25/2023, 8:24 AMred-airline-54646
10/25/2023, 8:25 AMstrgithubPAT := githubPAT.Value().ToStringOutput().ApplyT(func(s string) (string, error) {
// Now you can work with 's' as a standard Go string
// Here we're just passing it through
return s, nil
}).(pulumi.StringOutput)
// Export the string
ctx.Export("outputS", strgithubPAT)
how can i pass it to this?
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", strgithubPAT))
melodic-tomato-39005
10/25/2023, 8:32 AMApplyT
.plain-parrot-21984
10/25/2023, 8:33 AMpulumi.Sprintf()
instead of fmt.Sprintf()
red-airline-54646
10/25/2023, 8:40 AMpulumi.Sprintf
bcoz Set
requires a string?fmt.Sprintf
but preview shows Unauthorized meaning something off with the conversion of pulumi string to regular go string.
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", githubPAT.Value().ApplyT(func(value string) string {
return value
})))
plain-parrot-21984
10/25/2023, 9:00 AMred-airline-54646
10/25/2023, 9:01 AM