|
| 1 | +name: Intelligent Code Review |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + pull_request: |
| 5 | + types: [opened, synchronize] |
| 6 | + |
| 7 | +concurrency: |
| 8 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 9 | + |
| 10 | +jobs: |
| 11 | + review: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + permissions: |
| 14 | + id-token: write |
| 15 | + contents: write |
| 16 | + pull-requests: write |
| 17 | + steps: |
| 18 | + - name: Checkout code |
| 19 | + uses: actions/checkout@v3 |
| 20 | + |
| 21 | + - name: Set up Node.js |
| 22 | + uses: actions/setup-node@v3 |
| 23 | + with: |
| 24 | + node-version: '20' |
| 25 | + |
| 26 | + - name: Install dependencies @actions/core and @actions/github |
| 27 | + run: | |
| 28 | + npm install @actions/core |
| 29 | + npm install @actions/github |
| 30 | + shell: bash |
| 31 | + |
| 32 | + - name: Check if required dependencies are installed |
| 33 | + run: | |
| 34 | + npm list @actions/core |
| 35 | + npm list @actions/github |
| 36 | + shell: bash |
| 37 | + |
| 38 | + - name: Debug GitHub Token |
| 39 | + run: | |
| 40 | + if [ -n "${{ secrets.GITHUB_TOKEN }}" ]; then |
| 41 | + echo "GitHub Token is set" |
| 42 | + else |
| 43 | + echo "GitHub Token is not set" |
| 44 | + fi |
| 45 | +
|
| 46 | + - name: Configure AWS Credentials |
| 47 | + uses: aws-actions/configure-aws-credentials@v4 |
| 48 | + with: |
| 49 | + role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} |
| 50 | + aws-region: us-east-1 |
| 51 | + |
| 52 | + - name: Intelligent GitHub Actions |
| 53 | + uses: aws-sample/aws-genai-cicd-suite@stable |
| 54 | + with: |
| 55 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 56 | + aws-region: us-east-1 |
| 57 | + model-id: anthropic.claude-3-sonnet-20240229-v1:0 |
| 58 | + generate-code-review: 'true' |
| 59 | + generate-code-review-level: 'detailed' |
| 60 | + generate-code-review-exclude-files: '*.md,*.json' |
| 61 | + generate-pr-description: 'true' |
| 62 | + generate-unit-test: 'true' |
| 63 | + generate-unit-test-source-folder: 'src' |
| 64 | + output-language: 'en' |
| 65 | + env: |
| 66 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments