#how do i pass credentials to dag.Git using GithubToken

1 messages · Page 1 of 1 (latest)

limpid grove
#

Hi Folks

I am trying to find documentation for dag.Git. did i miss it or that is not available yet ?

This is fmt.Println(dag.Git("github.com/dagger/dagger").Branch("main").Commit(context.Background())) i am trying to do but i cant figure how to pass credentials to it

Best Regards

#
    cloned, err := newGitContainer().
        // Terminal().
        WithSecretVariable("ACCESS_TOKEN", it.GithubToken).

FTR this is how i pass credentials to the git binary now.

#

how do i pass credentials to dag.Git using GithubToken

limpid grove
#
    gitsha, err := dag.
        Git(conf.repo.giturl).
        WithAuthToken(it.GithubToken).
        Branch(conf.gitbr).
        Commit(context.Background())
    if err != nil {
        return err
    }

this is what i found is this correct ?

limpid grove
#

is it possible to not cache it ? i think i am hitting the cache and i cant figure how to tell it not to cache this request

#

i think i need to pass the user but so far i cant tell how even after looking at the pr

limpid grove
#

all i needed was to get to get the git sha as you kindly suggested previously. and once i set the github token it actually worked ! unfortunately using the dag.Git api does not seem to be documented. did i miss it ?

keen lantern
limpid grove
#

forgot to ask. is it garanteed that this will not be cached ? i am starting to think i am hitting the cache and i cant see how to make sure the above is always executed

keen lantern