diff --git a/.github/workflows/pr-review.yml b/.github/workflows/pr-review.yml index 8beaef1..4c1ac30 100644 --- a/.github/workflows/pr-review.yml +++ b/.github/workflows/pr-review.yml @@ -1,25 +1,13 @@ -on: - workflow_call: name: jobtaker +on: + pull_request: + types: [opened, synchronize, ready_for_review, reopened] +permissions: + contents: read + checks: write + pull-requests: write + id-token: write jobs: - config: - if: | - (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@jobtaker')) || - (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@jobtaker')) || - (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@jobtaker')) || - (contains(github.event.pull_request.labels.*.name, 'jobtaker')) || - (github.event_name == 'issues' && (contains(github.event.issue.body, '@jobtaker') || contains(github.event.issue.title, '@jobtaker'))) - runs-on: ${{ vars.RUNNER }} - name: generate config - outputs: - config: ${{ steps.merge.outputs.config }} - steps: - - name: merge - id: merge - uses: carteramesh/ci/.github/actions/rust-config@main - with: - git_token: ${{ github.token }} - runner: ${{ vars.RUNNER }} jobtaker: if: | (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@jobtaker')) || @@ -28,43 +16,68 @@ jobs: (contains(github.event.pull_request.labels.*.name, 'jobtaker')) || (github.event_name == 'issues' && (contains(github.event.issue.body, '@jobtaker') || contains(github.event.issue.title, '@jobtaker'))) runs-on: ${{ vars.RUNNER }} - needs: [config] permissions: contents: read pull-requests: write id-token: write steps: - - name: Init - uses: carteramesh/ci/.github/actions/rust-init@main - with: - packages: ${{ toJSON(fromJSON(needs.config.outputs.config).global.packages) }} - - name: Validate ANTROPIC_API_KEY + - name: Validate ANTHROPIC_API_KEY shell: bash run: | - [ -z "${{ secrets.ANTROPIC_API_KEY }}" ] && exit 1 + [ -z "${{ secrets.ANTHROPIC_API_KEY }}" ] && exit 1 - name: jobtaker - if: ${{ fromJSON(needs.config.outputs.config).ai.enabled }} uses: anthropics/claude-code-action@v1 with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} trigger_phrase: '@jobtaker' - settings: ${{ toJSON(fromJSON(needs.config.outputs.config).ai.settings) }} + # settings: ${{ toJSON(fromJSON(needs.config.outputs.config).ai.settings) }} # description: "Claude Code settings as JSON string or path to settings JSON file" - allowed_bots: ${{ fromJSON(needs.config.outputs.config).ai.allowed_bots }} + allowed_bots: '*' # description: "Comma-separated list of allowed bot usernames, or '*' to allow all bots. Empty string (default) allows no bots." # Your custom review instructions prompt: | REPO: ${{ github.repository }} PR NUMBER: ${{ github.event.pull_request.number }} - ${{ fromJSON(needs.config.outputs.config).ai.prompt }} + Provide detailed feedback using inline comments for ONLY issues, no praise inline comments. + Use top-level comments for general observations or praise + Do not be shy, I am a big boy and can handle criticism gracefully. I welcome feedback and suggestions. + + Review this PR against our team checklist: + + ## Code Quality + - [ ] Code follows our style guide + - [ ] No commented-out code + - [ ] Meaningful variable names + - [ ] DRY principle followed + + ## Testing + - [ ] Unit tests for new functions + - [ ] Integration tests for new endpoints + - [ ] Edge cases covered + - [ ] Test coverage > 80% + + ## Documentation + - [ ] README updated if needed + - [ ] API docs updated + - [ ] Inline comments for complex logic + - [ ] CHANGELOG.md updated + + ## Security + - [ ] No hardcoded credentials + - [ ] Input validation implemented + - [ ] Proper error handling + - [ ] No sensitive data in logs + + For each item, check if it is satisfied and comment on any that need attention. + Post a summary comment with checklist results. # Tools for comprehensive PR review - claude_args: ${{ fromJSON(needs.config.outputs.config).ai.claude_args }} - use_sticky_comment: ${{ fromJSON(needs.config.outputs.config).ai.use_sticky_comment }} + # claude_args: ${{ fromJSON(needs.config.outputs.config).ai.claude_args }} + use_sticky_comment: false # description: "Use just one comment to deliver issue/PR comments" # required: false # default: "false" - track_progress: ${{ fromJSON(needs.config.outputs.config).ai.track_progress }} + track_progress: true # description: "Force tag mode with tracking comments for pull_request and issue events. Only applicable to pull_request (opened, synchronize, ready_for_review, reopened) and issue (opened, edited, labeled, assigned) events." path_to_claude_code_executable: '' # description: "Optional path to a custom Claude Code executable. If provided, skips automatic installation and uses this executable instead. WARNING: Using an older version may cause problems if the action begins taking advantage of new Claude Code features. This input is typically not needed unless you're debugging something specific or have unique needs in your environment." diff --git a/package-lock.json b/package-lock.json index e4b4b5e..3089973 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "@actions/core": "^2.0.2", - "zod": "^4.1.13" + "zod": "^4.3.5" }, "devDependencies": { "@eslint/compat": "^2.0.0", @@ -13484,9 +13484,9 @@ } }, "node_modules/zod": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/zod/-/zod-4.2.1.tgz", - "integrity": "sha512-0wZ1IRqGGhMP76gLqz8EyfBXKk0J2qo2+H3fi4mcUP/KtTocoX08nmIAHl1Z2kJIZbZee8KOpBCSNPRgauucjw==", + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.5.tgz", + "integrity": "sha512-k7Nwx6vuWx1IJ9Bjuf4Zt1PEllcwe7cls3VNzm4CQ1/hgtFUK2bRNG3rvnpPUhFjmqJKAKtjV576KnUkHocg/g==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" diff --git a/package.json b/package.json index dc41f00..05464d4 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "license": "MIT", "dependencies": { "@actions/core": "^2.0.2", - "zod": "^4.1.13" + "zod": "^4.3.5" }, "devDependencies": { "@eslint/compat": "^2.0.0",