diff --git a/.github/actions/install-trivy/action.yml b/.github/actions/install-trivy/action.yml new file mode 100644 index 00000000..e1772ec4 --- /dev/null +++ b/.github/actions/install-trivy/action.yml @@ -0,0 +1,10 @@ +name: 'Install Trivy' +description: 'Install Trivy' + +runs: + using: composite + steps: + - name: 'Install Trivy' + shell: bash + run: | + curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin v0.18.3 diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml index 3b355e0a..eac30dae 100644 --- a/.github/workflows/ci-pr.yml +++ b/.github/workflows/ci-pr.yml @@ -124,7 +124,9 @@ jobs: for appdir in $SINKS; do ./build-app.sh . "./$appdir" true done - - name: Scan Jar files + - name: 'Configure: Install Trivy' + uses: ./.github/actions/install-trivy + - name: 'Action: Trivy scan' shell: bash run: | ROOT_DIR=$(realpath $PWD) diff --git a/.github/workflows/common.yml b/.github/workflows/common.yml index 4d4a93f8..7f33f67f 100644 --- a/.github/workflows/common.yml +++ b/.github/workflows/common.yml @@ -385,7 +385,9 @@ jobs: MAVEN_THREADS: ${{ inputs.mavenThreads }} BUILD_VERSION_TYPE: ${{ needs.parameters.outputs.build_version_type }} run: ./build-app.sh "stream-applications" "applications/processor/${{ matrix.app }}" - - name: 'Scan Jar files' + - name: 'Configure: Install Trivy' + uses: ./.github/actions/install-trivy + - name: 'Action: Trivy scan' shell: bash id: scan run: | @@ -532,7 +534,9 @@ jobs: MAVEN_THREADS: ${{ inputs.mavenThreads }} BUILD_VERSION_TYPE: ${{ needs.parameters.outputs.build_version_type }} run: ./build-app.sh "stream-applications" "applications/sink/${{ matrix.app }}" - - name: 'Scan Jar files' + - name: 'Configure: Install Trivy' + uses: ./.github/actions/install-trivy + - name: 'Action: Trivy scan' shell: bash id: scan run: | @@ -680,7 +684,9 @@ jobs: MAVEN_THREADS: ${{ inputs.mavenThreads }} BUILD_VERSION_TYPE: ${{ needs.parameters.outputs.build_version_type }} run: ./build-app.sh "stream-applications" "applications/source/${{ matrix.app }}" - - name: 'Scan Jar files' + - name: 'Configure: Install Trivy' + uses: ./.github/actions/install-trivy + - name: 'Action: Trivy scan' shell: bash id: scan run: |