Automated AI code review workflow #2
Workflow file for this run
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: AI Code Review | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| issues: read | |
| id-token: write | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| jobs: | |
| review: | |
| runs-on: ubuntu-latest | |
| env: | |
| AWS_REGION: us-west-2 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 10 | |
| - name: Generate GitHub App token | |
| id: app-token | |
| uses: actions/create-github-app-token@v2 | |
| with: | |
| app-id: ${{ secrets.KP_REVIEW_BOT_APP_ID }} | |
| private-key: ${{ secrets.KP_REVIEW_BOT_APP_PRIVATE_KEY }} | |
| - name: Configure AWS Credentials (OIDC) | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| role-to-assume: ${{ secrets.AWS_BEDROCK_ROLE }} | |
| aws-region: us-west-2 | |
| - uses: anthropics/claude-code-action@v1 | |
| with: | |
| github_token: ${{ steps.app-token.outputs.token }} | |
| use_bedrock: "true" | |
| claude_args: '--model us.anthropic.claude-sonnet-4-20250514-v1:0 --max-turns 10' | |
| prompt: | | |
| Current directory is the root of github repository. | |
| Review the top commit in this repository using prompt at ${GITHUB_WORKSPACE}/ci/ai-code-review-prompt.md | |
| - name: Debug prints | |
| shell: bash | |
| run: | | |
| ls -la ${{ env.GITHUB_WORKSPACE }} | |
| cat ${{ env.GITHUB_WORKSPACE }}/*.txt | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: vmlinux-${{ inputs.arch }}-${{ inputs.toolchain_full }}${{ inputs.release && '-release' || '' }} | |
| if-no-files-found: error | |
| path: ${{ github.workspace }}/ai-code-review.txt |