Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

[WIP] Add trivy scanning to release workflows. #9

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:

name: Create Release

# Don't run multiple releases concurrently.
concurrency: release

jobs:
build:
name: Release OCI image
Expand All @@ -21,6 +24,29 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: distroless/actions/apko-snapshot@main
id: apko-snapshot
with:
config: .apko.yaml
base-tag: ghcr.io/${{ github.repository }}

- uses: aquasecurity/trivy-action@master
with:
image-ref: ${{ steps.apko-snapshot.outputs.digest }}
format: 'table'
exit-code: '1'
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH,MEDIUM,LOW,UNKNOWN'

# Post to slack when things fail.
- if: ${{ failure() }}
uses: rtCamp/[email protected]
env:
SLACK_ICON: http://github.com/chainguardian.png?size=48
SLACK_USERNAME: chainguardian
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: distroless
SLACK_COLOR: '#8E1600'
MSG_MINIMAL: 'true'
SLACK_TITLE: Releasing ${{ github.repository }} failed.
SLACK_MESSAGE: |
For detailed logs: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}