Skip to content

Commit 087c38e

Browse files
committed
chown hooks to gitpod user
1 parent 71916c7 commit 087c38e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

components/supervisor/pkg/supervisor/supervisor.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,9 @@ func setupGitMessageHook(path string) error {
845845
if err := os.MkdirAll(path, 0755); err != nil {
846846
return err
847847
}
848+
if err := os.Chown(path, gitpodUID, gitpodGID); err != nil {
849+
return err
850+
}
848851

849852
fn := filepath.Join(path, "prepare-commit-msg")
850853
// do not override existing hooks. Relevant for workspaces based off of prebuilds, which might already have a hook.
@@ -854,6 +857,9 @@ func setupGitMessageHook(path string) error {
854857
if err := os.WriteFile(fn, []byte(hookContent), 0755); err != nil {
855858
return err
856859
}
860+
if err := os.Chown(fn, gitpodUID, gitpodGID); err != nil {
861+
return err
862+
}
857863

858864
return nil
859865
}

0 commit comments

Comments
 (0)