Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Github Action for CodeGuru Reviewer #1000

Merged
merged 5 commits into from
Dec 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does this bucket come from, and who owns it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's owned by the CodeGuru team and was created using this Stack:
https://github.com/aws-samples/aws-codeguru-reviewer-cicd-cdk-sample

build_path: ./class-files

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