Spaces:
Sleeping
Sleeping
| name: AI Repository Agent (Python Tools) | |
| on: | |
| pull_request: | |
| types: [opened] | |
| issues: | |
| types: [opened] | |
| issue_comment: | |
| types: [created] | |
| jobs: | |
| ai-agent: | |
| if: | | |
| github.event_name == 'pull_request' || | |
| github.event_name == 'issues' || | |
| (github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '[use-ai]')) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| issues: write | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.10' | |
| - name: Install Dependencies | |
| run: | | |
| pip install openai PyGithub | |
| - name: Run AI Agent | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| OPENAI_BASE_URL: ${{ secrets.OPENAI_BASE_URL }} | |
| AI_MODEL: ${{ secrets.AI_MODEL }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| EVENT_CONTEXT: ${{ toJson(github.event) }} | |
| EVENT_NAME: ${{ github.event_name }} | |
| run: python .github/scripts/ai_agent.py | |