zed/.github/workflows/delete_comments.yml
jvmncs 3ddec4816a
Remove block step from delete comments workflow (#16910)
The block step wasn't working, and it also appears that most of these
spam comments are coming from compromised accounts, so I think just
deleting the comments is okay for now.

Release Notes:

- N/A
2024-08-26 14:47:38 -04:00

34 lines
971 B
YAML

name: Delete Mediafire Comments
on:
issue_comment:
types: [created]
permissions:
issues: write
jobs:
delete_comment:
runs-on: ubuntu-latest
steps:
- name: Check for specific strings in comment
id: check_comment
uses: actions/github-script@v7
with:
script: |
const comment = context.payload.comment.body;
const triggerStrings = ['www.mediafire.com'];
return triggerStrings.some(triggerString => comment.includes(triggerString));
- name: Delete comment if it contains any of the specific strings
if: steps.check_comment.outputs.result == 'true'
uses: actions/github-script@v7
with:
script: |
const commentId = context.payload.comment.id;
await github.rest.issues.deleteComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: commentId
});