refactor: add require-permission default (#51)

This commit is contained in:
xrkffgg
2021-01-26 22:59:37 +08:00
committed by GitHub
parent eb91801d3e
commit b0e25793f1
6 changed files with 28 additions and 32 deletions

22
dist/index.js vendored
View File

@@ -8020,7 +8020,7 @@ async function doMarkDuplicate(owner, repo, labels) {
const duplicateLabels = core.getInput('duplicate-labels');
const removeLables = core.getInput('remove-labels');
const closeIssue = core.getInput('close-issue');
const requirePermission = core.getInput('require-permission');
const requirePermission = core.getInput('require-permission') || 'write';
const commentId = context.payload.comment.id;
const commentBody = context.payload.comment.body;
@@ -8029,17 +8029,15 @@ async function doMarkDuplicate(owner, repo, labels) {
const ifCommandInput = !!duplicateCommand;
if (requirePermission) {
const res = await octokit.repos.getCollaboratorPermissionLevel({
owner,
repo,
username: commentUser,
});
const { permission } = res.data;
if (!checkPermission(requirePermission, permission)) {
core.info(`The user ${commentUser} is not allow!`);
return false;
}
const res = await octokit.repos.getCollaboratorPermissionLevel({
owner,
repo,
username: commentUser,
});
const { permission } = res.data;
if (!checkPermission(requirePermission, permission)) {
core.info(`The user ${commentUser} is not allow!`);
return false;
}
if (