-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Github Action for CodeGuru Reviewer (#1000)
Co-authored-by: Martin Schaef <[email protected]>
- Loading branch information
1 parent
9d1df93
commit f4feebe
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
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 |