forkguarddocs

Exit codes

Three codes, so scripts and CI can react.

On this page
CodeMeaningTypical cause
0Clean, or only MED findings.Nothing dangerous was found.
1Something HIGH was found.A dangerous finding. Also returned by fix when something HIGH is still left.
2forkguard itself could not run.A folder that does not exist, a repo it could not download, not being logged in for --mine.

#Use it in a script

if ! forkguard ./app; then
  echo "forkguard found something, stopping"
  exit 1
fi

Because MED findings exit 0, they never fail a build. Only HIGH findings do.

#In the shell hooks

For automatic protection, only 1 stops a command. If forkguard exits 2 or is missing, your command runs anyway.

Where to next

Edit this page on GitHub View as Markdown

Type to search. Use the arrow keys and Enter.