diff --git a/.github/workflows/delete-comments.yml b/.github/workflows/delete-comments.yml index e5319d0725622..d766665ced333 100644 --- a/.github/workflows/delete-comments.yml +++ b/.github/workflows/delete-comments.yml @@ -17,7 +17,7 @@ jobs: with: script: | const comment = context.payload.comment.body; - const triggerStrings = ['www.mediafire.com', 'Download']; + const triggerStrings = ['www.mediafire.com']; return triggerStrings.some(triggerString => comment.includes(triggerString)); - name: Delete comment if it contains any of the specific strings @@ -26,20 +26,19 @@ jobs: with: script: | const commentId = context.payload.comment.id; - await github.issues.deleteComment({ + await github.rest.issues.deleteComment({ owner: context.repo.owner, repo: context.repo.repo, comment_id: commentId }); - - name: Block user if comment contains any of the specific strings + - name: Block user from the org if their comment contained any of the banned strings if: steps.check_comment.outputs.result == 'true' uses: actions/github-script@v7 with: script: | - const userId = context.payload.comment.user.id; - await github.users.block({ - owner: context.repo.owner, - repo: context.repo.repo, - user_id: userId + const username = context.payload.comment.user.login + await github.rest.orgs.blockUser({ + org: context.repo.owner, + username: username });