From 17686c4d123b66660325035b8263a7cdfc17e58b Mon Sep 17 00:00:00 2001 From: Werner Robitza Date: Wed, 2 Sep 2026 08:15:11 +0200 Subject: [PATCH 1/3] "Update Claude PR Assistant workflow" --- .github/workflows/claude.yml | 47 +++++++----------------------------- 1 file changed, 9 insertions(+), 38 deletions(-) diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index e471f8f..6b15fac 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -10,9 +10,6 @@ on: pull_request_review: types: [submitted] -env: - FFMPEG_VERSION: "8.1" - jobs: claude: if: | @@ -22,9 +19,9 @@ jobs: (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) runs-on: ubuntu-latest permissions: - contents: write - pull-requests: write - issues: write + contents: read + pull-requests: read + issues: read id-token: write actions: read # Required for Claude to read CI results on PRs steps: @@ -33,37 +30,6 @@ jobs: with: fetch-depth: 1 - - name: Install uv - uses: astral-sh/setup-uv@v3 - - - name: Set up Python - run: uv python install 3.13 - - - name: Cache ffmpeg download - uses: actions/cache@v4 - id: cache-ffmpeg - with: - path: /opt/ffmpeg/ffmpeg-n${{ env.FFMPEG_VERSION }}-latest-linux64-gpl-${{ env.FFMPEG_VERSION }}.tar.xz - key: ${{ runner.os }}-ffmpeg - - - name: Download ffmpeg if not cached - if: steps.cache-ffmpeg.outputs.cache-hit != 'true' - run: | - echo "Downloading ffmpeg ${FFMPEG_VERSION}" - wget -q https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n${{ env.FFMPEG_VERSION }}-latest-linux64-gpl-${{ env.FFMPEG_VERSION }}.tar.xz -P /opt/ffmpeg - - - name: Extract and install ffmpeg - run: | - echo "Extracting ffmpeg ${FFMPEG_VERSION}" - sudo mkdir -p /opt/ffmpeg/extracted - sudo tar --strip-components 1 -xf /opt/ffmpeg/ffmpeg-n${{ env.FFMPEG_VERSION }}-latest-linux64-gpl-${{ env.FFMPEG_VERSION }}.tar.xz -C /opt/ffmpeg/extracted - echo "Installing ffmpeg ${FFMPEG_VERSION}" - sudo cp /opt/ffmpeg/extracted/bin/ffmpeg /usr/bin/ffmpeg - sudo cp /opt/ffmpeg/extracted/bin/ffprobe /usr/bin/ffprobe - - - name: Install dependencies - run: uv sync --group dev - - name: Run Claude Code id: claude uses: anthropics/claude-code-action@v1 @@ -74,6 +40,11 @@ jobs: additional_permissions: | actions: read + # Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it. + # prompt: 'Update the pull request description to include a summary of changes.' + + # Optional: Add claude_args to customize behavior and configuration # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md # or https://code.claude.com/docs/en/cli-reference for available options - claude_args: '--allowed-tools "Bash(uv run pytest:*),Bash(uv run ruff:*),Bash(uv run ty check:*),Bash(python -m ffmpeg_normalize:*),Bash(gh:*)"' + # claude_args: '--allowed-tools Bash(gh pr *)' + From a1059b517f81b2cfaefc1f9ed2e1cf2f6ac98a8e Mon Sep 17 00:00:00 2001 From: Werner Robitza Date: Wed, 2 Sep 2026 08:15:12 +0200 Subject: [PATCH 2/3] "Update Claude Code Review workflow" --- .github/workflows/claude-code-review.yml | 46 +++++------------------- 1 file changed, 8 insertions(+), 38 deletions(-) diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index a2f3a0e..37e66f3 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -5,10 +5,10 @@ on: types: [opened, synchronize, ready_for_review, reopened] # Optional: Only run on specific file changes # paths: - # - "src/**/*.py" - -env: - FFMPEG_VERSION: "8.1" + # - "src/**/*.ts" + # - "src/**/*.tsx" + # - "src/**/*.js" + # - "src/**/*.jsx" jobs: claude-review: @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: read - pull-requests: write + pull-requests: read issues: read id-token: write @@ -31,37 +31,6 @@ jobs: with: fetch-depth: 1 - - name: Install uv - uses: astral-sh/setup-uv@v3 - - - name: Set up Python - run: uv python install 3.13 - - - name: Cache ffmpeg download - uses: actions/cache@v4 - id: cache-ffmpeg - with: - path: /opt/ffmpeg/ffmpeg-n${{ env.FFMPEG_VERSION }}-latest-linux64-gpl-${{ env.FFMPEG_VERSION }}.tar.xz - key: ${{ runner.os }}-ffmpeg - - - name: Download ffmpeg if not cached - if: steps.cache-ffmpeg.outputs.cache-hit != 'true' - run: | - echo "Downloading ffmpeg ${FFMPEG_VERSION}" - wget -q https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n${{ env.FFMPEG_VERSION }}-latest-linux64-gpl-${{ env.FFMPEG_VERSION }}.tar.xz -P /opt/ffmpeg - - - name: Extract and install ffmpeg - run: | - echo "Extracting ffmpeg ${FFMPEG_VERSION}" - sudo mkdir -p /opt/ffmpeg/extracted - sudo tar --strip-components 1 -xf /opt/ffmpeg/ffmpeg-n${{ env.FFMPEG_VERSION }}-latest-linux64-gpl-${{ env.FFMPEG_VERSION }}.tar.xz -C /opt/ffmpeg/extracted - echo "Installing ffmpeg ${FFMPEG_VERSION}" - sudo cp /opt/ffmpeg/extracted/bin/ffmpeg /usr/bin/ffmpeg - sudo cp /opt/ffmpeg/extracted/bin/ffprobe /usr/bin/ffprobe - - - name: Install dependencies - run: uv sync --group dev - - name: Run Claude Code Review id: claude-review uses: anthropics/claude-code-action@v1 @@ -69,7 +38,8 @@ jobs: claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} plugin_marketplaces: 'https://github.com/anthropics/claude-code.git' plugins: 'code-review@claude-code-plugins' - prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}' + prompt: '/code-review:code-review --comment ${{ github.repository }}/pull/${{ github.event.pull_request.number }}' + claude_args: '--allowedTools "mcp__github_inline_comment__create_inline_comment"' # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md # or https://code.claude.com/docs/en/cli-reference for available options - claude_args: '--allowed-tools "Bash(uv run pytest:*),Bash(uv run ruff:*),Bash(uv run ty check:*),Bash(python -m ffmpeg_normalize:*),Bash(gh pr:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"' + From 636399e285fee879ef962baf830269a328e672a5 Mon Sep 17 00:00:00 2001 From: Werner Robitza Date: Wed, 2 Sep 2026 08:17:34 +0200 Subject: [PATCH 3/3] ci: post code review findings as inline comments Keep the repo's ffmpeg/uv setup and write permissions, and take only the inline-comment support from the upstream workflow template. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/claude-code-review.yml | 45 +++++++++++++++++++---- .github/workflows/claude.yml | 47 +++++++++++++++++++----- 2 files changed, 76 insertions(+), 16 deletions(-) diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index 37e66f3..21bfa0a 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -5,10 +5,10 @@ on: types: [opened, synchronize, ready_for_review, reopened] # Optional: Only run on specific file changes # paths: - # - "src/**/*.ts" - # - "src/**/*.tsx" - # - "src/**/*.js" - # - "src/**/*.jsx" + # - "src/**/*.py" + +env: + FFMPEG_VERSION: "8.1" jobs: claude-review: @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest permissions: contents: read - pull-requests: read + pull-requests: write issues: read id-token: write @@ -31,6 +31,37 @@ jobs: with: fetch-depth: 1 + - name: Install uv + uses: astral-sh/setup-uv@v3 + + - name: Set up Python + run: uv python install 3.13 + + - name: Cache ffmpeg download + uses: actions/cache@v4 + id: cache-ffmpeg + with: + path: /opt/ffmpeg/ffmpeg-n${{ env.FFMPEG_VERSION }}-latest-linux64-gpl-${{ env.FFMPEG_VERSION }}.tar.xz + key: ${{ runner.os }}-ffmpeg + + - name: Download ffmpeg if not cached + if: steps.cache-ffmpeg.outputs.cache-hit != 'true' + run: | + echo "Downloading ffmpeg ${FFMPEG_VERSION}" + wget -q https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n${{ env.FFMPEG_VERSION }}-latest-linux64-gpl-${{ env.FFMPEG_VERSION }}.tar.xz -P /opt/ffmpeg + + - name: Extract and install ffmpeg + run: | + echo "Extracting ffmpeg ${FFMPEG_VERSION}" + sudo mkdir -p /opt/ffmpeg/extracted + sudo tar --strip-components 1 -xf /opt/ffmpeg/ffmpeg-n${{ env.FFMPEG_VERSION }}-latest-linux64-gpl-${{ env.FFMPEG_VERSION }}.tar.xz -C /opt/ffmpeg/extracted + echo "Installing ffmpeg ${FFMPEG_VERSION}" + sudo cp /opt/ffmpeg/extracted/bin/ffmpeg /usr/bin/ffmpeg + sudo cp /opt/ffmpeg/extracted/bin/ffprobe /usr/bin/ffprobe + + - name: Install dependencies + run: uv sync --group dev + - name: Run Claude Code Review id: claude-review uses: anthropics/claude-code-action@v1 @@ -38,8 +69,8 @@ jobs: claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} plugin_marketplaces: 'https://github.com/anthropics/claude-code.git' plugins: 'code-review@claude-code-plugins' + # --comment makes Claude post its findings as inline review comments prompt: '/code-review:code-review --comment ${{ github.repository }}/pull/${{ github.event.pull_request.number }}' - claude_args: '--allowedTools "mcp__github_inline_comment__create_inline_comment"' # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md # or https://code.claude.com/docs/en/cli-reference for available options - + claude_args: '--allowed-tools "mcp__github_inline_comment__create_inline_comment,Bash(uv run pytest:*),Bash(uv run ruff:*),Bash(uv run ty check:*),Bash(python -m ffmpeg_normalize:*),Bash(gh pr:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"' diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index 6b15fac..e471f8f 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -10,6 +10,9 @@ on: pull_request_review: types: [submitted] +env: + FFMPEG_VERSION: "8.1" + jobs: claude: if: | @@ -19,9 +22,9 @@ jobs: (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) runs-on: ubuntu-latest permissions: - contents: read - pull-requests: read - issues: read + contents: write + pull-requests: write + issues: write id-token: write actions: read # Required for Claude to read CI results on PRs steps: @@ -30,6 +33,37 @@ jobs: with: fetch-depth: 1 + - name: Install uv + uses: astral-sh/setup-uv@v3 + + - name: Set up Python + run: uv python install 3.13 + + - name: Cache ffmpeg download + uses: actions/cache@v4 + id: cache-ffmpeg + with: + path: /opt/ffmpeg/ffmpeg-n${{ env.FFMPEG_VERSION }}-latest-linux64-gpl-${{ env.FFMPEG_VERSION }}.tar.xz + key: ${{ runner.os }}-ffmpeg + + - name: Download ffmpeg if not cached + if: steps.cache-ffmpeg.outputs.cache-hit != 'true' + run: | + echo "Downloading ffmpeg ${FFMPEG_VERSION}" + wget -q https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n${{ env.FFMPEG_VERSION }}-latest-linux64-gpl-${{ env.FFMPEG_VERSION }}.tar.xz -P /opt/ffmpeg + + - name: Extract and install ffmpeg + run: | + echo "Extracting ffmpeg ${FFMPEG_VERSION}" + sudo mkdir -p /opt/ffmpeg/extracted + sudo tar --strip-components 1 -xf /opt/ffmpeg/ffmpeg-n${{ env.FFMPEG_VERSION }}-latest-linux64-gpl-${{ env.FFMPEG_VERSION }}.tar.xz -C /opt/ffmpeg/extracted + echo "Installing ffmpeg ${FFMPEG_VERSION}" + sudo cp /opt/ffmpeg/extracted/bin/ffmpeg /usr/bin/ffmpeg + sudo cp /opt/ffmpeg/extracted/bin/ffprobe /usr/bin/ffprobe + + - name: Install dependencies + run: uv sync --group dev + - name: Run Claude Code id: claude uses: anthropics/claude-code-action@v1 @@ -40,11 +74,6 @@ jobs: additional_permissions: | actions: read - # Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it. - # prompt: 'Update the pull request description to include a summary of changes.' - - # Optional: Add claude_args to customize behavior and configuration # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md # or https://code.claude.com/docs/en/cli-reference for available options - # claude_args: '--allowed-tools Bash(gh pr *)' - + claude_args: '--allowed-tools "Bash(uv run pytest:*),Bash(uv run ruff:*),Bash(uv run ty check:*),Bash(python -m ffmpeg_normalize:*),Bash(gh:*)"'