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

Github Actions PR scan #4928

Merged
merged 81 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
42e5089
Add yaml.
jaredb96 Oct 29, 2024
0b1146d
Change job to hmda platform.
jaredb96 Oct 29, 2024
70ca864
Add docker image.
jaredb96 Oct 29, 2024
0e7e107
Delete accidental file.
jaredb96 Oct 29, 2024
3590d0f
Delete accidental file.
jaredb96 Oct 29, 2024
e314b21
Revert space.
jaredb96 Oct 29, 2024
2632b92
Add snyk scan.
jaredb96 Nov 1, 2024
10d0ae9
Remove hmda unit test run.
jaredb96 Nov 4, 2024
8a82232
Fix unit test removal.
jaredb96 Nov 4, 2024
5ac2dad
Remove snyk.
jaredb96 Nov 4, 2024
7dd592d
Add grype.
jaredb96 Nov 5, 2024
219c108
Add grype install.
jaredb96 Nov 5, 2024
3434073
Change OS to mac.
jaredb96 Nov 5, 2024
c07c21e
Add install docker.
jaredb96 Nov 5, 2024
4937cfb
Remove env variables.
jaredb96 Nov 5, 2024
329e62a
Add cve to docker tag.
jaredb96 Nov 5, 2024
fe39bae
Revert OS to ubuntu-latest.
jaredb96 Nov 5, 2024
64aa4e6
Remove tool install step.
jaredb96 Nov 5, 2024
e53ef1f
Add homebrew setup step.
jaredb96 Nov 5, 2024
4439d07
Change tag command.
jaredb96 Nov 5, 2024
30f2a58
Change homebrew step order.
jaredb96 Nov 5, 2024
1c03a45
Fix grype command.
jaredb96 Nov 5, 2024
36ed8a8
Fix grype command.
jaredb96 Nov 5, 2024
c9116a3
Fix image.
jaredb96 Nov 5, 2024
2c9070d
Display grype results.
jaredb96 Nov 5, 2024
304c861
Add heap space to JVM.
jaredb96 Nov 5, 2024
6f61a92
Add stop on error for build step.
jaredb96 Nov 5, 2024
63b9ec2
Add Docker to step name.
jaredb96 Nov 5, 2024
465bf39
Add table option to grype scan.
jaredb96 Nov 5, 2024
9500987
Change grype report to json.
jaredb96 Nov 5, 2024
dcf2020
Add write permissions to action.
jaredb96 Nov 5, 2024
a6e235c
Install Trivy.
jaredb96 Nov 6, 2024
b27388e
Change grype display.
jaredb96 Nov 6, 2024
73edcdf
Revert grype display.
jaredb96 Nov 6, 2024
9601b00
Test grype display.
jaredb96 Nov 6, 2024
8fa296a
Remove Trivy.
jaredb96 Nov 6, 2024
01421bd
Revert display.
jaredb96 Nov 6, 2024
d2e24cb
Put grype report in step output.
jaredb96 Nov 6, 2024
c13b6ac
Change grype report command.
jaredb96 Nov 6, 2024
c7e63fa
Change grype report command and remove comment.
jaredb96 Nov 6, 2024
6f86f22
Run cat as command.
jaredb96 Nov 6, 2024
dcfc0c8
Remove github output env variable.
jaredb96 Nov 6, 2024
1ef048d
Upload grype report in artifact.
jaredb96 Nov 6, 2024
59eba74
Move grype report to new directory.
jaredb96 Nov 6, 2024
7642f03
Remove artifact.
jaredb96 Nov 6, 2024
d8046bf
Store report in variable.
jaredb96 Nov 6, 2024
c02ee08
Change grype report to json.
jaredb96 Nov 6, 2024
d80d1a6
Fix typo.
jaredb96 Nov 6, 2024
af75aba
Replace cat with sed.
jaredb96 Nov 6, 2024
5f95c8a
Delete unit test yaml for testing.
jaredb96 Nov 6, 2024
9a7fbaf
Remove json.
jaredb96 Nov 6, 2024
b49df3b
Fix typo.
jaredb96 Nov 6, 2024
64dac3a
Run cat in message.
jaredb96 Nov 7, 2024
642caca
Replace message tool.
jaredb96 Nov 7, 2024
6c3d757
Add issue number and body key.
jaredb96 Nov 7, 2024
13c2b9f
Reference report file in display command.
jaredb96 Nov 7, 2024
8cf0fa7
Edit body path.
jaredb96 Nov 7, 2024
98f4832
Remove report variable and directory.
jaredb96 Nov 7, 2024
6bdeaab
Revert display report.
jaredb96 Nov 7, 2024
cd8e951
Change cat to paste.
jaredb96 Nov 7, 2024
6ab7fdb
Use js code for report display.
jaredb96 Nov 7, 2024
f053c3d
Use echo and cat with double quotes for report display.
jaredb96 Nov 7, 2024
0d22eec
Switch report to json.
jaredb96 Nov 7, 2024
2a468f8
Add short report python script.
jaredb96 Nov 7, 2024
8cc8b13
Store short report in variable.
jaredb96 Nov 7, 2024
7b0497f
Display short report in comment.
jaredb96 Nov 7, 2024
d6ce540
Fix json loads.
jaredb96 Nov 7, 2024
5b02582
Use awk to make comment.
jaredb96 Nov 7, 2024
bedab36
Change comment.
jaredb96 Nov 8, 2024
03477b1
Change comment.
jaredb96 Nov 13, 2024
cead40d
Change comment.
jaredb96 Nov 13, 2024
3d7d062
Install trivy.
jaredb96 Nov 13, 2024
4c4bf58
Trivy and artifact upload.
jaredb96 Nov 13, 2024
f5011a8
Artifact upload comment.
jaredb96 Nov 13, 2024
8d05984
Remove trivy for db failure.
jaredb96 Nov 13, 2024
db51011
Artifact upload comment.
jaredb96 Nov 13, 2024
246f73e
Artifact upload comment.
jaredb96 Nov 13, 2024
c550c9d
Artifact upload comment.
jaredb96 Nov 13, 2024
cd4e3b2
Artifact upload comment.
jaredb96 Nov 13, 2024
17f1ea6
Cve report name.
jaredb96 Nov 13, 2024
df79203
Add back unit test file.
jaredb96 Nov 13, 2024
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
51 changes: 51 additions & 0 deletions .github/workflows/cve-scan-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: HMDA PR CVE Scan

on:
pull_request:
types: [opened, synchronize, reopened]

permissions:
pull-requests: write

jobs:
hmda-platform-cve-scan:
runs-on: ubuntu-latest

steps:
- name: Check out repo
uses: actions/checkout@v4

- name: Build Docker image of HMDA platform
run: |
env JAVA_OPTS="-Xss256m -Xmx4096m" sbt "project hmda-platform" dockerPublishLocalSkipTests
continue-on-error: false

- name: Tag and name Docker image
run: docker tag hmda/hmda-platform:latest pr-cve-scan:latest

- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master

- name: Install Grype
run: |
brew install grype

- name: Run Grype scan
run: |
grype pr-cve-scan:latest > grype-report.txt

- name: Upload Grype report to artifact
uses: actions/upload-artifact@v4
with:
name: cve-report
path: |
grype-report.txt

- name: Post comment with report link
uses: thollander/actions-comment-pull-request@v3
with:
message: CVE scan report generated by Grype are available. Check the Actions tab to download the reports.

- name: Remove Docker image
run: |
docker rmi pr-cve-scan:latest
108 changes: 54 additions & 54 deletions .github/workflows/unit-test.yml → .github/workflows/unit-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,64 +63,64 @@ jobs:
fi

common_tests:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'

- name: Run common Tests
run: |
sbt "project common" "testOnly -- -l actions-ignore" 2>&1 | tee -a log-file
continue-on-error: true

- name: Check Test Results
run: |
if [ $(grep 'All tests passed.' log-file | wc -l) -ne 1 ]; then
echo "One or more projects had failures. Please review the logs."
exit 1
else
echo "All tests passed."
exit 0
fi
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'

- name: Run common Tests
run: |
sbt "project common" "testOnly -- -l actions-ignore" 2>&1 | tee -a log-file
continue-on-error: true

- name: Check Test Results
run: |
if [ $(grep 'All tests passed.' log-file | wc -l) -ne 1 ]; then
echo "One or more projects had failures. Please review the logs."
exit 1
else
echo "All tests passed."
exit 0
fi

data_browser_tests:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'

- name: Run data-browser Tests
run: |
sbt "project data-browser" "testOnly -- -l actions-ignore" 2>&1 | tee -a log-file
continue-on-error: true

- name: Check Test Results
run: |
if [ $(grep 'All tests passed.' log-file | wc -l) -ne 1 ]; then
echo "One or more projects had failures. Please review the logs."
exit 1
else
echo "All tests passed."
exit 0
fi
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup JDK
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'

- name: Run data-browser Tests
run: |
sbt "project data-browser" "testOnly -- -l actions-ignore" 2>&1 | tee -a log-file
continue-on-error: true

- name: Check Test Results
run: |
if [ $(grep 'All tests passed.' log-file | wc -l) -ne 1 ]; then
echo "One or more projects had failures. Please review the logs."
exit 1
else
echo "All tests passed."
exit 0
fi

hmda_analytics_tests:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -367,4 +367,4 @@ jobs:
else
echo "All tests passed."
exit 0
fi
fi
Loading
Loading