Use macOS-safe runner workdir
This commit is contained in:
parent
f74a17c124
commit
5c57ac3655
2 changed files with 12 additions and 7 deletions
|
|
@ -125,6 +125,16 @@ func macosComputeBaseImageID(baseImageID string) string {
|
|||
}
|
||||
}
|
||||
|
||||
func macosWorkDir(workdir string) string {
|
||||
workdir = strings.TrimSpace(workdir)
|
||||
switch workdir {
|
||||
case "", "/var/lib/forgejo-runner":
|
||||
return "/tmp/forgejo-runner"
|
||||
default:
|
||||
return workdir
|
||||
}
|
||||
}
|
||||
|
||||
type nscBearerTokenFile struct {
|
||||
BearerToken string `json:"bearer_token"`
|
||||
}
|
||||
|
|
@ -183,10 +193,7 @@ func (d *Dispatcher) launchMacOSRunner(ctx context.Context, runnerName string, r
|
|||
httpClient := &http.Client{Timeout: 60 * time.Second}
|
||||
client := computev1betaconnect.NewComputeServiceClient(httpClient, d.opts.ComputeBaseURL)
|
||||
|
||||
workdir := d.opts.WorkDir
|
||||
if strings.TrimSpace(workdir) == "" {
|
||||
workdir = "/tmp/forgejo-runner"
|
||||
}
|
||||
workdir := macosWorkDir(d.opts.WorkDir)
|
||||
|
||||
env := map[string]string{
|
||||
"FORGEJO_INSTANCE_URL": req.InstanceURL,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue