build-tools/.github/workflows/push-code-scan.yml
2025-02-15 17:52:10 +05:30

40 lines
973 B
YAML

name: Image Vulnerability Scan
# Secrets can only viewed in "push" events. Not pull_request events.
# That's why this step needs to be called on push, and not on pull_request (to read docker login password).
on:
workflow_call:
env:
REPO: ${{ github.repository }}/temp #Add /temp for temporary images
jobs:
push-container-scan:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: ${{ vars.NPM_REGISTRY }}
token: ${{ secrets.NPM_TOKEN }}
- name: Install npm dependencies
run: |
npm install -g pnpm
pnpm install
- name: Scan container image for vulnerabilities with grype
uses: anchore/scan-action@v6
with:
path: "."
cache-db: true #Cache Grype DB in Github Actions
output-format: table
only-fixed: true
severity-cutoff: critical
fail-build: true