Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for co-authors #65

Open
devinturner opened this issue Feb 18, 2025 · 0 comments
Open

Add support for co-authors #65

devinturner opened this issue Feb 18, 2025 · 0 comments

Comments

@devinturner
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant