diff --git a/README.md b/README.md index 2a49a8c..ba39bbe 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,9 @@ See [Contributing guide][contributing] for contributing to the project. ## Note for maintainers: -Assignment and Abandoning of issues doesn't work for users having permissions admin, maintainer or triage, since they already can assign themselves and also to avoid accidental assignment of the issue while explaining a contributor how to claim. +Assignment and Abandoning of issues doesn't work for users having permissions admin, maintainer or triage in public repos, since they already can assign themselves and also to avoid accidental assignment of the issue while explaining a contributor how to claim. + +But the exception is for private repos, since it becomes essential to make a normal contributor too a collaborator to allow them to access the repo and hence this safety feature may interfere with the main functionality. # Usage diff --git a/src/handlers/issue_comment.js b/src/handlers/issue_comment.js index b7f151e..cea7e7c 100644 --- a/src/handlers/issue_comment.js +++ b/src/handlers/issue_comment.js @@ -1,18 +1,17 @@ import { skipCommenters } from "../helpers/skip_commenters.js"; import getAssignedIssues from "../helpers/get_assigned_issues.js"; import { issueOrIssues, thisOrThese } from "../helpers/pluralize.js"; -import { getConfig } from "../helpers/config.js"; import { Request, checkRequest } from "../helpers/check_request.js"; import { Assignment, shouldAssign } from "../helpers/should_assign.js"; import { UnAssignment, shouldUnAssign } from "../helpers/should_unassign.js"; export default async function issueCommentHandler() { // Fetching comment - const { comment } = this.context.payload; + const { comment, repository } = this.context.payload; const commenter = comment.user.login; - // If commenter is bot or maintainer. - if (skipCommenters(commenter, this.maintainers)) return; + // If repository is pubic and commenter is bot or maintainer. + if (!repository.private && skipCommenters(commenter, this.maintainers)) return; // Get assignees of the issue const assignees = this.issue.assignees.map(