Skip to content

Skip leading step comments. #34

Skip leading step comments.

Skip leading step comments. #34

Workflow file for this run

# Copyright the DMorph contributors.
# SPDX-License-Identifier: MPL-2.0
name: Security
on:
push:
branches:
- master
pull_request:
branches:
- master
# Declare default permissions as read only.
permissions: read-all
jobs:
TrivyCode:
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
with:
egress-policy: audit
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/trivy-action@6c175e9c4083a92bbca2f9724c8a5e33bc2d97a5 # 0.30.0
with:
scan-type: 'fs'
ignore-unfixed: true
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'CRITICAL'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
with:
sarif_file: 'trivy-results.sarif'
VulnerabilityCheck:
strategy:
matrix:
go-version:
- "1.24"
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 1
- name: VulnerabilityCheck
uses: golang/govulncheck-action@b625fbe08f3bccbe446d94fbf87fcc875a4f50ee # v1.0.4
with:
go-version-input: ${{matrix.go-version}}
output-format: sarif
output-file: govulncheck-results.sarif
- name: PrintSarif
run: |
cat govulncheck-results.sarif
if [ grep results govulncheck-results.serif ]
then
echo "hasResults=true" >> $GITHUB_OUTPUT
else
echo "hasResults=false" >> $GITHUB_OUTPUT
fi
- name: Upload govulncheck results to GitHub Security tab
if: ${{ steps.PrintSarif.outputs.hasResults == 'true' }}
uses: github/codeql-action/upload-sarif@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
with:
sarif_file: govulncheck-results.sarif