Skip to content

Commit 9835fb3

Browse files
feat(reporting): add embed link to repository into report
1 parent 6600605 commit 9835fb3

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

reporting/output.go

+11-8
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ import (
99
"strings"
1010
)
1111

12+
const awesomeGnoEmbedURL = "**[gnolang/awesome-Gno](https://github.com/gnolang/awesome-gno)**"
13+
const gnoEmbedURL = "**[gnolang/gno](https://github.com/gnolang/gno)**"
14+
1215
func createOutputFile() (*os.File, error) {
1316
if _, err := os.Stat(opts.outputPath); os.IsNotExist(err) {
1417
err = os.MkdirAll(opts.outputPath, os.ModePerm)
@@ -36,7 +39,7 @@ func writeChangelog(issues []*github.Issue, pullRequests []*github.PullRequest,
3639
if err != nil {
3740
return err
3841
}
39-
result := fmt.Sprintf("# Changelog ⚙️\n\nThere is **%d new closed issues** in gnolang/gno since %s\n\n%s", len(issues), opts.since, markdownTable)
42+
result := fmt.Sprintf("# Changelog ⚙️\n\nThere is **%d new closed issues** in %s since %s\n\n%s", len(issues), gnoEmbedURL, opts.since, markdownTable)
4043

4144
var pullRequestRows [][]string
4245
for _, pr := range pullRequests {
@@ -48,9 +51,9 @@ func writeChangelog(issues []*github.Issue, pullRequests []*github.PullRequest,
4851
if err != nil {
4952
return err
5053
}
51-
result += fmt.Sprintf("\n\n## New PR\nThere is **%d new closed PR** in gnolang/awesome-gno since %s\n\n%s", len(pullRequests), opts.since, pullRequestsTable)
54+
result += fmt.Sprintf("\n\n## New PR\nThere is **%d new closed PR** in %s since %s\n\n%s", len(pullRequests), gnoEmbedURL, opts.since, pullRequestsTable)
5255

53-
result += fmt.Sprintf("\n\n## New commits\nThere is **%d new commits** in gnolang/awesome-gno since %s\n\n", len(commits), opts.since)
56+
result += fmt.Sprintf("\n\n## New commits\nThere is **%d new commits** in %s since %s\n\n", len(commits), gnoEmbedURL, opts.since)
5457

5558
_, err = outputFile.WriteString(result)
5659
if err != nil {
@@ -72,7 +75,7 @@ func writeBacklog(issues []*github.Issue, pullRequests []*github.PullRequest, ou
7275
if err != nil {
7376
return err
7477
}
75-
result := fmt.Sprintf("# Backlog 💡\n\nThere is **%d new open issues** in gnolang/gno since %s\n\n%s", len(issues), opts.since, markdownTable)
78+
result := fmt.Sprintf("# Backlog 💡\n\nThere is **%d new open issues** in %s since %s\n\n%s", len(issues), gnoEmbedURL, opts.since, markdownTable)
7679

7780
var pullRequestRows [][]string
7881
for _, pr := range pullRequests {
@@ -84,7 +87,7 @@ func writeBacklog(issues []*github.Issue, pullRequests []*github.PullRequest, ou
8487
if err != nil {
8588
return err
8689
}
87-
result += fmt.Sprintf("\n\n## New PR\nThere is **%d new open PR** in gnolang/gno since %s\n\n%s", len(pullRequests), opts.since, pullRequestsTable)
90+
result += fmt.Sprintf("\n\n## New PR\nThere is **%d new open PR** in %s since %s\n\n%s", len(pullRequests), gnoEmbedURL, opts.since, pullRequestsTable)
8891

8992
_, err = outputFile.WriteString(result)
9093
if err != nil {
@@ -106,7 +109,7 @@ func writeCuration(issues []*github.Issue, pullRequests []*github.PullRequest, c
106109
if err != nil {
107110
return err
108111
}
109-
result := fmt.Sprintf("# Curation 📚\n\n## New issues\nThere is **%d updated issues** in gnolang/awesome-gno since %s\n\n%s", len(issues), opts.since, issuesTable)
112+
result := fmt.Sprintf("# Curation 📚\n\n## New issues\nThere is **%d updated issues** in %s since %s\n\n%s", len(issues), awesomeGnoEmbedURL, opts.since, issuesTable)
110113

111114
var pullRequestRows [][]string
112115
for _, pr := range pullRequests {
@@ -118,9 +121,9 @@ func writeCuration(issues []*github.Issue, pullRequests []*github.PullRequest, c
118121
if err != nil {
119122
return err
120123
}
121-
result += fmt.Sprintf("\n\n## New PR\nThere is **%d updated PR** in gnolang/awesome-gno since %s\n\n%s", len(pullRequests), opts.since, pullRequestsTable)
124+
result += fmt.Sprintf("\n\n## New PR\nThere is **%d updated PR** in %s since %s\n\n%s", len(pullRequests), awesomeGnoEmbedURL, opts.since, pullRequestsTable)
122125

123-
result += fmt.Sprintf("\n\n## New commits\nThere is **%d new commits** in gnolang/awesome-gno since %s\n\n", len(commits), opts.since)
126+
result += fmt.Sprintf("\n\n## New commits\nThere is **%d new commits** in %s since %s\n\n", len(commits), awesomeGnoEmbedURL, opts.since)
124127

125128
_, err = outputFile.WriteString(result)
126129
if err != nil {

0 commit comments

Comments
 (0)