Skip to content

Commit

Permalink
fix(trivy): fixes to trivy config syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
rikukissa committed Oct 29, 2024
1 parent 30b05f9 commit 465c68b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/build-images-from-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,20 @@ jobs:
ref: '${{ github.event.inputs.branch_name }}'

- uses: actions/checkout@v4
if: github.event_name == 'push' || github.event_name == 'pull_request'
if: github.event_name == 'push'
with:
ref: ${{ github.event.pull_request.head.sha }}

- uses: actions/checkout@v4
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Set version and branch
id: set-version-and-branch
run: |
export VERSION=`git log -1 --pretty=format:%h`
echo "Pushing version $VERSION"
echo "version=$VERSION" >> $GITHUB_OUTPUT
if [ "${{ github.event_name }}" == 'push' ]; then
BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
Expand All @@ -48,6 +56,7 @@ jobs:
BRANCH=${{ inputs.branch_name }}
fi
ESCAPED_BRANCH=$(echo $BRANCH | sed 's/[^a-zA-Z0-9_.-]/-/g')
echo "from branch $BRANCH"
echo "branch=$ESCAPED_BRANCH" >> $GITHUB_OUTPUT
- name: Get list of services
Expand Down
7 changes: 4 additions & 3 deletions trivy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ scan:
- sequence-diagrams
- usr/local/share/.cache/yarn/v6/
- home/node/.cache/yarn/v6
skip-files:
- '**/*.dockerignore'
scanners:
- vuln
- misconfig
Expand All @@ -28,8 +30,7 @@ vulnerability:
ignore-unfixed: true
db:
repository: 'ghcr.io/opencrvs/trivy-db'
java:
db:
repository: 'ghcr.io/opencrvs/trivy-java-db'
java-repository: 'ghcr.io/opencrvs/trivy-java-db'

policies-bundle:
repository: 'ghcr.io/opencrvs/trivy-checks'

0 comments on commit 465c68b

Please sign in to comment.