Fix behaviour when error occurs
This commit is contained in:
parent
45a64e18f4
commit
214e8c60ef
3
main.go
3
main.go
|
@ -67,6 +67,7 @@ func main() {
|
||||||
ctx, err := githubactions.Context()
|
ctx, err := githubactions.Context()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
githubactions.Fatalf("could not get context: %v", err.Error())
|
githubactions.Fatalf("could not get context: %v", err.Error())
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
token := os.Getenv("GITHUB_TOKEN")
|
token := os.Getenv("GITHUB_TOKEN")
|
||||||
|
@ -75,11 +76,13 @@ func main() {
|
||||||
config, err := ParseActionConfig(*ctx)
|
config, err := ParseActionConfig(*ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
githubactions.Fatalf("%v", err.Error())
|
githubactions.Fatalf("%v", err.Error())
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
pr, err := createPullRequest(ctx.ServerURL, token, *config)
|
pr, err := createPullRequest(ctx.ServerURL, token, *config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
githubactions.Fatalf("Error while creating pr: %v", err.Error())
|
githubactions.Fatalf("Error while creating pr: %v", err.Error())
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("Created PR with id %d\n", pr.ID)
|
fmt.Printf("Created PR with id %d\n", pr.ID)
|
||||||
|
|
Loading…
Reference in New Issue