Skip to content

LPF-513 - snyk on timer #6

LPF-513 - snyk on timer

LPF-513 - snyk on timer #6

name: Scan docker image
on:
workflow_dispatch:
push: #remove
schedule:
# branches:
# - main
# Run at 7:30AM UTC every day
- cron: '15 20 * * *'
jobs:
scan-docker-image:
permissions:
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
runs-on: ubuntu-latest
steps:
# - name: Checkout GitHub repository
# uses: actions/checkout@v4
# - name: Build with Maven
# run: mvn -B -DskipTests clean package
# shell:
# bash
#
# - name: Build a Docker image
# run: |
# docker build \
# -t app .
# - name: Run Snyk to check Docker image for vulnerabilities
# # Snyk can be used to break the build when it detects vulnerabilities.
# # In this case we want to upload the issues to GitHub Code Scanning
# continue-on-error: true
# uses: snyk/actions/[email protected]
# env:
# # In order to use the Snyk Action you will need to have a Snyk API token.
# # More details in https://github.com/snyk/actions#getting-your-snyk-token
# # or you can signup for free at https://snyk.io/login
# SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
# with:
# image: app
# args: --file=Dockerfile --severity-threshold=low --sarif-file-output=snyk.sarif
#
# #https://github.com/github/codeql-action/issues/2187
# - name: Replace security-severity undefined for license-related findings
# run: |
# sed -i "s/\"security-severity\": \"undefined\"/\"security-severity\": \"0\"/g" snyk.sarif
# sed -i "s/\"security-severity\": \"null\"/\"security-severity\": \"0\"/g" snyk.sarif
# - name: Upload result to GitHub Code Scanning
# uses: github/codeql-action/upload-sarif@v3
# with:
# sarif_file: snyk.sarif
- uses: ministryofjustice/laa-reusable-github-actions/.github/workflows/snyk.yml@main
with:
tag: "payforlegalaid"
secrets:
snyk_token: ${{ secrets.SNYK_TOKEN }}