Skip to content

Commit

Permalink
Merge pull request #29 from ballerina-platform/NipunaRanasinghe-patch-1
Browse files Browse the repository at this point in the history
Update trivy scan to use the centralized workflow
  • Loading branch information
NipunaRanasinghe authored Oct 14, 2024
2 parents a168cf9 + e8cc5ed commit d8a4a16
Showing 1 changed file with 6 additions and 41 deletions.
47 changes: 6 additions & 41 deletions .github/workflows/trivy-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,11 @@ name: Trivy
on:
workflow_dispatch:
schedule:
- cron: '30 20 * * *'
- cron: "30 20 * * *"

jobs:
ubuntu-build:
name: Build on Ubuntu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 17.0.7
- name: Build with Gradle
env:
packageUser: ${{ github.actor }}
packagePAT: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew build -x check -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'
format: 'table'
timeout: '10m0s'
exit-code: '1'
- name: Notify failure
if: ${{ failure() }}
run: |
curl -X POST \
'https://api.github.com/repos/ballerina-platform/ballerina-release/dispatches' \
-H 'Accept: application/vnd.github.v3+json' \
-H 'Authorization: Bearer ${{ secrets.BALLERINA_BOT_TOKEN }}' \
--data "{
\"event_type\": \"notify-trivy-failure\",
\"client_payload\": {
\"repoName\": \"module-ballerinax-oracledb.driver\",
\"workflow\": \"Trivy\"
}
}"
call_workflow:
name: Run Trivy Scan Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-library/.github/workflows/trivy-scan-template.yml@main
secrets: inherit

0 comments on commit d8a4a16

Please sign in to comment.