Connect GitHub

Let ProofLayer read your GitHub organisation’s settings, members and repositories to prove two-factor sign-in and protected branches.

15 minYou need: An owner of your GitHub organisation

Before you start

GitHub is where your developers keep source code. ProofLayer reads your organisation’s security settings and each repository’s rules to show that code is protected. ProofLayer only reads. It never changes code or settings.

WordWhat it means
Organisation loginThe name in your GitHub address, for example acme in github.com/acme.
Fine-grained tokenA long code that lets a program read specific parts of your organisation, with a built-in expiry. GitHub calls this a personal access token.
GitHub AppAn application you install into your organisation from GitHub, which then asks GitHub for short-lived access. No long-lived secret is stored.

There are two routes. Open the connection (step 2 below) and look at the GitHub access card: if it has a tab called Install ProofLayer’s GitHub App, you can use Route A. Otherwise use Route B.

Create the connection

  1. Add the connection

    In ProofLayer go to Connections → New connection. For Provider choose GitHub, give it a Name such as “Engineering GitHub org”, and enter your Organisation login (for example acme). Press Create.

  2. Open it

    Click the new connection in the list. The GitHub access card holds the next steps.

Route A: install the ProofLayer GitHub App

  1. Press Install on GitHub

    GitHub opens. Choose your organisation and the repositories the App may read (all repositories is simplest).

  2. Confirm

    GitHub sends you back to ProofLayer with App installation recorded. No secret was created on either side.

Route B: use your own fine-grained token

  1. Start a new token

    On GitHub click your profile picture, then Settings → Developer settings → Personal access tokens → Fine-grained tokens → Generate new token.

  2. Name it and choose the organisation

    Call it “ProofLayer read-only”. For Resource owner choose your organisation, not your own username. Pick an expiry (long enough to be practical, short enough to be safe).

  3. Choose the repositories

    Under Repository access choose All repositories.

  4. Tick eight read-only permissions

    Under Permissions, set each of these to Read-only:

    Permissions to tick (all Read-only)
    Repository: Metadata
    Repository: Administration
    Repository: Pull requests
    Repository: Commit statuses
    Repository: Checks
    Repository: Deployments
    Organization: Members
    Organization: Administration

    Press Generate token and copy it straight away. GitHub shows it once.

  5. Paste it into ProofLayer

    On the connection page open the tab Use your own token, paste the token into Token and press Save token.

    Using GitHub Enterprise Server? Change API base URL to your server’s address, for example https://ghe.example.com/api/v3. Leave it alone for github.com.

Check that it works

  1. Open the connection in ProofLayer

    Go to Connections, click the connection you just made, and find the card called GitHub access.

  2. Press Test access

    ProofLayer makes one small read-only request and shows the answer.

    Success looks like a green Access verified message. A red Access test failed message says what went wrong; see the table at the end of this page.

What ProofLayer reads

  • Whether your organisation requires two-factor authentication, and whether every member actually has it on.
  • Whether ordinary members can create public repositories, and the default permission members get on repositories.
  • Whether each active repository protects its default branch, requires a review before merging, and forbids force-pushing or deleting it.
  • Whether Dependabot vulnerability alerts are on for each active repository.
  • Each pull request merged into a default branch in the last 35 days: who approved it (not its author, and not a bot), whether its checks passed, and whether its title or branch names a ticket. ProofLayer keeps the pull request number, link, people and results, never its title or description.
  • Each successful deployment to a production environment in the last 35 days: who ran it and which merged pull requests it shipped. An environment counts as production when GitHub marks it so (for Actions, the environment named production, or one set with the production_environment flag).

If something goes wrong

What you seeLikely causeWhat to do
GitHub refuses the token (401 or 403)Wrong token, expired, or it was created for your own account rather than the organisation.Create a new token with Resource owner set to the organisation.
“Could not observe” on two-factor checksThe token’s owner is not an organisation owner.Create the token as an owner, or install the App as an owner.
Repositories are missingThe token or App can only see some repositories.Give it access to All repositories.
Cannot reach the serverA self-hosted GitHub whose address is wrong.Fix API base URL (it ends in /api/v3).