From d5777d31b33d766e01283be985ba44333da7736f Mon Sep 17 00:00:00 2001 From: Nish Krishnan Date: Fri, 12 Nov 2021 15:27:42 -0800 Subject: [PATCH] Fix condition for pull not found. (#151) --- server/events/vcs/github_client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/events/vcs/github_client.go b/server/events/vcs/github_client.go index c67569553b..d009bdf1bb 100644 --- a/server/events/vcs/github_client.go +++ b/server/events/vcs/github_client.go @@ -427,14 +427,14 @@ func (g *GithubClient) GetPullRequestFromName(repoName string, repoOwner string, return pull, nil } ghErr, ok := err.(*github.ErrorResponse) - if !ok || ghErr.Response.StatusCode != 404 { + if !ok || ghErr.Response.StatusCode != http.StatusNotFound { return pull, err } time.Sleep(retryDelay) } ghErr, ok := err.(*github.ErrorResponse) - if ok && ghErr.Response.StatusCode != 404 { + if ok && ghErr.Response.StatusCode == http.StatusNotFound { return pull, &PullRequestNotFound{Err: err} } return pull, err