Skip to content

Spam Detection

Spam Detection #794

Workflow file for this run

name: Spam Detection
on:
schedule:
- cron: '4-59/10 * * * *' # run every ten minutes, starting at 4 minutes past the hour
workflow_dispatch: # allow manual trigger
jobs:
scanning-spam:
environment: ${{ github.ref == 'refs/heads/master' && 'production' || 'staging' }}
runs-on: ubuntu-latest
steps:
- name: Setup environment variable
run: |
if [ "${{ github.ref }}" == "refs/heads/master" ]; then
echo "CURRENT_ENV=production" >> $GITHUB_ENV
else
echo "CURRENT_ENV=staging" >> $GITHUB_ENV
fi
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- run: npm i
- name: Detect and create takedown PR
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
GITHUBAPP_PRIVATE_KEY_BASE64: ${{ secrets.GITHUBAPP_PRIVATE_KEY_BASE64 }}
GITHUBAPP_ID: ${{ secrets.GITHUBAPP_ID }}
GITHUBAPP_INSTALLATION_ID: ${{ secrets.GITHUBAPP_INSTALLATION_ID }}
COFACTS_URL: ${{ vars.COFACTS_URL }}
COFACTS_API_URL: ${{ vars.COFACTS_API_URL }}
LAST_SCANNED_AT: ${{ vars.LAST_SCANNED_AT }}
LANGFUSE_BASEURL: ${{ vars.LANGFUSE_BASEURL }}
LANGFUSE_PUBLIC_KEY: ${{ secrets.LANGFUSE_PUBLIC_KEY }}
LANGFUSE_SECRET_KEY: ${{ secrets.LANGFUSE_SECRET_KEY }}
ENV: ${{ env.CURRENT_ENV }}
run: npm run takedown