-
Notifications
You must be signed in to change notification settings - Fork 218
60 lines (52 loc) · 1.73 KB
/
codeguru-reviewer.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Runs CodeGuru Reviewer on push 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: [push]
permissions:
id-token: write
contents: read
security-events: write
jobs:
CodeGuruReviewerScan:
runs-on: ubuntu-latest
steps:
- name: Assume IAM Role
id: iam-role
continue-on-error: true
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::048169001733:role/GuruGitHubCICDRole
aws-region: us-west-2
- uses: actions/checkout@v4
if: steps.iam-role.outcome == 'success'
with:
fetch-depth: 0
- name: Set up JDK 1.8
if: steps.iam-role.outcome == 'success'
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: 8
- name: Compile
if: steps.iam-role.outcome == 'success'
run: ./gradlew compileJava -x test
- name: Copy build artifacts
if: steps.iam-role.outcome == 'success'
run: |
mkdir -p class-files
cp -r smithy-*/build/classes/java/main/* class-files
- name: Run CodeGuru Reviewer
id: guruscan
if: steps.iam-role.outcome == 'success'
continue-on-error: true
uses: aws-actions/[email protected]
with:
s3_bucket: codeguru-reviewer-github-profiler-demo-048169001733-uw2
build_path: ./class-files
- name: Upload review result
if: steps.iam-role.outcome == 'success' &&steps.guruscan.outcome == 'success'
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: codeguru-results.sarif.json