reponame-fix
This commit is contained in:
parent
8d0d02f8cd
commit
531cec1c54
|
@ -61,8 +61,7 @@ const formatCommit = (commit, repoUrl) => {
|
||||||
*/
|
*/
|
||||||
const formatMessage = (data, commits) => {
|
const formatMessage = (data, commits) => {
|
||||||
const repoUrl = data.repository.html_url || data.repository.url
|
const repoUrl = data.repository.html_url || data.repository.url
|
||||||
// const repoName = data.repository.full_name
|
const repoName = data.repository.name.split('/').pop()
|
||||||
const repoId = data.repository.id
|
|
||||||
const branch = data.ref.split('/').pop()
|
const branch = data.ref.split('/').pop()
|
||||||
const branchUrl = `${repoUrl}/tree/${branch}`
|
const branchUrl = `${repoUrl}/tree/${branch}`
|
||||||
|
|
||||||
|
@ -74,7 +73,7 @@ const formatMessage = (data, commits) => {
|
||||||
const stats = formatStats(totalStats)
|
const stats = formatStats(totalStats)
|
||||||
|
|
||||||
return [
|
return [
|
||||||
`🔄 [${repoId}](${repoUrl}):[${branch}](${branchUrl}) ${commits.length} new commit${Array.from(commits.length.toString()).pop() === '1' ? '' : 's'}`,
|
`🔄 [${repoName}](${repoUrl}):[${branch}](${branchUrl}) ${commits.length} new commit${Array.from(commits.length.toString()).pop() === '1' ? '' : 's'}`,
|
||||||
stats && commits.length > 1 ? `📊 ${stats}` : '',
|
stats && commits.length > 1 ? `📊 ${stats}` : '',
|
||||||
commits.map(commit => formatCommit(commit, repoUrl)).join('\n')
|
commits.map(commit => formatCommit(commit, repoUrl)).join('\n')
|
||||||
].filter(Boolean).join('\n')
|
].filter(Boolean).join('\n')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user