Skip to content

Commit

Permalink
fix: artifacts.json should be 0644 instead of 0600 (#2801)
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Dec 31, 2021
1 parent e2c3127 commit bbd79a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/pipe/artifacts/artifacts.go
Expand Up @@ -24,5 +24,5 @@ func (Pipe) Run(ctx *context.Context) error {
}
path := filepath.Join(ctx.Config.Dist, "artifacts.json")
log.Log.WithField("file", path).Info("writing")
return os.WriteFile(path, bts, 0o600)
return os.WriteFile(path, bts, 0o644)
}
8 changes: 7 additions & 1 deletion internal/pipe/artifacts/artifacts_test.go
@@ -1,6 +1,7 @@
package artifacts

import (
"os"
"path/filepath"
"testing"

Expand Down Expand Up @@ -30,5 +31,10 @@ func TestArtifacts(t *testing.T) {
})

require.NoError(t, Pipe{}.Run(ctx))
golden.RequireEqualJSON(t, golden.RequireReadFile(t, filepath.Join(tmp, "artifacts.json")))
path := filepath.Join(tmp, "artifacts.json")
golden.RequireEqualJSON(t, golden.RequireReadFile(t, path))

info, err := os.Stat(path)
require.NoError(t, err)
require.Equal(t, "-rw-r--r--", info.Mode().String())
}

0 comments on commit bbd79a1

Please sign in to comment.