This repository has been archived by the owner on Nov 1, 2024. It is now read-only.
Update README.md #30
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: "Horusec SAST Scan" | |
on: [push] | |
jobs: | |
horusec-security: | |
name: horusec-security | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Create Horusec Configuration | |
run: | | |
echo '{}' > horusec-config.json | |
# overwrite old config if it exists. | |
- name: Running Horusec Security | |
run: | | |
curl -fsSL https://raw.githubusercontent.com/ZupIT/horusec/main/deployments/scripts/install.sh | bash -s latest | |
horusec start -p . -D -o="json" -O="./horusec-results.json" | |
- name: Upload Horusec Results | |
uses: actions/upload-artifact@v2 | |
with: | |
name: horusec-results | |
path: horusec-results.json | |
- name: Check for vulnerabilities | |
id: check_vulnerabilities | |
run: | | |
if [ -s horusec-results.json ]; then | |
VULNS_FOUND=$(jq '.analysisVulnerabilities | length' horusec-results.json) | |
if [ "$VULNS_FOUND" -gt "0" ]; then | |
echo "::error ::Vulnerabilities found" | |
exit 1 | |
else | |
echo "No vulnerabilities found" | |
fi | |
else | |
echo "::error ::horusec-results.json not found or is empty" | |
exit 1 | |
fi |