mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-11 17:00:22 +00:00
* fix(ci): reduce flaky failures and PR runtime * fix(ci): avoid label scope failures * fix(ci): tolerate GitHub download outages * fix(ci): cover packaged inputs in PR triggers * fix(ci): keep test-only changes out of package builds * perf(ci): reuse unchanged ET PR builds * fix: address Codex review on PR #2474 * fix(ci): harden automation PR handoffs * fix(ci): preserve reused implementation branches * fix(ci): deduplicate automation follow-ups * fix(ci): deduplicate automation follow-ups * fix(ci): ignore remapped stale Codex findings * fix(ci): use the established handoff label * fix(ci): isolate manual package validations * fix(ci): refresh existing Nix metadata PRs * fix(ci): hand off divergent implementation branches * fix(ci): serialize Homebrew tap updates --------- Co-authored-by: netcatty-bot <308658023+netcatty-bot@users.noreply.github.com>
51 lines
1.4 KiB
YAML
51 lines
1.4 KiB
YAML
name: spam-comments
|
|
|
|
on:
|
|
issue_comment:
|
|
types: [created]
|
|
|
|
permissions:
|
|
contents: read
|
|
issues: write
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
delete-spam:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout filter rules
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Delete suspected malware spam
|
|
uses: actions/github-script@v9
|
|
with:
|
|
script: |
|
|
const path = require('node:path');
|
|
const { detectSpamComment } = require(
|
|
path.join(process.env.GITHUB_WORKSPACE, 'scripts/spam-comment-filter.cjs')
|
|
);
|
|
|
|
const comment = context.payload.comment;
|
|
const result = detectSpamComment({
|
|
body: comment.body || '',
|
|
authorAssociation: comment.author_association,
|
|
userType: comment.user && comment.user.type,
|
|
});
|
|
|
|
core.info(JSON.stringify(result, null, 2));
|
|
|
|
if (!result.spam) {
|
|
core.info('Comment did not match the zip/dangerous-file spam filter.');
|
|
return;
|
|
}
|
|
|
|
await github.rest.issues.deleteComment({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
comment_id: comment.id,
|
|
});
|
|
|
|
core.notice(
|
|
`Deleted comment with zip/dangerous attachment by @${comment.user.login} on #${context.payload.issue.number}: ${result.reasons.join('; ')}`
|
|
);
|