Created
December 20, 2017 01:04
-
-
Save henry40408/51ec29798ac2092a9dc37f539fca6e0f to your computer and use it in GitHub Desktop.
jiminycricket/pr-review-submit-unassign
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/jiminycricket/pr-review-submit-unassign/blob/5b3bf2e64c6417919d53c4966f50d5c8bb97e91e/index.js#L21-L46 | |
let comment = '' | |
if (config.unassignReviewer) { | |
const params = context.issue({ body: { assignees: [reviwer] } }) | |
await github.issues.removeAssigneesFromIssue(params) | |
comment += config.unassignTemplate.replace('{reviwer}', reviwer) | |
} | |
if (config.assignPullRequestOwner) { | |
const params = context.issue({ assignees: [pullRequestOwner] }) | |
await github.issues.addAssigneesToIssue(params) | |
if (config.unassignReviewer) { | |
comment += ', ' | |
} | |
comment += config.assignTemplate.replace( | |
'{pullRequestOwner}', | |
pullRequestOwner | |
) | |
} | |
if (config.leaveComment) { | |
const commentParams = context.issue({ body: comment }) | |
await github.issues.createComment(commentParams) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment