i have tried a few things with Excoriate but i cant make this work
func (m *Nocdkp) Release(ctx context.Context, context *dagger.Directory) (string, error) {
return dag.Goreleaser(dagger.GoreleaserOpts{EnvVarsFromHost: "GITHUB_TOKEN"}).
WithGoCache().
WithSource(context).
Release(ctx, dagger.GoreleaserReleaseOpts{
Clean: true,
Cfg: ".goreleaser.yaml",
})
}
func (m *Nocdkp) Release(ctx context.Context, context *dagger.Directory) (string, error) {
return dag.Goreleaser().
WithGoCache().
WithSource(context).
Release(ctx, dagger.GoreleaserReleaseOpts{
Clean: true,
Cfg: ".goreleaser.yaml",
EnvVars: []string{"GITHUB_TOKEN"},
})
}
func (m *Nocdkp) Release(ctx context.Context, context *dagger.Directory) (string, error) {
return dag.Goreleaser().
WithGoCache().
WithSource(context).
WithEnvVar("GITHUB_TOKEN", "ghp_***************", true).
Release(ctx, dagger.GoreleaserReleaseOpts{
Clean: true,
Cfg: ".goreleaser.yaml",
})
}
only the later is working, but i dont want to hardcode it since my GHA that generates it should get token from host
func (m *Nocdkp) Generate() *dagger.Directory {
return dag.
Gha().
WithWorkflow(
dag.Gha().Workflow("Release", dagger.GhaWorkflowOpts{
OnPush: true,
}).
WithJob(dag.Gha().Job("release", "release --context .", dagger.GhaJobOpts{
DaggerVersion: "latest",
Runner: []string{"ubuntu-latest"},
Secrets: []string{"GITHUB_TOKEN"},
},
),
),
).
Generate()
}