Skip to content

Add support for co-authors #65

@devinturner

Description

@devinturner

It appears that when building the authorLine, it does not include any co-authors if applicable.

function buildSubject ({ writeToFile, subject, author, authorUrl, owner, repo }) {
const hasPR = rePrEnding.test(subject)
const prs = []
let output = subject
if (writeToFile) {
const authorLine = author ? ` by [@${author}](${authorUrl})` : ''
if (hasPR) {
const prMatch = subject.match(rePrEnding)
const msgOnly = subject.slice(0, prMatch[0].length * -1)
output = msgOnly.replace(rePrId, (m, prId) => {
prs.push(prId)
return `[#${prId}](${githubServerUrl}/${owner}/${repo}/pull/${prId})`
})
output += `*(PR [#${prMatch[1]}](${githubServerUrl}/${owner}/${repo}/pull/${prMatch[1]})${authorLine})*`
} else {
output = subject.replace(rePrId, (m, prId) => {
return `[#${prId}](${githubServerUrl}/${owner}/${repo}/pull/${prId})`
})
if (author) {
output += ` *(commit by [@${author}](${authorUrl}))*`
}
}
} else {
if (hasPR) {
output = subject.replace(rePrEnding, (m, prId) => {
prs.push(prId)
return author ? `*(PR #${prId} by @${author})*` : `*(PR #${prId})*`
})
} else {
output = author ? `${subject} *(commit by @${author})*` : subject
}
}
return {
output,
prs
}
}

When generating a changelog, I would like to ensure that all contributing parties are credited.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions