Skip to content

Commit

Permalink
Create main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
JoannaTan authored Sep 23, 2024
1 parent 6ca25d0 commit 60058a2
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CodeGuru Security Example
on:
push:
branches:
- 'main'

permissions:
id-token: write
# for writing security events.
security-events: write
# only required for workflows in private repositories
actions: read
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Respository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Configure aws credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::046503905558:role/CodeGuruSecurityGitHubAccessRole
aws-region: ap-southeast-1
role-session-name: GitHubActionScript

- name: CodeGuru Security
uses: aws-actions/codeguru-security@v1
with:
source_path: .
aws_region: ap-southeast-1
fail_on_severity: Critical
- name: Print findings
run: |
ls -l
cat codeguru-security-results.sarif.json
# If you want content in security scanning, you’ll need to enable codescanning by going into github.
# https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning-for-a-repository
- name: Upload result
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: codeguru-security-results.sarif.json

0 comments on commit 60058a2

Please sign in to comment.