diff --git a/main.go b/main.go index 12ff557..11824e1 100644 --- a/main.go +++ b/main.go @@ -82,11 +82,7 @@ func main() { githubactions.Fatalf("Error while creating pr: %v", err.Error()) } - if pr != nil { - fmt.Printf("Created PR with id %d\n", pr.ID) - } else { - fmt.Printf("No PR created\n") - } + fmt.Printf("Created PR with id %d\n", pr.ID) githubactions.SetOutput("pull-request-number", strconv.FormatInt(pr.Index, 10)) githubactions.SetOutput("pull-request-url", pr.URL) @@ -234,7 +230,7 @@ func createPullRequest(apiUrl string, token string, config CreatePrConfig) (*git } if has { - return nil, nil + return nil, errors.New("PR already exists for this head branch") } pr, err := agent.createPullRequestGitea(config)