forked from milvus-io/milvus
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enhance: add GitHub Actions to delete spam issues comments (milvus-io…
…#35807) /kind improvement Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
- Loading branch information
1 parent
b0ac04d
commit e34b0c4
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# via https://github.com/zed-industries/zed/blob/main/.github/workflows/delete_comments.yml | ||
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@60a0d83039c74a4aee543508d2ffcb1c3799cdea # 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@60a0d83039c74a4aee543508d2ffcb1c3799cdea # 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 | ||
}); |