Skip to content

Commit

Permalink
fix: avoid decrypting the same secrets multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
Luis Davim committed Jan 25, 2021
1 parent 2668337 commit 26b0d77
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions internal/app/release_files.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,13 @@ func (r *release) getValuesFiles() []string {
}
}
if r.SecretsFile != "" {
if err := decryptSecret(r.SecretsFile); err != nil {
log.Fatal(err.Error())
if !isOfType(r.SecretsFile, []string{".dec"}) {
if err := decryptSecret(r.SecretsFile); err != nil {
log.Fatal(err.Error())
}
r.SecretsFile = r.SecretsFile + ".dec"
}
fileList = append(fileList, r.SecretsFile+".dec")
fileList = append(fileList, r.SecretsFile)
} else if len(r.SecretsFiles) > 0 {
for i := 0; i < len(r.SecretsFiles); i++ {
if isOfType(r.SecretsFiles[i], []string{".dec"}) {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ func notifyMSTeams(content string, url string, failure bool, executing bool) boo
contentBold = strings.Join(contentSplit, "\n\n")
}

var jsonStr = []byte(`{
jsonStr := []byte(`{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"themeColor": "` + color + `",
Expand Down

0 comments on commit 26b0d77

Please sign in to comment.