2024-08-26 15:37:22 +00:00
|
|
|
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
|
2024-08-28 19:42:31 +00:00
|
|
|
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
|
2024-08-26 15:37:22 +00:00
|
|
|
with:
|
|
|
|
script: |
|
|
|
|
const comment = context.payload.comment.body;
|
2024-08-26 17:38:05 +00:00
|
|
|
const triggerStrings = ['www.mediafire.com'];
|
2024-08-26 15:37:22 +00:00
|
|
|
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'
|
2024-08-28 19:42:31 +00:00
|
|
|
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
|
2024-08-26 15:37:22 +00:00
|
|
|
with:
|
|
|
|
script: |
|
|
|
|
const commentId = context.payload.comment.id;
|
2024-08-26 16:54:52 +00:00
|
|
|
await github.rest.issues.deleteComment({
|
2024-08-26 15:37:22 +00:00
|
|
|
owner: context.repo.owner,
|
|
|
|
repo: context.repo.repo,
|
|
|
|
comment_id: commentId
|
|
|
|
});
|