From e8c6c537de56beacacfce89ad410ad95f0b7640e Mon Sep 17 00:00:00 2001 From: jvmncs <7891333+jvmncs@users.noreply.github.com> Date: Mon, 26 Aug 2024 12:54:52 -0400 Subject: [PATCH] Fix delete comments workflow (#16896) Release Notes: - N/A --- .../{delete-comments.yml => delete_comments.yml} | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) rename .github/workflows/{delete-comments.yml => delete_comments.yml} (81%) diff --git a/.github/workflows/delete-comments.yml b/.github/workflows/delete_comments.yml similarity index 81% rename from .github/workflows/delete-comments.yml rename to .github/workflows/delete_comments.yml index d861095008..c6f12e2026 100644 --- a/.github/workflows/delete-comments.yml +++ b/.github/workflows/delete_comments.yml @@ -26,7 +26,7 @@ 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 @@ -37,9 +37,8 @@ jobs: 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 });