Skip to content

Commit

Permalink
ENG-1122 improvement: generate scan jobs only for uniq products (#662)
Browse files Browse the repository at this point in the history
  • Loading branch information
vorsel authored Aug 23, 2022
1 parent 11e81d6 commit 283408b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/trivy_scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ jobs:
run: |
set -o xtrace
strategy='{"fail-fast":false,"matrix":{"include":[]}}'
files=$(git --no-pager diff --name-only origin/${{ github.base_ref }} ${{ github.sha }})
products=$( git --no-pager diff --name-only origin/${{ github.base_ref }} ${{ github.sha }} | cut -d '/' -f 1 | uniq )
for file in ${files}; do
product_name=$(echo ${file} | cut -d '/' -f 1)
for product_name in ${products}; do
if [ -d "${product_name}" ] && [ -f "${product_name}/Dockerfile" ]; then
docker_tag="percona/${product_name}:${{ github.sha }}"
docker_build="docker build --no-cache -t ${docker_tag} ${product_name}"
Expand Down

0 comments on commit 283408b

Please sign in to comment.