mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-27 02:48:34 +00:00
Relax comment restrictions in delete_comments action (#16899)
The script no longer triggers on harmless words like "Download". Release Notes: - N/A
This commit is contained in:
parent
635e7f6480
commit
eb0a01e9cb
1 changed files with 6 additions and 5 deletions
11
.github/workflows/delete_comments.yml
vendored
11
.github/workflows/delete_comments.yml
vendored
|
@ -17,7 +17,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const comment = context.payload.comment.body;
|
const comment = context.payload.comment.body;
|
||||||
const triggerStrings = ['www.mediafire.com', 'Download', 'changeme'];
|
const triggerStrings = ['www.mediafire.com'];
|
||||||
return triggerStrings.some(triggerString => comment.includes(triggerString));
|
return triggerStrings.some(triggerString => comment.includes(triggerString));
|
||||||
|
|
||||||
- name: Delete comment if it contains any of the specific strings
|
- name: Delete comment if it contains any of the specific strings
|
||||||
|
@ -37,8 +37,9 @@ jobs:
|
||||||
uses: actions/github-script@v7
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const username = context.payload.comment.user.login;
|
const userId = context.payload.comment.user.id;
|
||||||
await github.rest.orgs.blockUser({
|
await github.rest.users.block({
|
||||||
org: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
username: username
|
repo: context.repo.repo,
|
||||||
|
user_id: userId
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue