Skip to content

Commit 2dbf7eb

Browse files
fix: remove trivy from mise tools, self-install in security:image task
All mise GitHub-based backends (aqua, ubi, github) hit API rate limits in CI. Instead, remove trivy from [tools] so it doesn't block other mise operations, and have the security:image task install trivy directly via the official install script (curl from raw.githubusercontent.com), which bypasses the GitHub API entirely.
1 parent f17815e commit 2dbf7eb

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

agent/mise.toml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ semgrep = "latest"
77
uv = "latest"
88
"grype" = "0.109.0"
99
osv-scanner = "latest"
10-
"github:aquasecurity/trivy" = "0.69.2"
1110

1211
[env]
1312
_.python.venv = { path = ".venv", create = true }
@@ -75,10 +74,15 @@ run = [
7574

7675
[tasks."security:image"]
7776
description = "Scan container image with trivy"
78-
run = [
79-
"docker image inspect bgagent-local:latest >/dev/null 2>&1 || (ARCH=\"$(uname -m)\"; PLATFORM=\"linux/arm64\"; if [ \"$ARCH\" = \"x86_64\" ]; then PLATFORM=\"linux/amd64\"; fi; docker build --build-arg TARGETPLATFORM=\"$PLATFORM\" --build-arg CACHE_BUST=\"$(date +%s)\" -t bgagent-local:latest .)",
80-
"trivy image --scanners vuln --ignore-unfixed --ignorefile .trivyignore --severity HIGH,CRITICAL --exit-code 1 bgagent-local:latest",
81-
]
77+
run = '''
78+
#!/usr/bin/env bash
79+
set -euo pipefail
80+
TRIVY_VERSION=v0.69.2
81+
export PATH="$HOME/.local/bin:$PATH"
82+
command -v trivy >/dev/null 2>&1 || (mkdir -p "$HOME/.local/bin" && curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b "$HOME/.local/bin" "$TRIVY_VERSION")
83+
docker image inspect bgagent-local:latest >/dev/null 2>&1 || (ARCH="$(uname -m)"; PLATFORM="linux/arm64"; if [ "$ARCH" = "x86_64" ]; then PLATFORM="linux/amd64"; fi; docker build --build-arg TARGETPLATFORM="$PLATFORM" --build-arg CACHE_BUST="$(date +%s)" -t bgagent-local:latest .)
84+
trivy image --scanners vuln --ignore-unfixed --ignorefile .trivyignore --severity HIGH,CRITICAL --exit-code 1 bgagent-local:latest
85+
'''
8286

8387
[tasks.quality]
8488
description = "Run quality checks"

0 commit comments

Comments
 (0)