Skip to content

ci: change permissions #5

ci: change permissions

ci: change permissions #5

name: build
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Restore trivy cache
uses: actions/cache@v4
with:
path: cache/db
key: trivy-cache
restore-keys:
trivy-cache
- name: Run Trivy vulnerability scanner in fs mode
uses: aquasecurity/trivy-action@0.24.0
with:
scan-type: 'fs'
scan-ref: '.'
cache-dir: "./cache"
## Trivy-db uses `0600` permissions.
## But `action/cache` doesn't use `root` user
## So we need to change the permissions before caching the database.
- name: change permissions for trivy.db
run: chmod 0644 ./cache/db/trivy.db