Skip to content
Source
Sign inSign up

Mix public and private members

Code and repositories / Monorepos

Mix public and private members

Your public library and your private service belong in one monorepo, but people who see only the library must not learn that the service exists. The forge shows a monorepo only to people who can see every private member.

3 min read

So everyone who sees the monorepo can see all of it.

The rules

  • A public monorepo has public members only.
  • A private monorepo can have public and private members.
  • A person sees a private monorepo only while they can read the monorepo and every private member.

Each member keeps its own access. A public member stays public, and its page does not name the monorepos that it is in.

1. Make a private monorepo with a private member

  1. Make the monorepo private first, in its Settings.
  2. In its Settings, click Monorepo under Code, and add the private repository. See Add and remove members.

Note

A public monorepo refuses a private member.

2. Give people access

Give each person read access to the monorepo and to each private member. For a team, give the same access to the team on each repository. See Bring your team.

Important

A person without access to one private member cannot see the monorepo.

Done

People with access to all private members see the monorepo, its members and its search. Everyone else sees only the public members, as normal repositories.

An example

acme/platform is private. Its members are acme/web (public) and acme/billing (private).

PersonAccessSees acme/platform
AliceOwner of acmeYes
WendyRead on acme/platform and on acme/billingYes
OscarWrite on acme/platform, nothing on acme/billingNo
RitaRead on acme/billing onlyNo

Oscar gets the normal "not found" page for acme/platform. Oscar still sees acme/web, because it is public.

What the forge refuses

  • Make a monorepo public while it has a private member: the forge refuses. Remove the private members, or make them public first.
  • Make a member of a public monorepo private: the forge refuses. Remove it from the monorepo first. The message names the monorepo, because a public monorepo is visible to all.
  • Add a private member to a public monorepo: the forge refuses.

Public discovery uses anonymous access, even for a signed-in owner. If a public monorepo has a private member after concurrent changes, discovery hides it. This includes rankings, topics, public repository cards, repository awards and repository medals. A public monorepo with public members stays visible.

When access changes

  • A person who loses read access to one private member loses the monorepo at their next request.
  • An admin who removes a member that they cannot read gets the answer "not a member". A guessed name confirms nothing.
  • Agent sessions and scoped tokens follow the same rule. They never get more access than their person. See Give an agent a monorepo.