Skip to content

Commit

Permalink
Add commit details in message
Browse files Browse the repository at this point in the history
Signed-off-by: Riddhesh Sanghvi <riddhesh237@gmail.com>
  • Loading branch information
mrrobot47 committed Dec 8, 2020
1 parent 1304fe5 commit 2f5e48a
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ func main() {
os.Setenv("GITHUB_WORKFLOW", "Link to action run")
}

long_sha := os.Getenv("GITHUB_SHA")
commit_sha := long_sha[0:6]

minimal := os.Getenv(EnvMinimal)
fields := []Field{}
if minimal == "true" {
Expand Down Expand Up @@ -112,7 +115,16 @@ func main() {
{
Title: "Actions URL",
Value: "<https://github.com/" + os.Getenv("GITHUB_REPOSITORY") + "/commit/" + os.Getenv("GITHUB_SHA") + "/checks|" + os.Getenv("GITHUB_WORKFLOW") + ">",
Short: false,
Short: true,
},
}
mainFields = append(field, mainFields...)
case "commit":
field := []Field{
{
Title: "Commit",
Value: "<https://github.com/" + os.Getenv("GITHUB_REPOSITORY") + "/commit/" + os.Getenv("GITHUB_SHA") + "|" + commit_sha + ">",
Short: true,
},
}
mainFields = append(field, mainFields...)
Expand All @@ -133,7 +145,12 @@ func main() {
{
Title: "Actions URL",
Value: "<https://github.com/" + os.Getenv("GITHUB_REPOSITORY") + "/commit/" + os.Getenv("GITHUB_SHA") + "/checks|" + os.Getenv("GITHUB_WORKFLOW") + ">",
Short: false,
Short: true,
},
{
Title: "Commit",
Value: "<https://github.com/" + os.Getenv("GITHUB_REPOSITORY") + "/commit/" + os.Getenv("GITHUB_SHA") + "|" + commit_sha + ">",
Short: true,
},
{
Title: os.Getenv(EnvSlackTitle),
Expand Down

0 comments on commit 2f5e48a

Please sign in to comment.