From 1beb1d4570f0d653748ce457d78a06c1cc660d2a Mon Sep 17 00:00:00 2001 From: Tom Proctor Date: Wed, 28 Oct 2020 17:06:53 +0000 Subject: [PATCH] Don't format input --- go.mod | 1 - go.sum | 4 ---- main.go | 4 +--- main_test.go | 2 +- 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 04cbe27..5cfe949 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,6 @@ module github.com/tomhjp/gh-action-jira-create go 1.14 require ( - github.com/kalafut/m2j v0.0.1 github.com/stretchr/testify v1.6.1 github.com/tomhjp/gh-action-jira v0.1.0 ) diff --git a/go.sum b/go.sum index 2b86eac..dc6d1c6 100644 --- a/go.sum +++ b/go.sum @@ -2,10 +2,6 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/kalafut/m2j v0.0.0-20200831013012-43edf17eb155 h1:eZA4bGAG/36ygQeYyKtKEbuW5C3R80uvoMLQP6bsVvM= -github.com/kalafut/m2j v0.0.0-20200831013012-43edf17eb155/go.mod h1:1tGqsPGFpUsjWhUlxSWTVClcP0spd4hQpA/lRPiAHIc= -github.com/kalafut/m2j v0.0.1 h1:07N2GRuQhm+tpUKRDiGYVGoEI0TgmlYsOyLjgUQGnis= -github.com/kalafut/m2j v0.0.1/go.mod h1:1tGqsPGFpUsjWhUlxSWTVClcP0spd4hQpA/lRPiAHIc= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= diff --git a/main.go b/main.go index 41c0b68..85762ea 100644 --- a/main.go +++ b/main.go @@ -9,8 +9,6 @@ import ( "net/url" "os" - "github.com/kalafut/m2j" - "github.com/tomhjp/gh-action-jira/config" "github.com/tomhjp/gh-action-jira/jira" ) @@ -107,7 +105,7 @@ func constructPayload(project, issueType, summary, description string, extraFiel issueType, }, "summary": summary, - "description": m2j.MDToJira(description), + "description": description, }, } for key, value := range extraFields { diff --git a/main_test.go b/main_test.go index 8e15ed1..a486f0f 100644 --- a/main_test.go +++ b/main_test.go @@ -9,7 +9,7 @@ import ( func TestConstructPayload(t *testing.T) { const expectedJSON = `{"fields":{"custom_field":[{"name":"foo"}],"description":"The description with some {{code}}","foo":"bar","issuetype":{"name":"Bug"},"project":{"key":"FOO"},"summary":"The summary"}}` - reqBody, err := json.Marshal(constructPayload("FOO", "Bug", "The summary", "The description with some `code`", map[string]interface{}{ + reqBody, err := json.Marshal(constructPayload("FOO", "Bug", "The summary", "The description with some {{code}}", map[string]interface{}{ "foo": "bar", "custom_field": []map[string]string{{"name": "foo"}}, }))