Skip to content

Commit

Permalink
Fix trivy scan paths
Browse files Browse the repository at this point in the history
  • Loading branch information
niveathika committed Jul 18, 2024
1 parent 326479b commit 6a833af
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/s4hana-release-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,11 @@ jobs:
run: |
./gradlew build -x test
- name: Create lib Directory if not Exists
run: mkdir -p ballerina/lib

- name: Run Trivy Vulnerability Scanner
uses: aquasecurity/trivy-action@master
with:
scan-type: "rootfs"
scan-ref: "/github/workspace/ballerina/lib"
scan-ref: "/github/workspace/ballerina"
format: "table"
timeout: "10m0s"
exit-code: "1"
Expand All @@ -80,10 +77,6 @@ jobs:
echo "Version: ${VERSION}"
git checkout -b release-${{ inputs.hana-connector-name }}-${VERSION}
- name: Remove Lib Directory
run: |
sudo rm -rf ballerina/lib
- name: Publish Package
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
Expand Down
12 changes: 1 addition & 11 deletions .github/workflows/s4hana-trivy-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,11 @@ jobs:
packagePAT: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew build -x test -x :${{ inputs.hana-connector-group }}-examples:build -x:${{ inputs.hana-connector-group }}-sanitation:build

- name: Create lib Directory if not Exists
run: |
cd ballerina
for dir in $(find . -type d -maxdepth 1 -mindepth 1); do
if [[ "$dir" == *resources ]]; then
continue
fi
(cd "$dir" && mkdir -p lib && cd ..);
done
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
scan-type: "rootfs"
scan-ref: "/github/workspace/ballerina/**/lib"
scan-ref: "/github/workspace/ballerina"
format: "table"
timeout: "10m0s"
exit-code: "1"

0 comments on commit 6a833af

Please sign in to comment.