Selaa lähdekoodia

fix error on trying to delete charts on non-default github branches

Anukul Sangwan 4 vuotta sitten
vanhempi
sitoutus
22be1cb4e8
1 muutettua tiedostoa jossa 7 lisäystä ja 1 poistoa
  1. 7 1
      internal/integrations/ci/actions/actions.go

+ 7 - 1
internal/integrations/ci/actions/actions.go

@@ -431,9 +431,15 @@ func (g *GithubActions) deleteGithubFile(
 		sha = *fileData.SHA
 	}
 
+	branch := g.GitBranch
+
+	if branch == "" {
+		branch = g.defaultBranch
+	}
+
 	opts := &github.RepositoryContentFileOptions{
 		Message: github.String(fmt.Sprintf("Delete %s file", filename)),
-		Branch:  github.String(g.defaultBranch),
+		Branch:  &branch,
 		SHA:     &sha,
 	}