fred/.github/workflows/community_delete_comments.yml
Marshall Bowers bda269059b
ci: Restrict more jobs to only run in the zed-industries organization (#23803)
This PR updates the GitHub Action definitions to restrict more CI jobs
to only run in the `zed-industries` organization (and thus, not on
forks).

Release Notes:

- N/A
2025-01-28 21:30:42 +00:00

35 lines
1.1 KiB
YAML

name: Delete Mediafire Comments
on:
issue_comment:
types: [created]
permissions:
issues: write
jobs:
delete_comment:
if: github.repository_owner == 'zed-industries'
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
});