Skip to content

Commit 9069479

Browse files
authored
fix(security): treat 'no package sources' as pass in osv-scanner (#11)
osv-scanner v2 exits 128 when a target has no package manifests (e.g. scripts-only repos like resq-software/dev). That's not a failure — it just means there's nothing to scan. Map 128 → exit 0 and leave all other exit codes as-is.
1 parent 3dfbe86 commit 9069479

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/security-scan.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,16 @@ jobs:
140140
run: |
141141
set -euxo pipefail
142142
go install github.com/google/osv-scanner/v2/cmd/osv-scanner@v2.3.5
143-
"$(go env GOPATH)/bin/osv-scanner" scan source --recursive ./
143+
# Exit 128 from osv-scanner = "no package sources found"; treat as
144+
# success for scripts-only / manifest-free repos.
145+
"$(go env GOPATH)/bin/osv-scanner" scan source --recursive ./ || {
146+
rc=$?
147+
if [ "$rc" -eq 128 ]; then
148+
echo "osv-scanner: no package sources in this repo — skipping."
149+
exit 0
150+
fi
151+
exit "$rc"
152+
}
144153
145154
# ── Dependency Review (PR only) ───────────────────────────────────────────
146155
dependency-review:

0 commit comments

Comments
 (0)