One can use Code PathFinder as a part of your CI/CD pipeline to scan your code for vulnerabilities.
The code-pathfinder docker image is available on Docker Hub .
name : Code-Pathfinder SAST Scan
uses : actions/checkout@v4
- name : Code-Pathfinder SAST Scan
uses : shivasurya/code-pathfinder@main
output-file : ' output.sarif '
echo "SARIF file content:"
cat $GITHUB_WORKSPACE/output.sarif
name : shivasurya/code-pathfinder:stable-latest
stage : code-pathfinder-sast
- echo "Running Code-Pathfinder SAST Scan..."
- pathfinder ci --project . --output-file output.sarif --output sarif --ruleset cpf/java
- echo "SARIF file content:"
image : shivasurya/code-pathfinder:stable-latest
name : Run Code-Pathfinder SAST Scan
- echo "Running Code-Pathfinder SAST Scan..."
- pathfinder ci --project '.' --output-file 'output.sarif' --output 'sarif' --ruleset 'cpf/java'
- echo "SARIF file content:"
- image : shivasurya/code-pathfinder:stable-latest
name : Run Code-Pathfinder SAST Scan
echo "Running Code-Pathfinder SAST Scan..."
pathfinder ci --project . --output-file output.sarif --output sarif --ruleset cpf/java || true
echo "SARIF file content:"
cat output.sarif || echo "No SARIF file found"
destination : output.sarif
- job : CodePathfinderSAST
echo "Running Code-Pathfinder SAST Scan..."
docker run --rm -v $(System.DefaultWorkingDirectory):/workspace -w /workspace shivasurya/code-pathfinder:stable-latest ci --project . --output-file output.sarif --output sarif --ruleset cpf/java
displayName : ' Run SAST Scan with Docker '
echo "SARIF file content:"
cat output.sarif || echo "No SARIF file found"
displayName : ' Read SARIF File '
- task : PublishBuildArtifacts@1
PathtoPublish : ' output.sarif '
ArtifactName : ' SARIF Report '