Skip to content

Commit c60d625

Browse files
committed
Use envOrDefault for GPG_PRIVATE_KEY_FILE environment variable
By using `envOrDefault` an issue is prevented in evaluating the template before a release is created. By setting the default value to `ENV_VAR_GPG_PRIVATE_KEY_FILE_NOT_SET`, this value is then shown in the error message at signing time. The reason for changing this is so that it becomes possible to create local, unsigned releases when creating a release as follows: `goreleaser release --snapshot --clean --skip sign,after`
1 parent 5d86f91 commit c60d625

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.goreleaser.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,10 @@ nfpms:
133133
postremove: scripts/postremove.sh
134134
rpm:
135135
signature:
136-
key_file: "{{ .Env.GPG_PRIVATE_KEY_FILE }}"
136+
key_file: '{{ envOrDefault "GPG_PRIVATE_KEY_FILE" "ENV_VAR_GPG_PRIVATE_KEY_FILE_NOT_SET" }}'
137137
deb:
138138
signature:
139-
key_file: "{{ .Env.GPG_PRIVATE_KEY_FILE }}"
139+
key_file: '{{ envOrDefault "GPG_PRIVATE_KEY_FILE" "ENV_VAR_GPG_PRIVATE_KEY_FILE_NOT_SET" }}'
140140
type: origin
141141
-
142142
<< : *NFPM

0 commit comments

Comments
 (0)