From 7b9a79b311b8049b0453682a6705b8acb0c050c6 Mon Sep 17 00:00:00 2001 From: Riddhesh Sanghvi Date: Thu, 3 Dec 2020 19:39:43 +0530 Subject: [PATCH] Improve Actions URL formatting Signed-off-by: Riddhesh Sanghvi --- main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index f7605e7..ff48b40 100644 --- a/main.go +++ b/main.go @@ -63,6 +63,9 @@ func main() { fmt.Fprintln(os.Stderr, "Message is required") os.Exit(1) } + if strings.HasPrefix(os.Getenv("GITHUB_WORKFLOW"), ".github") { + os.Setenv("GITHUB_WORKFLOW", "Link to action run") + } minimal := os.Getenv(EnvMinimal) fields := []Field{} @@ -108,7 +111,7 @@ func main() { field := []Field{ { Title: "Actions URL", - Value: "https://github.com/" + os.Getenv("GITHUB_REPOSITORY") + "/commit/" + os.Getenv("GITHUB_SHA") + "/checks", + Value: "", Short: false, }, } @@ -129,7 +132,7 @@ func main() { }, { Title: "Actions URL", - Value: "https://github.com/" + os.Getenv("GITHUB_REPOSITORY") + "/commit/" + os.Getenv("GITHUB_SHA") + "/checks", + Value: "", Short: false, }, {