Skip to content

Commit

Permalink
Do not upload file to devnull server on CI (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
at-wat authored Sep 6, 2023
1 parent ecb2fbd commit 3f3719d
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions cmd/gh-pr-upload/uploader/uploader.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,29 +177,6 @@ func uploadS3(filename string) error {
}

func uploadTest(filename string) error {
req, err := http.NewRequest("POST", "http://devnull-as-a-service.com/dev/null", nil)
if err != nil {
return err
}

req.Body, err = os.Open(filename)
if err != nil {
fmt.Fprintf(os.Stderr, "error: %v\n", err)
os.Exit(1)
}
defer req.Body.Close()

resp, err := http.DefaultClient.Do(req)
if err != nil {
fmt.Fprintf(os.Stderr, "error: failed to post: %v\n", err)
os.Exit(1)
}
defer resp.Body.Close()
if resp.StatusCode < 200 || 300 <= resp.StatusCode {
fmt.Fprintf(os.Stderr, "error: failed to upload: %s\n", resp.Status)
os.Exit(1)
}

fmt.Printf("file://%s", filename)

return nil
Expand Down

0 comments on commit 3f3719d

Please sign in to comment.