Skip to content

Commit 5c39669

Browse files
env removed
1 parent 4054bf1 commit 5c39669

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

main.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,11 @@ func validateSubscription() {
107107
fmt.Println("Timeout or API not reachable. Continuing to next step.")
108108
return
109109
}
110-
defer resp.Body.Close()
111110

112-
if resp.StatusCode == http.StatusForbidden {
111+
statusCode := resp.StatusCode
112+
resp.Body.Close()
113+
114+
if statusCode == http.StatusForbidden {
113115
fmt.Printf("::error::\x1b[1;31mThis action requires a StepSecurity subscription for private repositories.\x1b[0m\n")
114116
fmt.Printf("::error::\x1b[31mLearn how to enable a subscription: %s\x1b[0m\n", docsURL)
115117
os.Exit(1)

0 commit comments

Comments
 (0)