mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-03-17 20:47:50 +02:00
feat: allow env vars for checksum name_template
Allow env vars for the checksum name_template.
This commit is contained in:
parent
0d9b227f48
commit
0780c232fc
@ -16,6 +16,7 @@ checksum:
|
||||
# - ProjectName
|
||||
# - Tag
|
||||
# - Version (Git tag without `v` prefix)
|
||||
# - Env (environment variables)
|
||||
# Default is `{{ .ProjectName }}_{{ .Version }}_checksums.txt`.
|
||||
name_template: "{{ .ProjectName }}_checksums.txt"
|
||||
```
|
||||
|
@ -14,11 +14,15 @@ func filenameFor(ctx *context.Context) (string, error) {
|
||||
return "", err
|
||||
}
|
||||
err = t.Execute(&out, struct {
|
||||
ProjectName, Tag, Version string
|
||||
ProjectName string
|
||||
Tag string
|
||||
Version string
|
||||
Env map[string]string
|
||||
}{
|
||||
ProjectName: ctx.Config.ProjectName,
|
||||
Tag: ctx.Git.CurrentTag,
|
||||
Version: ctx.Version,
|
||||
Env: ctx.Env,
|
||||
})
|
||||
return out.String(), err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user