Skip to content
This repository was archived by the owner on Feb 18, 2026. It is now read-only.

Commit f43dbf3

Browse files
fix: correct Safety command output option
Fix Safety scan command syntax: - Change from: --json --output safety-report.json - Change to: --output json > safety-report.json The --output option accepts format types (json, text, etc.) not file paths. Use shell redirection for file output.
1 parent fc4f742 commit f43dbf3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

.github/workflows/security-weekly.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,12 @@ jobs:
5656
run: |
5757
echo "🔍 Safety脆弱性スキャン実行中..."
5858
59-
if uv run safety check -r requirements.txt --json --output safety-report.json; then
59+
# Safetyの出力をJSON形式でファイルに保存
60+
if uv run safety check -r requirements.txt --output json > safety-report.json 2>&1; then
6061
echo "✅ 脆弱性は検出されませんでした"
6162
echo "vulnerabilities=0" >> $GITHUB_OUTPUT
6263
else
64+
# エラー終了コードは脆弱性検出を意味する
6365
VULN_COUNT=$(jq '.vulnerabilities | length' safety-report.json 2>/dev/null || echo "0")
6466
echo "vulnerabilities=$VULN_COUNT" >> $GITHUB_OUTPUT
6567
echo "⚠️ $VULN_COUNT 件の脆弱性が検出されました"

0 commit comments

Comments
 (0)