Tooling rehaul: introduce ARM64 release; use git tags instead of production
branch for releases
#76
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Trivy | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
schedule: | |
- cron: "19 7 * * 0" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
trivy: | |
name: 🔐 Trivy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: { fetch-depth: 0 } | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: { go-version: "1.20" } | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v5 | |
with: | |
version: latest | |
args: release --snapshot | |
env: | |
BUGSNAG_API_KEY: "REAL_KEY_NOT_NEEDED_HERE" | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: "linux/amd64,linux/arm64" | |
- name: Build Docker image | |
run: | | |
docker build --platform linux/amd64 -t spacelift-vcs-agent:${{ github.sha }}-amd64 . | |
docker build --platform linux/arm64 -t spacelift-vcs-agent:${{ github.sha }}-arm64 . | |
- name: Run Trivy vulnerability scanner (amd64) | |
uses: aquasecurity/trivy-action@master | |
with: | |
image-ref: "spacelift-vcs-agent:${{ github.sha }}-amd64" | |
format: "sarif" | |
output: "trivy-results-amd64.sarif" | |
severity: "CRITICAL,HIGH" | |
- name: Run Trivy vulnerability scanner (arm64) | |
uses: aquasecurity/trivy-action@master | |
with: | |
image-ref: "spacelift-vcs-agent:${{ github.sha }}-arm64" | |
format: "sarif" | |
output: "trivy-results-arm64.sarif" | |
severity: "CRITICAL,HIGH" | |
- name: Upload Trivy scan results to GitHub Security tab (amd64) | |
uses: github/codeql-action/upload-sarif@v2 | |
with: | |
sarif_file: "trivy-results-amd64.sarif" | |
category: "Trivy (amd64)" | |
- name: Upload Trivy scan results to GitHub Security tab (arm64) | |
uses: github/codeql-action/upload-sarif@v2 | |
with: | |
sarif_file: "trivy-results-arm64.sarif" | |
category: "Trivy (arm64)" |