Skip to content

Commit

Permalink
Add Github Action for CodeGuru Reviewer (#1000)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Schaef <[email protected]>
  • Loading branch information
martinschaef and Martin Schaef authored Dec 7, 2021
1 parent 9d1df93 commit f4feebe
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/codeguru-reviewer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

# Runs CodeGuru Reviewer on push and pull_request events,
# and uploads recommendations to the GitHub Security tab.
# For information on the setup see:
# https://github.com/aws-samples/aws-codeguru-reviewer-cicd-cdk-sample

name: Analyze with CodeGuru Reviewer
on: [pull_request, push]
permissions:
id-token: write
contents: read
security-events: write

jobs:
CodeGuruReviewerScan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Compile
run: ./gradlew compileJava -x test
- name: Copy build artifacts
run: |
mkdir -p class-files
cp -r smithy-*/build/classes/java/main/* class-files
- name: Assume IAM Role
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: arn:aws:iam::048169001733:role/GuruGitHubCICDRole
aws-region: us-west-2

- name: Run CodeGuru Reviewer
uses: aws-actions/[email protected]
continue-on-error: false
with:
s3_bucket: codeguru-reviewer-github-profiler-demo-048169001733-uw2
build_path: ./class-files

- name: Upload review result
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: codeguru-results.sarif.json

0 comments on commit f4feebe

Please sign in to comment.