The args '--entrypoint=' option clears the Docker image's default entrypoint so Jenkins can invoke pathfinder directly via sh.
Version Pinning
Pin to a specific image tag like shivasurya/code-pathfinder:v2.0.2 instead of stable-latest for reproducible builds. stable-latest always tracks the latest stable release.
Configuration Options
All pathfinder ci flags are available in the shell step.
Flag
Description
Default
--rules
Path to local Python SDK rules file or directory
—
--ruleset
Remote ruleset(s) from registry. Can be specified multiple times.
—
--project
Path to source code to scan
.
--skip-tests
Skip scanning test files
true
--output
Output format: sarif, json, or csv
sarif
--output-file
Write output to file instead of stdout
—
--fail-on
Fail build on severities: critical, high, medium, low (comma-separated)
Use the when directive to run the scan only on pull requests. With a multibranch pipeline or GitHub Branch Source plugin, Jenkins sets the CHANGE_ID environment variable for pull requests:
Use the triggers block with a cron expression to run a weekly security scan on the main branch:
groovy
pipeline { agent { docker { image 'shivasurya/code-pathfinder:stable-latest' args '--entrypoint='}} triggers {// Run every Monday at 02:00 AMcron('0 2 * * 1')} stages {stage('Weekly Security Scan'){ steps { sh '''
pathfinder ci \
--project . \
--ruleset python/all \
--ruleset docker/all \
--ruleset docker-compose/all \
--output sarif \
--output-file pathfinder-results.sarif
'''} post { always { archiveArtifacts artifacts:'pathfinder-results.sarif', allowEmptyArchive:true}}}}}
Troubleshooting
SARIF reporting with Warnings Next Generation plugin
Install the Warnings Next Generation plugin to parse and display SARIF results in the Jenkins build UI. Use recordIssues in the post block alongside archiveArtifacts:
sh '''
pathfinder ci \
--project . \
--ruleset python/all \
--refresh-rules \
--output sarif \
--output-file results.sarif
'''
Docker agent not finding pathfinder binary
If Jenkins fails with pathfinder: command not found, the image's default entrypoint is blocking the sh step. Ensure args '--entrypoint=' is set on the Docker agent — this resets the entrypoint to empty so Jenkins can invoke shell commands inside the container: