Fix behaviour if the PR does already exists
This commit is contained in:
parent
10b487d09d
commit
45a64e18f4
8
main.go
8
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)
|
||||
|
|
Loading…
Reference in New Issue