diff --git a/actions/draft-release/main.go b/actions/draft-release/main.go index 41ef8742..7614e494 100644 --- a/actions/draft-release/main.go +++ b/actions/draft-release/main.go @@ -40,13 +40,8 @@ func main() { panic(err) } - scratchDir, err := ioutil.TempDir("", "drafts") - if err != nil { - panic(err) - } - err = drafter.BuildAndWriteReleaseToFileDraftFromTemplate( - filepath.Join(scratchDir, "body"), templateContents, payload) + filepath.Join(".", "body"), templateContents, payload) if err != nil { panic(err) } @@ -56,7 +51,7 @@ func main() { name = fmt.Sprintf("%s %s", payload.PrimaryBuildpack.Info.Name, payload.Release.Name) } - err = ioutil.WriteFile(filepath.Join(scratchDir, "name"), []byte(name), 0644) + err = ioutil.WriteFile(filepath.Join(".", "name"), []byte(name), 0644) if err != nil { panic(err) } @@ -68,12 +63,12 @@ func main() { "--method", "PATCH", fmt.Sprintf("/repos/:owner/:repo/releases/%s", payload.Release.ID), "--field", fmt.Sprintf("tag_name=%s", payload.Release.Tag), - "--field", fmt.Sprintf("name=@%s/name", scratchDir), - "--field", fmt.Sprintf("body=@%s/body", scratchDir), + "--field", "name=@./name", + "--field", "body=@./body", }, } if _, dryRun := inputs["dry_run"]; dryRun { - bits, err := ioutil.ReadFile(filepath.Join(scratchDir, "body")) + bits, err := ioutil.ReadFile(filepath.Join(".", "body")) if err != nil { panic(err) } diff --git a/drafts/drafts.go b/drafts/drafts.go index e558d565..f253e9f1 100644 --- a/drafts/drafts.go +++ b/drafts/drafts.go @@ -313,7 +313,7 @@ func (r RegistryBuildpackLoader) LoadBuildpacks(uris []string) ([]Buildpack, err } func (r RegistryBuildpackLoader) LoadBuildpack(uri string) (Buildpack, error) { - tarFile, err := ioutil.TempFile("", "tarfiles") + tarFile, err := ioutil.TempFile(os.Getenv("RUNNER_TEMP"), "tarfiles") if err != nil { return Buildpack{}, fmt.Errorf("unable to create tempfile\n%w", err) }