Skip to content

Commit

Permalink
fix: should not exit if the pr is invalid (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
LinuxSuRen authored Aug 29, 2023
1 parent 746d56b commit aed063d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/argoworkflow/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,12 @@ func (e *DefaultPluginExecutor) Execute(args executor.ExecuteTemplateArgs, wf *w
repo.Status = strings.ToLower(string(status.Phase))
}
}
if repo.PrNumber, err = strconv.Atoi(opt.Option.PR); err != nil {
err = fmt.Errorf("wrong pull-request number, %v", err)

if pr, parseErr := strconv.Atoi(opt.Option.PR); parseErr != nil {
fmt.Printf("wrong pull-request number %q, %v\n", opt.Option.PR, parseErr)
return
} else {
repo.PrNumber = pr
}

fmt.Println("send status", repo)
Expand Down

0 comments on commit aed063d

Please sign in to comment.