Skip to content

Commit 2173622

Browse files
authored
feat: Get server url from github context (#19)
fixes: #17
1 parent 12405cb commit 2173622

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const (
4040
githubContextEventKey = "event"
4141
githubContextEventURLKey = "html_url"
4242
githubEventContenntCreatedAtKey = "created_at"
43+
githubContextServerURLKey = "server_url"
4344
)
4445

4546
const (
@@ -238,7 +239,7 @@ func generateMessageBodyContent(ghJSON, jobJSON map[string]any, currentTimeStamp
238239
// The key for getting timestamp is different in differnet triggering event
239240
// a simple work around is using the new timestamp.
240241
timestamp: currentTimeStamp.UTC().Format(time.RFC3339),
241-
clickURL: fmt.Sprintf("https://github.com/%s/actions/runs/%s", getMapFieldStringValue(ghJSON, githubContextRepositoryKey), getMapFieldStringValue(ghJSON, "run_id")),
242+
clickURL: fmt.Sprintf("%s/%s/actions/runs/%s", getMapFieldStringValue(ghJSON, githubContextServerURLKey), getMapFieldStringValue(ghJSON, githubContextRepositoryKey), getMapFieldStringValue(ghJSON, "run_id")),
242243
eventName: "workflow",
243244
repo: getMapFieldStringValue(ghJSON, githubContextRepositoryKey),
244245
}

0 commit comments

Comments
 (0)