Skip to content
shoko

GitHub

One library is one repository, on its default branch. The library is named after the repository, owner/name.

Connect through the Shoko GitHub App

Shoko reads GitHub only through its GitHub App, Shoko on GitHub, public repositories included. You never create, paste or store a token, and there is no way to add a repository by its URL.

  1. In Shoko, Add library, then GitHub. This opens the app on GitHub.
  2. On GitHub, choose the account or organization that owns the repositories, choose Only select repositories and pick the ones Shoko may read (or all of them), and install. If the app is already installed on that account, GitHub shows its settings instead: add or remove repositories there and save.
  3. GitHub asks you to authorize the app. This lets Shoko see which installations and repositories your own GitHub account can access; Shoko does not keep this authorization.
  4. Back in Shoko, Add GitHub repositories lists the repositories, grouped by GitHub account. Tick the ones you want (Select all, Select none, or one by one) and add them. Each becomes a library. Repositories you already added are marked Added.

If GitHub does not bring you back to Shoko, which happens when the app is already installed on the account and you changed nothing, return to Add library in Shoko and use continue to your repositories.

You can connect several GitHub accounts and organizations to one Shoko organization: repeat the steps and choose another account on GitHub. In a GitHub organization, installing needs an organization owner; anyone else sends them a request from the same page.

The whole selection is added, or none of it. On the free plan a selection larger than the room left (see Sync and limits) is refused with the number that fits.

Branch, name and access

  • Branch. Always the repository's default branch. Shoko reads which branch that is at least once a day, so if you change the default branch on GitHub, the library follows within a day.
  • Name. owner/name, as on GitHub. You can rename the library on its page.
  • Who can read it. A new library can be read by everyone in your Shoko organization. Change that on the library's page, under access. See Teams and access.

What the app may do:

  • Read the contents and metadata of the repositories you selected. Nothing else: no issues, pull requests, actions, secrets or settings, and no write access of any kind.
  • At each sync, Shoko asks GitHub for a token that reads only that library's repository and expires within an hour. It is never stored.
  • You can only add repositories your own GitHub account can see. Adding one links the installation to your Shoko organization; another Shoko organization can link the same installation only if one of its own admins proves access the same way.

To stop Shoko reading a repository, remove it from the installation on GitHub, or uninstall the app (Settings, Applications, Installed GitHub Apps, Uninstall). The next sync of every library that used it fails with a message and reads nothing; what was indexed stays searchable until you delete the library. Suspending the installation pauses syncing the same way until it is unsuspended.

If the person who added a library leaves your Shoko organization, the library keeps syncing: it belongs to the organization, and its access comes from the installation on GitHub, not from that person. The library page shows who linked it. Remove the repository from the installation, or delete the library, if that is not what you want.

Shoko never writes to GitHub.

What gets indexed

Text files in the repository: documentation, configuration and source code, at the head of the branch. Each file is indexed under its path in the repository, for example docs/setup.md, with a link to the file on GitHub.

What is skipped

  • Binary files: by extension (images, audio, video, archives, fonts, PDFs, Office files, compiled code, databases, model weights) and by content.
  • Files in dependency, vendored and build directories: node_modules, vendor, bower_components, jspm_packages, Pods, Carthage, .yarn, .pnpm-store, .venv, venv, site-packages, __pycache__, .tox, .bundle, elm-stuff, .terraform, dist, build, out, target, obj, .next, .nuxt, .svelte-kit, .turbo, .parcel-cache, .cache, .gradle, coverage, .nyc_output, DerivedData, __snapshots__, and .git, .hg, .svn, .idea. A directory with one of these names is skipped wherever it is in the tree.
  • Lockfiles, such as package-lock.json, yarn.lock, pnpm-lock.yaml, Cargo.lock, poetry.lock and go.sum, and .DS_Store.
  • Generated files: names ending in .min.js, .min.mjs, .min.css, .bundle.js, .chunk.js, .map, .snap, .pb.go, _pb2.py or .designer.cs, and JavaScript or CSS files whose lines average over 300 characters.
  • Files larger than 1 MB (1,000,000 bytes), and empty files.
  • Files that are not valid UTF-8.
  • Symbolic links, submodules, and Git LFS files (only the pointer is in the repository).

Issues, pull requests, discussions and wikis are not indexed.

The library page shows how many files each sync skipped for size or content. Files skipped by their path are not counted.

How syncing works

Each sync first asks GitHub whether the branch has a new commit. If not, nothing else happens. If it has, Shoko compares the files of the two commits and updates only what changed: new, edited, deleted, moved and renamed files, also after a force push. So at hourly and every-5-minutes syncs, deleted files leave search at the next sync. Once a day Shoko also reads the whole repository. See Sync and limits.

Permissions

Anyone you grant this library to can search all of it. Shoko does not mirror GitHub's own repository permissions. See Teams and access.