Local Backend should create SubDirs (#1706)

close #1705
This commit is contained in:
6543 2023-04-20 00:56:03 +02:00 committed by GitHub
parent de033176fd
commit 80d5d233b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -68,8 +68,15 @@ func (e *local) IsAvailable(context.Context) bool {
func (e *local) Load(context.Context) error {
dir, err := os.MkdirTemp("", "woodpecker-local-*")
if err != nil {
return err
}
e.workflowBaseDir = dir
return err
if err := os.Mkdir(filepath.Join(e.workflowBaseDir, workingSubDir), 0o700); err != nil {
return err
}
return os.Mkdir(filepath.Join(e.workflowBaseDir, homeSubDir), 0o700)
}
// Setup the pipeline environment.