Skip to content

feat: sysdig update (#12) #32

feat: sysdig update (#12)

feat: sysdig update (#12) #32

Workflow file for this run

name: Analysis
on:
push:
branches: [main]
pull_request:
types: [opened, reopened, synchronize, ready_for_review, converted_to_draft]
schedule:
- cron: "0 11 * * 0" # 3 AM PST = 12 PM UDT, runs sundays
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
backend-tests:
name: Backend Tests
if: (! github.event.pull_request.draft)
runs-on: ubuntu-24.04
timeout-minutes: 15
defaults:
run:
working-directory: backend
steps:
- uses: actions/checkout@v6
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
cache: maven
cache-dependency-path: backend/pom.xml
- name: Build and test
run: ./mvnw -B clean verify
# https://github.com/marketplace/actions/aqua-security-trivy
trivy:
name: Trivy Security Scan
if: (! github.event.pull_request.draft)
continue-on-error: true
permissions:
security-events: write
runs-on: ubuntu-slim
timeout-minutes: 5
steps:
- uses: actions/checkout@v6
- name: Cache Trivy DB
uses: actions/cache@v5
with:
path: .trivycache
key: ${{ runner.os }}-trivy-v0.36.0-cache-v1
restore-keys: |
${{ runner.os }}-trivy-
- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/trivy-action@ed142fd0673e97e23eac54620cfb913e5ce36c25 # v0.36.0
with:
format: "sarif"
output: "trivy-results.sarif"
ignore-unfixed: true
scan-type: "fs"
scanners: "vuln,secret,misconfig"
severity: "CRITICAL,HIGH"
trivyignores: ".github/.trivyignore"
cache-dir: .trivycache
skip-dirs: "**/node_modules,**/coverage,**/dist,.git"
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v4
with:
category: "trivy"
sarif_file: "trivy-results.sarif"
# ==========================================================================
# WARNING: This job acts as the required merge gate for this workflow.
# If you add a new job to this workflow, you MUST add its ID to the 'needs'
# array below, otherwise its failure or cancellation will not block the PR!
# ==========================================================================
results:
name: Analysis Results
needs: [backend-tests]
if: always() && (! github.event.pull_request.draft)
runs-on: ubuntu-slim
timeout-minutes: 1
steps:
- name: Log Job Results Context
run: |
echo "=== Upstream Job Statuses ==="
echo '${{ toJson(needs) }}'
- name: Evaluate Overall Status
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: |
echo "❌ Critical Check Failure: At least one required job has failed or was cancelled."
exit 1
- name: Success Message
run: echo "✅ All critical checks passed or were intentionally skipped!"