Skip to content

Commit

Permalink
Create folder for artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
corny committed Apr 15, 2023
1 parent 847fcbd commit fbf9cf6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion artifacts.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,15 @@ import (
var artifactsFolder = os.Getenv("ARTIFACTS")

func writeArtifact(name string, content []byte) {
// Ensure folder exists
err := os.MkdirAll(artifactsFolder, os.ModePerm)
if err != nil {
log.Printf("unable to create artifacts folder %s: %s", artifactsFolder, err)
return
}

path := filepath.Join(artifactsFolder, name)
err := os.WriteFile(path, content, 0600)
err = os.WriteFile(path, content, 0600)
if err != nil {
log.Printf("unable to write artifact %s: %v", path, err)
} else {
Expand Down

0 comments on commit fbf9cf6

Please sign in to comment.