Skip to content

Scan

Scan #1740

Workflow file for this run

---
name: Scan
on:
schedule:
- cron: '0 0 * * *'
env:
IMAGE_NAME: opendatacube/datacube-alchemist
permissions: {}
# When a PR is updated, cancel the jobs from the previous version. Merges
# do not define head_ref, so use run_id to never cancel those jobs.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
cve-scanner:
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: Checkout git
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 0
- name: Get unstable git tag
run: >
echo "UNSTABLE_TAG=$(git describe --tags)" >> $GITHUB_ENV
- name: Log the unstable tag
run: echo $UNSTABLE_TAG
- name: Build unstable + latest Docker image tag
if: github.event_name != 'release'
uses: whoan/docker-build-with-cache-action@d8d3ad518e7ac382b880720d0751815e656fe032 # v8.1.0
with:
image_name: ${{ env.IMAGE_NAME }}
image_tag: ${{ env.UNSTABLE_TAG }},latest
build_extra_args: "--build-arg=ENVIRONMENT=deployment"
push_image_and_stages: false
- name: Run vulnerability scanner
if: github.event_name != 'release'
uses: aquasecurity/trivy-action@b6643a29fecd7f34b3597bc6acb0a98b03d33ff8 # 0.33.1
with:
image-ref: "${{ env.IMAGE_NAME }}:${{ env.UNSTABLE_TAG }}"
format: "table"
exit-code: "1"
severity: "CRITICAL,HIGH"