name: Issue Bot on: issues: types: [opened] jobs: Anti-slop: # Note: peakoss/anti-slop does not support the `issues` event yet (all of its # issue inputs are still commented out upstream), so the honeypot check that # the PR Bot workflow gets from the action is implemented manually here. runs-on: ubuntu-latest permissions: issues: write steps: - name: Check for honeypot token uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 with: script: | const issue = context.payload.issue; if (['OWNER', 'MEMBER', 'COLLABORATOR'].includes(issue.author_association)) { core.info('Skipping check: user is a maintainer'); return; } if (issue.user.type === 'Bot') { core.info('Skipping check: user is a bot'); return; } const haystack = `${issue.title}\n${issue.body ?? ''}`; if (!haystack.toUpperCase().includes('ASLOP-PR-VERIFY')) { core.info('Honeypot token not found'); return; } core.info('Honeypot token found, closing issue'); const common = { owner: context.repo.owner, repo: context.repo.repo, issue_number: issue.number, }; await github.rest.issues.createComment({ ...common, body: "This issue was automatically closed because it contains a marker that is only visible to " + "automated tools, which indicates it was generated by an AI agent without being disclosed as such.\n\n" + "Please see our [contributing guidelines](https://github.com/paperless-ngx/paperless-ngx/blob/main/CONTRIBUTING.md#use-of-ai-tools) " + "and [Code of Conduct](https://github.com/paperless-ngx/paperless-ngx/blob/main/CODE_OF_CONDUCT.md). " + "You are welcome to open a new issue that describes the problem you observed in your own words.", }); await github.rest.issues.addLabels({ ...common, labels: ['ai'] }); await github.rest.issues.update({ ...common, state: 'closed', state_reason: 'not_planned' });