fix ci fallback shell syntax in workflow reports

This commit is contained in:
Clément SAILLANT
2026-02-21 02:15:48 +01:00
parent 69edf6bff4
commit 2db1c25bdf
10 changed files with 17 additions and 51 deletions
+1 -3
View File
@@ -17,9 +17,7 @@ jobs:
if [ -f tools/api/run_contract_tests.py ]; then
python tools/api/run_contract_tests.py > docs/api-contract-report.json
else
cat > docs/api-contract-report.json <<'JSON'
{"status":"skipped","reason":"missing tools/api/run_contract_tests.py"}
JSON
echo '{"status":"skipped","reason":"missing tools/api/run_contract_tests.py"}' > docs/api-contract-report.json
fi
- name: Upload API contract report
uses: actions/upload-artifact@v4
+2 -6
View File
@@ -31,13 +31,9 @@ jobs:
coverage json -o docs/coverage-summary.json || true
if [ ! -s docs/coverage-summary.json ]; then
if [ "$rc" -eq 5 ]; then
cat > docs/coverage-summary.json <<'JSON'
{"status":"skipped","reason":"no pytest tests collected"}
JSON
echo '{"status":"skipped","reason":"no pytest tests collected"}' > docs/coverage-summary.json
else
cat > docs/coverage-summary.json <<'JSON'
{"status":"ok","reason":"coverage json not generated"}
JSON
echo '{"status":"ok","reason":"coverage json not generated"}' > docs/coverage-summary.json
fi
fi
- name: Scan RFC2119 compliance
@@ -17,9 +17,7 @@ jobs:
if [ -f tools/community/check_health.py ]; then
python tools/community/check_health.py > docs/community-health-report.json
else
cat > docs/community-health-report.json <<'JSON'
{"status":"skipped","reason":"missing tools/community/check_health.py"}
JSON
echo '{"status":"skipped","reason":"missing tools/community/check_health.py"}' > docs/community-health-report.json
fi
- name: Scanner accessibilité doc/UI
run: |
@@ -27,9 +25,7 @@ jobs:
if [ -f tools/accessibility/a11y_linter.py ]; then
python tools/accessibility/a11y_linter.py docs/ > docs/accessibility-report.json
else
cat > docs/accessibility-report.json <<'JSON'
{"status":"skipped","reason":"missing tools/accessibility/a11y_linter.py"}
JSON
echo '{"status":"skipped","reason":"missing tools/accessibility/a11y_linter.py"}' > docs/accessibility-report.json
fi
- name: Upload reports
uses: actions/upload-artifact@v4
+1 -3
View File
@@ -17,9 +17,7 @@ jobs:
if [ -f tools/evidence/validate_evidence_pack.py ]; then
python tools/evidence/validate_evidence_pack.py > docs/evidence-pack-report.json
else
cat > docs/evidence-pack-report.json <<'JSON'
{"status":"skipped","reason":"missing tools/evidence/validate_evidence_pack.py"}
JSON
echo '{"status":"skipped","reason":"missing tools/evidence/validate_evidence_pack.py"}' > docs/evidence-pack-report.json
fi
- name: Upload evidence pack report
uses: actions/upload-artifact@v4
+1 -3
View File
@@ -17,9 +17,7 @@ jobs:
if [ -f tools/security/check_policy.py ]; then
python tools/security/check_policy.py > docs/security-policy-report.json
else
cat > docs/security-policy-report.json <<'JSON'
{"status":"skipped","reason":"missing tools/security/check_policy.py"}
JSON
echo '{"status":"skipped","reason":"missing tools/security/check_policy.py"}' > docs/security-policy-report.json
fi
- name: Upload security policy report
uses: actions/upload-artifact@v4
+1 -3
View File
@@ -17,9 +17,7 @@ jobs:
if [ -f tools/ai/validate_model.py ]; then
python tools/ai/validate_model.py > docs/model-validation-report.json
else
cat > docs/model-validation-report.json <<'JSON'
{"status":"skipped","reason":"missing tools/ai/validate_model.py"}
JSON
echo '{"status":"skipped","reason":"missing tools/ai/validate_model.py"}' > docs/model-validation-report.json
fi
- name: Upload model validation report
uses: actions/upload-artifact@v4
+2 -6
View File
@@ -17,9 +17,7 @@ jobs:
if [ -f tools/benchmarks/run_benchmarks.py ]; then
python tools/benchmarks/run_benchmarks.py > docs/performance-report.json
else
cat > docs/performance-report.json <<'JSON'
{"status":"skipped","reason":"missing tools/benchmarks/run_benchmarks.py"}
JSON
echo '{"status":"skipped","reason":"missing tools/benchmarks/run_benchmarks.py"}' > docs/performance-report.json
fi
- name: Upload performance report
uses: actions/upload-artifact@v4
@@ -36,9 +34,7 @@ jobs:
if [ -f tools/hil/run_hil_tests.py ]; then
python tools/hil/run_hil_tests.py > docs/hil-report.json
else
cat > docs/hil-report.json <<'JSON'
{"status":"skipped","reason":"missing tools/hil/run_hil_tests.py"}
JSON
echo '{"status":"skipped","reason":"missing tools/hil/run_hil_tests.py"}' > docs/hil-report.json
fi
- name: Upload HIL report
uses: actions/upload-artifact@v4
+4 -12
View File
@@ -17,9 +17,7 @@ jobs:
if command -v cyclonedx-bom >/dev/null 2>&1; then
cyclonedx-bom -o docs/sbom-cyclonedx.json
else
cat > docs/sbom-cyclonedx.json <<'JSON'
{"status":"skipped","reason":"cyclonedx-bom not installed"}
JSON
echo '{"status":"skipped","reason":"cyclonedx-bom not installed"}' > docs/sbom-cyclonedx.json
fi
- name: Générer SBOM SPDX
run: |
@@ -27,9 +25,7 @@ jobs:
if command -v spdx-sbom-generator >/dev/null 2>&1; then
spdx-sbom-generator -o docs/sbom-spdx.json
else
cat > docs/sbom-spdx.json <<'JSON'
{"status":"skipped","reason":"spdx-sbom-generator not installed"}
JSON
echo '{"status":"skipped","reason":"spdx-sbom-generator not installed"}' > docs/sbom-spdx.json
fi
- name: Valider SBOM (Trivy)
run: |
@@ -37,9 +33,7 @@ jobs:
if command -v trivy >/dev/null 2>&1; then
trivy sbom docs/sbom-cyclonedx.json --format json --output docs/sbom-trivy-report.json
else
cat > docs/sbom-trivy-report.json <<'JSON'
{"status":"skipped","reason":"trivy not installed"}
JSON
echo '{"status":"skipped","reason":"trivy not installed"}' > docs/sbom-trivy-report.json
fi
- name: Valider SBOM (Snyk)
run: |
@@ -47,9 +41,7 @@ jobs:
if command -v snyk >/dev/null 2>&1; then
snyk test --file=docs/sbom-cyclonedx.json --json > docs/sbom-snyk-report.json || true
else
cat > docs/sbom-snyk-report.json <<'JSON'
{"status":"skipped","reason":"snyk not installed"}
JSON
echo '{"status":"skipped","reason":"snyk not installed"}' > docs/sbom-snyk-report.json
fi
- name: Upload SBOM & reports
uses: actions/upload-artifact@v4
+2 -6
View File
@@ -17,9 +17,7 @@ jobs:
if command -v gitleaks >/dev/null 2>&1; then
gitleaks detect --source . --report docs/secret-scan-report.json --exit-code 0
else
cat > docs/secret-scan-report.json <<'JSON'
{"status":"skipped","reason":"gitleaks not installed"}
JSON
echo '{"status":"skipped","reason":"gitleaks not installed"}' > docs/secret-scan-report.json
fi
- name: Scan secrets (TruffleHog)
run: |
@@ -27,9 +25,7 @@ jobs:
if command -v trufflehog >/dev/null 2>&1; then
trufflehog filesystem . --json > docs/trufflehog-report.json || true
else
cat > docs/trufflehog-report.json <<'JSON'
{"status":"skipped","reason":"trufflehog not installed"}
JSON
echo '{"status":"skipped","reason":"trufflehog not installed"}' > docs/trufflehog-report.json
fi
- name: Upload reports
uses: actions/upload-artifact@v4
+1 -3
View File
@@ -20,9 +20,7 @@ jobs:
if command -v slsa-generator >/dev/null 2>&1; then
slsa-generator provenance --output docs/supplychain-attestation.json
else
cat > docs/supplychain-attestation.json <<'JSON'
{"status":"skipped","reason":"slsa-generator not installed"}
JSON
echo '{"status":"skipped","reason":"slsa-generator not installed"}' > docs/supplychain-attestation.json
fi
- name: Sign artefacts (cosign)
run: |