Skip to content

Instantly share code, notes, and snippets.

@henry40408
Created December 20, 2017 01:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henry40408/51ec29798ac2092a9dc37f539fca6e0f to your computer and use it in GitHub Desktop.
Save henry40408/51ec29798ac2092a9dc37f539fca6e0f to your computer and use it in GitHub Desktop.
jiminycricket/pr-review-submit-unassign
// 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