Skip to content

Commit

Permalink
Merge pull request #80 from theBeginner86/thebeginner86/chore/6
Browse files Browse the repository at this point in the history
[chore] Remove Debug Statements
  • Loading branch information
theBeginner86 authored Dec 25, 2024
2 parents 2242b34 + 64bc142 commit 25204ef
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions cmd/kanvas-snapshot/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,7 @@ func CreateMesheryDesign(uri, name, email string) (string, error) {

func GenerateSnapshot(contentID, assetLocation string, ghAccessToken string) error {
payload := fmt.Sprintf(`{"ref":"master","inputs":{"contentID":"%s","assetLocation":"%s"}}`, contentID, assetLocation)
fmt.Println("check for access token", len(ghAccessToken))
req, err := http.NewRequest("POST", "https://api.github.com/repos/meshery/helm-kanvas-snapshot/actions/workflows/kanvas.yml/dispatches", bytes.NewBuffer([]byte(payload)))
fmt.Println(err)
if err != nil {
return err
}
Expand All @@ -219,24 +217,11 @@ func GenerateSnapshot(contentID, assetLocation string, ghAccessToken string) err

client := &http.Client{}
resp, err := client.Do(req)
fmt.Println(err)
if err != nil {
return err
}
defer resp.Body.Close()

// read response

// Decode response
var result map[string]interface{}
err = json.NewDecoder(resp.Body).Decode(&result)
if err != nil {
body, _ := io.ReadAll(resp.Body)
return errors.ErrDecodingAPI(fmt.Errorf("failed to decode json. body: %s, error: %w", body, err))
}

fmt.Printf("%#v\n", result)

return nil
}

Expand Down

0 comments on commit 25204ef

Please sign in to comment.