File tree Expand file tree Collapse file tree 2 files changed +3
-15
lines changed
Expand file tree Collapse file tree 2 files changed +3
-15
lines changed Original file line number Diff line number Diff line change 11import name from './name.js' ;
22
3- export default function commit ( repo , payload , index = 0 ) {
4- if ( ! payload . commits ) {
5- console . log ( { repo, payload } ) ;
6- }
7-
8- const commit = [ ...payload . commits ] . reverse ( ) [ index ] ;
9-
10- return `\n [${ commit . message . match ( / ^ .* / g) [ 0 ] } ](https://github.com/${ repo . name } /commit/${ commit . sha } )\n into${ name ( repo . name ) } ` ;
3+ export default function commit ( repo , payload ) {
4+ // TODO: Find out a new way to get the commit name
5+ return `\n [commit](https://github.com/${ repo . name } /commit/${ payload . head } )\n into${ name ( repo . name ) } ` ;
116}
Original file line number Diff line number Diff line change 11import commit from './commit.js' ;
2- import time from './time.js' ;
32
43// https://docs.github.com/en/developers/webhooks-and-events/github-event-types#pushevent
54export default function writePushEvent ( event ) {
6- console . log ( { event } ) ;
7-
85 let markdown = `📌 pushed${ commit ( event . repo , event . payload ) } ` ;
9- for ( let index = 1 ; index < event . payload . commits . length ; index ++ ) {
10- markdown += `\n- \`${ time ( new Date ( event . created_at ) ) } \`\n ` ;
11- markdown += `📌 pushed${ commit ( event . repo , event . payload , index ) } ` ;
12- }
136
147 return markdown ;
158}
You can’t perform that action at this time.
0 commit comments