ERRORs in log indicates problem with connection to Home Assistant #102
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
| # Claude Bot — PR Reviewer + Issue Fixer | |
| # | |
| # TRIGGERS (only the repo owner can activate the bot): | |
| # @claude-bot in a PR comment → reviews the PR | |
| # @claude-bot in an issue comment → fixes the issue, opens a draft PR | |
| # | |
| # CLI USAGE (from within the repo directory): | |
| # python scripts/pr_reviewer.py --pr 42 | |
| # python scripts/issue_fixer.py --issue 15 | |
| # Both read GITHUB_TOKEN and ANTHROPIC_API_KEY from your environment. | |
| # | |
| # ONE-TIME SETUP (GitHub App): | |
| # 1. github.com/settings/apps → New GitHub App | |
| # Name: bess-manager-claude-reviewer (must be globally unique) | |
| # Homepage: https://github.com/johanzander/bess-manager | |
| # Webhook: uncheck Active | |
| # Permissions → Repository: | |
| # Contents: Read & Write (issue-fixer needs to push branches) | |
| # Issues: Read & Write | |
| # Pull requests: Read & Write | |
| # "Only on this account" → Create GitHub App | |
| # 2. Note the App ID on the settings page | |
| # 3. Generate a private key → download .pem | |
| # 4. Install App tab → install on this repository | |
| # 5. Repo Settings → Secrets → Actions → add: | |
| # CLAUDE_REVIEWER_APP_ID (numeric ID from step 2) | |
| # CLAUDE_REVIEWER_PRIVATE_KEY (full .pem file contents) | |
| # ANTHROPIC_API_KEY (your Anthropic API key) | |
| # | |
| # MOVING TO A CENTRAL BOT REPO LATER: | |
| # 1. Create johanzander/claude-bot and push scripts/ there | |
| # 2. Replace the "checkout" + "pip install" + "run" steps with: | |
| # - uses: actions/checkout@v4 | |
| # with: { repository: johanzander/claude-bot, path: .claude-bot } | |
| # - run: pip install anthropic PyGithub | |
| # - run: python .claude-bot/scripts/pr_reviewer.py # or issue_fixer.py | |
| name: Claude Bot | |
| on: | |
| issue_comment: | |
| types: [created] | |
| jobs: | |
| pr-review: | |
| name: PR Review | |
| if: | | |
| github.event.comment.user.login == github.repository_owner && | |
| github.event.issue.pull_request != null && | |
| contains(github.event.comment.body, '@claude-bot') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| issues: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/create-github-app-token@v1 | |
| id: app-token | |
| with: | |
| app-id: ${{ secrets.CLAUDE_REVIEWER_APP_ID }} | |
| private-key: ${{ secrets.CLAUDE_REVIEWER_PRIVATE_KEY }} | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - run: pip install anthropic PyGithub | |
| - env: | |
| GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| COMMENT_BODY: ${{ github.event.comment.body }} | |
| PR_NUMBER: ${{ github.event.issue.number }} | |
| REPO_FULL_NAME: ${{ github.repository }} | |
| GITHUB_RUN_ID: ${{ github.run_id }} | |
| GITHUB_SERVER_URL: ${{ github.server_url }} | |
| run: python scripts/pr_reviewer.py | |
| issue-fix: | |
| name: Issue Fix | |
| if: | | |
| github.event.comment.user.login == github.repository_owner && | |
| github.event.issue.pull_request == null && | |
| contains(github.event.comment.body, '@claude-bot') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/create-github-app-token@v1 | |
| id: app-token | |
| with: | |
| app-id: ${{ secrets.CLAUDE_REVIEWER_APP_ID }} | |
| private-key: ${{ secrets.CLAUDE_REVIEWER_PRIVATE_KEY }} | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - run: pip install anthropic PyGithub | |
| - env: | |
| GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | |
| ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} | |
| COMMENT_BODY: ${{ github.event.comment.body }} | |
| ISSUE_NUMBER: ${{ github.event.issue.number }} | |
| REPO_FULL_NAME: ${{ github.repository }} | |
| GITHUB_RUN_ID: ${{ github.run_id }} | |
| GITHUB_SERVER_URL: ${{ github.server_url }} | |
| GIT_AUTHOR_NAME: "claude-reviewer[bot]" | |
| GIT_AUTHOR_EMAIL: "claude-reviewer[bot]@users.noreply.github.com" | |
| GIT_COMMITTER_NAME: "claude-reviewer[bot]" | |
| GIT_COMMITTER_EMAIL: "claude-reviewer[bot]@users.noreply.github.com" | |
| run: python scripts/issue_fixer.py |