@@ -45,7 +45,7 @@ func writeChangelog(issues []*github.Issue, outputFile *os.File) error {
45
45
if err != nil {
46
46
return err
47
47
}
48
- result := fmt .Sprintf ("# Changelog\n \n There is **%d new closed issues** in gnolang/gno since %s\n \n %s" , len (issues ), opts .since , markdownTable )
48
+ result := fmt .Sprintf ("# Changelog ⚙️ \n \n There is **%d new closed issues** in gnolang/gno since %s\n \n %s" , len (issues ), opts .since , markdownTable )
49
49
50
50
_ , err = outputFile .WriteString (result )
51
51
if err != nil {
@@ -66,7 +66,7 @@ func writeBacklog(issues []*github.Issue, outputFile *os.File) error {
66
66
if err != nil {
67
67
return err
68
68
}
69
- result := fmt .Sprintf ("# Backlog\n \n There is **%d new open issues** in gnolang/gno since %s\n \n %s" , len (issues ), opts .since , markdownTable )
69
+ result := fmt .Sprintf ("# Backlog 💡 \n \n There is **%d new open issues** in gnolang/gno since %s\n \n %s" , len (issues ), opts .since , markdownTable )
70
70
71
71
_ , err = outputFile .WriteString (result )
72
72
if err != nil {
@@ -75,19 +75,33 @@ func writeBacklog(issues []*github.Issue, outputFile *os.File) error {
75
75
return nil
76
76
}
77
77
78
- func writeCuration (issues []* github.Issue , outputFile * os.File ) error {
79
- var issuesTable [][]string
78
+ func writeCuration (issues []* github.Issue , pullRequests []* github.PullRequest , commits []* github.RepositoryCommit , outputFile * os.File ) error {
79
+ // Format at Markdown format
80
+ var issuesRows [][]string
80
81
for _ , issue := range issues {
81
- issuesTable = append (issuesTable , []string {issue .GetTitle (), issue .GetURL (), issue .GetUser ().GetLogin ()})
82
+ issuesRows = append (issuesRows , []string {issue .GetTitle (), issue .GetURL (), issue .GetUser ().GetLogin ()})
83
+ }
84
+ issuesTable , err := markdown .NewTableFormatterBuilder ().
85
+ Build ("Title" , "Link to issue" , "Author" ).
86
+ Format (issuesRows )
87
+ if err != nil {
88
+ return err
82
89
}
90
+ result := fmt .Sprintf ("# Curation 📚\n \n ## New issues\n There is **%d new issues** in gnolang/awesome-gno since %s\n \n %s" , len (issues ), opts .since , issuesTable )
83
91
84
- markdownTable , err := markdown .NewTableFormatterBuilder ().
85
- Build ("Title" , "Link to Body" , "Assignee" ).
86
- Format (issuesTable )
92
+ var pullRequestRows [][]string
93
+ for _ , pr := range pullRequests {
94
+ pullRequestRows = append (pullRequestRows , []string {pr .GetTitle (), pr .GetURL (), pr .GetUser ().GetLogin ()})
95
+ }
96
+ pullRequestsTable , err := markdown .NewTableFormatterBuilder ().
97
+ Build ("Title" , "Link to PR" , "Author" ).
98
+ Format (pullRequestRows )
87
99
if err != nil {
88
100
return err
89
101
}
90
- result := fmt .Sprintf ("# Curation\n \n There is **%d new issues** in gnolang/awesome-gno since %s\n \n %s" , len (issues ), opts .since , markdownTable )
102
+ result += fmt .Sprintf ("\n \n ## New PR\n There is **%d new PR** in gnolang/awesome-gno since %s\n \n %s" , len (pullRequests ), opts .since , pullRequestsTable )
103
+
104
+ result += fmt .Sprintf ("\n \n ## New commits\n There is **%d new commits** in gnolang/awesome-gno since %s\n \n " , len (commits ), opts .since )
91
105
92
106
_ , err = outputFile .WriteString (result )
93
107
if err != nil {
@@ -98,7 +112,7 @@ func writeCuration(issues []*github.Issue, outputFile *os.File) error {
98
112
99
113
func writeTips (data string , outputFile * os.File ) error {
100
114
// Format at Markdown format
101
- var table [][]string
115
+ var rows [][]string
102
116
var tweets TweetSearch
103
117
authors := make (map [string ]string )
104
118
@@ -107,17 +121,17 @@ func writeTips(data string, outputFile *os.File) error {
107
121
authors [user .Id ] = user .Username
108
122
}
109
123
for _ , tweet := range tweets .Data {
110
- table = append (table , []string {authors [tweet .AuthorId ], strings .Replace (tweet .Text , "\n " , " " , - 1 ), tweet .CreatedAt })
124
+ rows = append (rows , []string {authors [tweet .AuthorId ], strings .Replace (tweet .Text , "\n " , " " , - 1 ), tweet .CreatedAt })
111
125
}
112
126
113
127
//Maybe build our own table formatter
114
- markdownTable , err := markdown .NewTableFormatterBuilder ().
128
+ table , err := markdown .NewTableFormatterBuilder ().
115
129
Build ("Author" , "Text" , "Created at" ).
116
- Format (table )
130
+ Format (rows )
117
131
if err != nil {
118
132
return err
119
133
}
120
- result := fmt .Sprintf ("# Tips\n \n There is **%d new tweet** about gnotips since %s\n \n %s" , tweets .Meta .ResultCount , opts .since , markdownTable )
134
+ result := fmt .Sprintf ("# Tips 🐦 \n \n ## New Tweets with #gnotips \ n There is **%d new tweet** about gnotips since %s\n \n %s" , tweets .Meta .ResultCount , opts .since , table )
121
135
122
136
_ , err = outputFile .WriteString (result )
123
137
if err != nil {
0 commit comments