mirror of
https://github.com/cypress-io/cypress.git
synced 2026-01-01 03:59:57 -06:00
Co-authored-by: cypress-bot[bot] <2f0651858c6e38e0+cypress-bot[bot]@users.noreply.github.com> Co-authored-by: Ryan Manuel <ryanm@cypress.io> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
25 lines
586 B
JavaScript
25 lines
586 B
JavaScript
const createPullRequest = async ({ context, github, baseBranch, branchName, description, body, reviewers }) => {
|
|
const { data: { number } } = await github.pulls.create({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
base: baseBranch,
|
|
head: branchName,
|
|
title: `chore: ${description}`,
|
|
body,
|
|
maintainer_can_modify: true,
|
|
})
|
|
|
|
if (reviewers) {
|
|
await github.pulls.requestReviewers({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
pull_number: number,
|
|
reviewers,
|
|
})
|
|
}
|
|
}
|
|
|
|
module.exports = {
|
|
createPullRequest,
|
|
}
|