Skip to content

Commit 199010f

Browse files
authored
wait for branch deletion to complete (#1973)
1 parent f2e3f8d commit 199010f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

backend/controllers/github.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
"slices"
1818
"strconv"
1919
"strings"
20+
"time"
2021

2122
"github.com/diggerhq/digger/backend/ci_backends"
2223
config2 "github.com/diggerhq/digger/backend/config"
@@ -445,6 +446,8 @@ func handlePullRequestEvent(gh utils.GithubClientProvider, payload *github.PullR
445446
// pr is merged and the branch does not exist we handle that gracefully
446447
if action == "closed" {
447448
slog.Debug("Handling closed PR action", "prNumber", prNumber)
449+
// we sleep for 1 second to give github time to delete the branch
450+
time.Sleep(1 * time.Second)
448451

449452
branchName, _, err := ghService.GetBranchName(prNumber)
450453
if err != nil {

0 commit comments

Comments
 (0)