.github/workflows: Bug fix: Report time-out correctly

Updates #1664
This commit is contained in:
Hajime Hoshi 2021-08-27 12:22:25 +09:00
parent 6cc64e9b1e
commit 4b87d0f783

View File

@ -119,7 +119,6 @@ func run() error {
// Poll the queued job's status // Poll the queued job's status
const maxAttempt = 60 const maxAttempt = 60
loop:
for i := 0; i < maxAttempt; i++ { for i := 0; i < maxAttempt; i++ {
fmt.Printf("Polling the status... (%d)\n", i+1) fmt.Printf("Polling the status... (%d)\n", i+1)
@ -142,7 +141,7 @@ loop:
case "running": case "running":
// Do nothing // Do nothing
case "success": case "success":
break loop return nil
case "failed": case "failed":
resBody, err := io.ReadAll(body) resBody, err := io.ReadAll(body)
if err != nil { if err != nil {
@ -154,7 +153,7 @@ loop:
time.Sleep(10 * time.Second) time.Sleep(10 * time.Second)
} }
return nil return fmt.Errorf("time out")
} }
func main() { func main() {