Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
270 changes: 0 additions & 270 deletions .github/workflows/anti-spam-comment-moderator.yml

This file was deleted.

51 changes: 51 additions & 0 deletions .github/workflows/anti-spam-filter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Anti-Spam Filter (Hidden Logic)

on:
issues:
types: [opened, edited]
pull_request:
types: [opened, edited]
issue_comment:
types: [created, edited]
pull_request_review_comment:
types: [created, edited]

permissions:
issues: write
pull-requests: write
contents: write

jobs:
moderate:
if: ${{ github.event.action == 'created' || github.event.action == 'edited' || github.event.action == 'opened' }}
runs-on: ubuntu-latest
steps:
- name: Run spam filter
uses: actions/github-script@v7
env:
# The entire spam detection logic is stored here
SPAM_DETECTION_SCRIPT: ${{ secrets.SPAM_DETECTION_SCRIPT }}
with:
script: |
// Load and execute the spam detection script from secret
const detectionScript = process.env.SPAM_DETECTION_SCRIPT;
if (!detectionScript) {
core.error("SPAM_DETECTION_SCRIPT secret not found!");
core.setFailed("Spam filter not configured");
return;
}
try {
// Execute the hidden script
// The script has access to: github, context, core
const detectSpam = eval(detectionScript);
// Run the detection
await detectSpam(github, context, core);
} catch (err) {
core.error(`Spam filter error: ${err.message}`);
core.setFailed(`Filter execution failed: ${err.message}`);
}
Loading
Loading