Skip to content

Commit

Permalink
use log.Fatal
Browse files Browse the repository at this point in the history
  • Loading branch information
lantoli committed Apr 9, 2024
1 parent 82f4d28 commit 1bb3661
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/changelog-pr-check/changelog-pr-check.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"encoding/json"
"fmt"
"log"
"os"
"strings"
)
Expand All @@ -19,11 +20,11 @@ func main() {
jsonLabels = os.Getenv("PR_LABELS")
)
if title == "" || number == "" || jsonLabels == "" {
panic("Environment variables PR_TITLE, PR_NUMBER and PR_LABELS are required")
log.Fatal("Environment variables PR_TITLE, PR_NUMBER and PR_LABELS are required")
}
var labels []string
if err := json.Unmarshal([]byte(jsonLabels), &labels); err != nil {
panic(fmt.Sprintf("PR_LABELS is not a stringified JSON array: %v", err))
log.Fatalf("PR_LABELS is not a stringified JSON array: %v", err)
}

if skipTitle(title) {
Expand Down

0 comments on commit 1bb3661

Please sign in to comment.