stabilize llm log ingestion and dataset sync workflow #216
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Auto Moderation for Issues and Comments | |
| on: | |
| issues: | |
| types: [opened] | |
| issue_comment: | |
| types: [created] | |
| jobs: | |
| moderate_content: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| issues: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| run: pip install requests openai | |
| - name: Run LLM Content Moderator | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| LLM_API_KEY: ${{ secrets.LLM_API_KEY }} | |
| GITHUB_EVENT_NAME: ${{ github.event_name }} | |
| GITHUB_REPOSITORY: ${{ github.repository }} | |
| # 针对 Issue 的变量 | |
| ISSUE_NUMBER: ${{ github.event.issue.number }} | |
| ISSUE_TITLE: ${{ github.event.issue.title || '' }} | |
| ISSUE_BODY: ${{ github.event.issue.body || '' }} | |
| # 针对 Comment 的变量 | |
| COMMENT_ID: ${{ github.event.comment.id || '' }} | |
| COMMENT_BODY: ${{ github.event.comment.body || '' }} | |
| run: python .github/scripts/valid_check.py |