From 397dae4e916d3cf0255e52c689d229f1e77cdcb4 Mon Sep 17 00:00:00 2001 From: Pranav Singh Date: Wed, 1 Jan 2025 21:52:25 +0530 Subject: [PATCH 1/2] fix typo Signed-off-by: Pranav Singh --- cmd/kanvas-snapshot/cmd.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cmd/kanvas-snapshot/cmd.go b/cmd/kanvas-snapshot/cmd.go index a22f36bbc7..d2a2d11feb 100644 --- a/cmd/kanvas-snapshot/cmd.go +++ b/cmd/kanvas-snapshot/cmd.go @@ -207,7 +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) - req, err := http.NewRequest("POST", "https://api.github.com/repos/meshery/helm-kanvas-snapshot/actions/workflows/kanvas.yml/dispatches", bytes.NewBuffer([]byte(payload))) + req, err := http.NewRequest("POST", "https://api.github.com/repos/meshery/helm-kanvas-snapshot/actions/workflows/kanvas.yaml/dispatches", bytes.NewBuffer([]byte(payload))) if err != nil { return err } @@ -221,6 +221,17 @@ func GenerateSnapshot(contentID, assetLocation string, ghAccessToken string) err return err } defer resp.Body.Close() + fmt.Println(resp.Status) + + // read resp + + bodyBytes, err := io.ReadAll(resp.Body) + if err != nil { + fmt.Println(err) + } + bodyString := string(bodyBytes) + fmt.Println(bodyString) + return nil } From 9892d523828bcf23e75a7a58b2deecf0cce81d22 Mon Sep 17 00:00:00 2001 From: Pranav Singh Date: Wed, 1 Jan 2025 21:53:35 +0530 Subject: [PATCH 2/2] rm Signed-off-by: Pranav Singh --- cmd/kanvas-snapshot/cmd.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/cmd/kanvas-snapshot/cmd.go b/cmd/kanvas-snapshot/cmd.go index d2a2d11feb..c69645e349 100644 --- a/cmd/kanvas-snapshot/cmd.go +++ b/cmd/kanvas-snapshot/cmd.go @@ -221,17 +221,6 @@ func GenerateSnapshot(contentID, assetLocation string, ghAccessToken string) err return err } defer resp.Body.Close() - fmt.Println(resp.Status) - - // read resp - - bodyBytes, err := io.ReadAll(resp.Body) - if err != nil { - fmt.Println(err) - } - bodyString := string(bodyBytes) - fmt.Println(bodyString) - return nil }