From 6d40c5503ac41160ea7506400b4396093a29f2b3 Mon Sep 17 00:00:00 2001 From: Carlos A Becker Date: Fri, 31 Dec 2021 14:08:28 -0300 Subject: [PATCH 1/2] fix: artifacts.json should be 0644 instead of 0600 Signed-off-by: Carlos A Becker --- internal/pipe/artifacts/artifacts.go | 2 +- internal/pipe/artifacts/artifacts_test.go | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/internal/pipe/artifacts/artifacts.go b/internal/pipe/artifacts/artifacts.go index 6a657d4e529..695558ce2ca 100644 --- a/internal/pipe/artifacts/artifacts.go +++ b/internal/pipe/artifacts/artifacts.go @@ -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) } diff --git a/internal/pipe/artifacts/artifacts_test.go b/internal/pipe/artifacts/artifacts_test.go index e86d16da886..d4b5c621f0b 100644 --- a/internal/pipe/artifacts/artifacts_test.go +++ b/internal/pipe/artifacts/artifacts_test.go @@ -1,6 +1,7 @@ package artifacts import ( + "os" "path/filepath" "testing" @@ -30,5 +31,9 @@ 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()) } From 1c4ff283581714b4743c81502de4014d5dfc4688 Mon Sep 17 00:00:00 2001 From: Carlos A Becker Date: Fri, 31 Dec 2021 14:10:10 -0300 Subject: [PATCH 2/2] chore: fmt Signed-off-by: Carlos A Becker --- internal/pipe/artifacts/artifacts_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/pipe/artifacts/artifacts_test.go b/internal/pipe/artifacts/artifacts_test.go index d4b5c621f0b..c11a870d4f8 100644 --- a/internal/pipe/artifacts/artifacts_test.go +++ b/internal/pipe/artifacts/artifacts_test.go @@ -33,6 +33,7 @@ func TestArtifacts(t *testing.T) { require.NoError(t, Pipe{}.Run(ctx)) 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())