Przeglądaj źródła

fix existing gitlab ci fetch

Mohammed Nafees 4 lat temu
rodzic
commit
883315d626
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      internal/integrations/ci/gitlab/ci.go

+ 2 - 2
internal/integrations/ci/gitlab/ci.go

@@ -65,7 +65,7 @@ func (g *GitlabCI) Setup() error {
 
 
 	jobName := getGitlabStageJobName(g.ReleaseName)
 	jobName := getGitlabStageJobName(g.ReleaseName)
 
 
-	ciFile, resp, err := client.RepositoryFiles.GetFile(g.pID, ".gitlab-ci.yml", &gitlab.GetFileOptions{
+	ciFile, resp, err := client.RepositoryFiles.GetRawFile(g.pID, ".gitlab-ci.yml", &gitlab.GetRawFileOptions{
 		Ref: gitlab.String(g.defaultGitBranch),
 		Ref: gitlab.String(g.defaultGitBranch),
 	})
 	})
 
 
@@ -95,7 +95,7 @@ func (g *GitlabCI) Setup() error {
 	} else {
 	} else {
 		// update .gitlab-ci.yml if needed
 		// update .gitlab-ci.yml if needed
 		ciFileContentsMap := make(map[string]interface{})
 		ciFileContentsMap := make(map[string]interface{})
-		err = yaml.Unmarshal([]byte(ciFile.Content), ciFileContentsMap)
+		err = yaml.Unmarshal(ciFile, ciFileContentsMap)
 
 
 		if err != nil {
 		if err != nil {
 			return fmt.Errorf("error unmarshalling existing .gitlab-ci.yml: %w", err)
 			return fmt.Errorf("error unmarshalling existing .gitlab-ci.yml: %w", err)