forkguarddocs

forkguard --mine

Check every repo you own on GitHub, every branch.

On this page

#Name

forkguard --mine checks every repository you own on GitHub, every branch, using the same safe method as `forkguard owner/repo`.

forkguard --mine - check all repositories you own

#Synopsis

forkguard --mine
forkguard --mine --json
forkguard --mine [--json]

#Description

This is the fastest way to know whether your whole GitHub is clean. Run it once now, and again whenever you hear about a new attack. It lists your repos, then checks four at a time. About 50 repos takes a minute or two.

It checks repos you own, including forks and archived repos. Repos in organizations where you are only a member or collaborator are not included.

#You need to be logged in

Either log in with the GitHub CLI:

gh auth login

or set a GITHUB_TOKEN (or GH_TOKEN) environment variable with a personal access token. Without either you get: “Log in first so forkguard can list your repos”.

Lists repositories with affiliation=owner via gh or the GitHub API, then runs the remote check on each, four at a time.

Requires gh auth login, or GITHUB_TOKEN / GH_TOKEN.

#Output

Output
forkguard  checking 54 of your repos on GitHub, every branch

  clean            you/portfolio
  INFECTED         you/old-project
  worth a look     you/side-project
  clean            you/vector
  ...

  54 repos checked: 52 clean, 1 infected

Then you get the full details for every repo that is not clean.

StatusMeaning
cleanNothing found on any branch.
INFECTEDSomething HIGH on at least one branch.
worth a lookOnly MED findings.
could not checkThe download failed, usually because of access.
StatusMeaning
cleanno findings
INFECTEDHIGH on some branch
worth a lookMED only
could not checkdownload failed

#Options

--json
Print a list of repo results, one per repo, instead of text. See JSON output.
--json
array of per-repo results

#Exit status

CodeMeaning
0Clean, or only MED findings.
1Something HIGH was found.
2forkguard itself could not run, for example when you are not logged in.

The same codes work in scripts and CI. See Exit codes.

0   clean, or MED findings only
1   a HIGH finding
2   error (for example when you are not logged in)

#Examples

forkguard --mine

Only list the repos that are infected, using jq:

forkguard --mine --json | jq -r '.[] | select(.branches // [] | any(.findings[]?; .level == "high")) | .name'
forkguard --mine
forkguard --mine --json

#See also

Where to next

Edit this page on GitHub View as Markdown

Type to search. Use the arrow keys and Enter.