testing agent- edited index.js #6
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: Code Explainer Bot | |
| on: | |
| issue_comment: | |
| types: [created] | |
| pull_request_review_comment: | |
| types: [created] | |
| permissions: | |
| contents: read | |
| issues: write | |
| pull-requests: write | |
| jobs: | |
| run-agent: | |
| if: | | |
| contains(github.event.comment.body, '@gitagent explain') || | |
| contains(github.event.comment.body, '@gitagent test') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout agent repo | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Run agent | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | |
| EVENT_JSON: ${{ toJson(github.event) }} | |
| run: | | |
| node -e ' | |
| const event = JSON.parse(process.env.EVENT_JSON); | |
| import("./index.js").then(m => m.run(event)); | |
| ' |