Skip to content

Commit

Permalink
Improve Actions URL formatting
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 3, 2020
1 parent ecc1353 commit 7b9a79b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down Expand Up @@ -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: "<https://github.com/" + os.Getenv("GITHUB_REPOSITORY") + "/commit/" + os.Getenv("GITHUB_SHA") + "/checks|" + os.Getenv("GITHUB_WORKFLOW") + ">",
Short: false,
},
}
Expand All @@ -129,7 +132,7 @@ func main() {
},
{
Title: "Actions URL",
Value: "https://github.com/" + os.Getenv("GITHUB_REPOSITORY") + "/commit/" + os.Getenv("GITHUB_SHA") + "/checks",
Value: "<https://github.com/" + os.Getenv("GITHUB_REPOSITORY") + "/commit/" + os.Getenv("GITHUB_SHA") + "/checks|" + os.Getenv("GITHUB_WORKFLOW") + ">",
Short: false,
},
{
Expand Down

0 comments on commit 7b9a79b

Please sign in to comment.