name: PR Comment Agent on: issue_comment: types: [created] jobs: ai-fixup: name: Claude Fix-up (@claude comment) runs-on: ubuntu-latest # Only PR comments, only from the repo owner, only when addressed to @claude. # The owner guard matters: the job pushes code to the PR branch. if: >- gitea.event.issue.pull_request && startsWith(gitea.event.comment.body, '@claude') && gitea.event.comment.user.login == gitea.repository_owner steps: - name: Checkout repository uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Node.js uses: actions/setup-node@v4 with: node-version: 22 - name: Set up Python uses: actions/setup-python@v5 with: python-version: "3.12" - name: Install Claude Code run: npm install -g @anthropic-ai/claude-code - name: Apply the requested fix-up env: CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITEA_SERVER_URL: ${{ gitea.server_url }} GITEA_REPOSITORY: ${{ gitea.repository }} PR_NUMBER: ${{ gitea.event.issue.number }} COMMENT_BODY: ${{ gitea.event.comment.body }} # Claude Code runs as root inside the runner container; this flag # acknowledges the container *is* the sandbox. IS_SANDBOX: "1" run: python scripts/ci/ai_fixup.py