add vulnerability scan #28
Workflow file for this run
This file contains hidden or 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
name: Vulnerability Scan for Pull Requests | |
on: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- registry/**/connector-packing.json | |
- .github/workflows/pr-scan.yaml | |
jobs: | |
trivy-scan: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
fetch_depth: 1 | |
- name: Get all connector version package changes | |
id: connector-version-changed-files | |
uses: tj-actions/[email protected] | |
with: | |
json: true | |
escape_json: false | |
files: | | |
registry/** | |
- name: Print out all the changed filse | |
env: | |
ADDED_FILES: ${{ steps.connector-version-changed-files.outputs.added_files }} | |
MODIFIED_FILES: ${{ steps.connector-version-changed-files.outputs.modified_files }} | |
DELETED_FILES: ${{ steps.connector-version-changed-files.outputs.deleted_files }} | |
run: | | |
echo "{\"added_files\": $ADDED_FILES, \"modified_files\": $MODIFIED_FILES, \"deleted_files\": $DELETED_FILES}" > changed_files.json | |
- name: List changed files | |
id: list_files | |
run: | | |
cat changed_files.json | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.21.x | |
- name: Run Scan | |
env: | |
CHANGED_FILES_PATH: "changed_files.json" | |
run: | | |
mv changed_files.json registry-automation/changed_files.json | |
cd registry-automation | |
go run main.go scan trivy |