From 7bff836cc2e7296fe0adefd2045a130da590a16f Mon Sep 17 00:00:00 2001 From: Christoph Sassenberg Date: Sun, 14 Jan 2018 10:19:47 +0100 Subject: [PATCH] Rename generated file back to commit_sha --- README.md | 2 +- in_command.go | 2 +- in_command_test.go | 10 +++++----- metadata.go | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index e6ab410..beb1d09 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ Also creates the following files: * `tag` containing the git tag name of the release being fetched. * `version` containing the version determined by the git tag of the release being fetched. * `body` containing the body text of the release. -* `target_commit` containing the commit SHA the tag is pointing to. +* `commit_sha` containing the commit SHA the tag is pointing to. #### Parameters diff --git a/in_command.go b/in_command.go index ec5bb59..f5f9a3d 100644 --- a/in_command.go +++ b/in_command.go @@ -62,7 +62,7 @@ func (c *InCommand) Run(destDir string, request InRequest) (InResponse, error) { return InResponse{}, err } - commitPath := filepath.Join(destDir, "target_commit") + commitPath := filepath.Join(destDir, "commit_sha") commitSHA = c.resolveTagToCommitSHA(*foundRelease.TagName) err = ioutil.WriteFile(commitPath, []byte(commitSHA), 0644) if err != nil { diff --git a/in_command_test.go b/in_command_test.go index 6e638e3..e1b0760 100644 --- a/in_command_test.go +++ b/in_command_test.go @@ -142,7 +142,7 @@ var _ = Describe("In Command", func() { resource.MetadataPair{Name: "name", Value: "release-name", URL: "http://google.com"}, resource.MetadataPair{Name: "body", Value: "*markdown*", Markdown: true}, resource.MetadataPair{Name: "tag", Value: "v0.35.0"}, - resource.MetadataPair{Name: "target_commit", Value: "f28085a4a8f744da83411f5e09fd7b1709149eee"}, + resource.MetadataPair{Name: "commit_sha", Value: "f28085a4a8f744da83411f5e09fd7b1709149eee"}, )) }) @@ -171,7 +171,7 @@ var _ = Describe("In Command", func() { Ω(err).ShouldNot(HaveOccurred()) Ω(string(contents)).Should(Equal("0.35.0")) - contents, err = ioutil.ReadFile(path.Join(destDir, "target_commit")) + contents, err = ioutil.ReadFile(path.Join(destDir, "commit_sha")) Ω(err).ShouldNot(HaveOccurred()) Ω(string(contents)).Should(Equal("f28085a4a8f744da83411f5e09fd7b1709149eee")) @@ -361,7 +361,7 @@ var _ = Describe("In Command", func() { resource.MetadataPair{Name: "name", Value: "release-name", URL: "http://google.com"}, resource.MetadataPair{Name: "body", Value: "*markdown*", Markdown: true}, resource.MetadataPair{Name: "tag", Value: "v0.35.0"}, - resource.MetadataPair{Name: "target_commit", Value: "f28085a4a8f744da83411f5e09fd7b1709149eee"}, + resource.MetadataPair{Name: "commit_sha", Value: "f28085a4a8f744da83411f5e09fd7b1709149eee"}, )) }) @@ -455,7 +455,7 @@ var _ = Describe("In Command", func() { resource.MetadataPair{Name: "name", Value: "release-name", URL: "http://google.com"}, resource.MetadataPair{Name: "body", Value: "*markdown*", Markdown: true}, resource.MetadataPair{Name: "tag", Value: "v0.35.0"}, - resource.MetadataPair{Name: "target_commit", Value: "f28085a4a8f744da83411f5e09fd7b1709149eee"}, + resource.MetadataPair{Name: "commit_sha", Value: "f28085a4a8f744da83411f5e09fd7b1709149eee"}, resource.MetadataPair{Name: "draft", Value: "true"}, )) }) @@ -500,7 +500,7 @@ var _ = Describe("In Command", func() { It("does not create the tag and version files", func() { Ω(path.Join(destDir, "tag")).ShouldNot(BeAnExistingFile()) Ω(path.Join(destDir, "version")).ShouldNot(BeAnExistingFile()) - Ω(path.Join(destDir, "target_commit")).ShouldNot(BeAnExistingFile()) + Ω(path.Join(destDir, "commit_sha")).ShouldNot(BeAnExistingFile()) }) }) diff --git a/metadata.go b/metadata.go index de0ee5e..54fb51c 100644 --- a/metadata.go +++ b/metadata.go @@ -42,7 +42,7 @@ func metadataFromRelease(release *github.RepositoryRelease, commitSHA string) [] if commitSHA != "" { metadata = append(metadata, MetadataPair{ - Name: "target_commit", + Name: "commit_sha", Value: commitSHA, }) }