Skip to content

Merge pull request #43 from ioaiaaii/feat/fontend-otel-instrumentation #6

Merge pull request #43 from ioaiaaii/feat/fontend-otel-instrumentation

Merge pull request #43 from ioaiaaii/feat/fontend-otel-instrumentation #6

Workflow file for this run

name: Cache Update on Master
on:
push:
branches:
- master
paths:
- go.mod
- '**.go'
jobs:
cache-go-modules:
name: Cache Go Modules
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache Go Modules
id: go-mod-cache
uses: actions/cache@v4
with:
path: |
vendor
~/go/pkg/mod
key: go-mod-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
go-mod-${{ runner.os }}-
- name: Sync Go Modules (if cache is not hit)
if: steps.go-mod-cache.outputs.cache-hit != 'true'
run: make go-mod-sync
cache-trivy:
name: Cache Trivy Database
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
submodules: recursive
- id: trivy-db
name: Check Trivy DB SHA
env:
GH_TOKEN: ${{ github.token }}
run: |
endpoint='/orgs/aquasecurity/packages/container/trivy-db/versions'
headers='Accept: application/vnd.github+json'
jqFilter='.[] | select(.metadata.container.tags[] | contains("latest")) | .name | sub("sha256:";"")'
sha=$(gh api -H "${headers}" "${endpoint}" | jq --raw-output "${jqFilter}")
echo "Trivy DB sha256:${sha}"
echo "SHA=${sha}" >> "$GITHUB_OUTPUT"
- name: Cache Trivy Database
id: trivy-cache
uses: actions/cache@v4
with:
path: trivy/.cache
key: trivy-db-${{ runner.os }}-${{ steps.trivy-db.outputs.SHA }}
restore-keys: |
trivy-db-${{ runner.os }}-
- name: Initialize Trivy Database (if needed)
if: steps.trivy-cache.outputs.cache-hit != 'true'
run: make trivy-scan TRIVY_ARGS="fs --download-db-only --cache-dir trivy/.cache"