From 4b87d0f7835ecb6eaf0bf37d81dff449d246c6cd Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Fri, 27 Aug 2021 12:22:25 +0900 Subject: [PATCH] .github/workflows: Bug fix: Report time-out correctly Updates #1664 --- .github/workflows/sourcehutbuild.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sourcehutbuild.go b/.github/workflows/sourcehutbuild.go index cedc131f5..79b43e600 100644 --- a/.github/workflows/sourcehutbuild.go +++ b/.github/workflows/sourcehutbuild.go @@ -119,7 +119,6 @@ func run() error { // Poll the queued job's status const maxAttempt = 60 -loop: for i := 0; i < maxAttempt; i++ { fmt.Printf("Polling the status... (%d)\n", i+1) @@ -142,7 +141,7 @@ loop: case "running": // Do nothing case "success": - break loop + return nil case "failed": resBody, err := io.ReadAll(body) if err != nil { @@ -154,7 +153,7 @@ loop: time.Sleep(10 * time.Second) } - return nil + return fmt.Errorf("time out") } func main() {