Team Repository
Note: github.TeamRepository cannot be used in conjunction with github.RepositoryCollaborators or they will fight over what your policy should be. This resource manages relationships between teams and repositories in your GitHub organization. Creating this resource grants a particular team permissions on a particular repository. The repository and the team must both belong to the same organization on GitHub. This resource does not actually create any repositories; to do that, see
github.Repository
. This resource is non-authoritative, for managing ALL collaborators of a repo, use github.RepositoryCollaborators instead.
Example Usage
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.github.Team;
import com.pulumi.github.TeamArgs;
import com.pulumi.github.Repository;
import com.pulumi.github.TeamRepository;
import com.pulumi.github.TeamRepositoryArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var someTeam = new Team("someTeam", TeamArgs.builder()
.description("Some cool team")
.build());
var someRepo = new Repository("someRepo");
var someTeamRepo = new TeamRepository("someTeamRepo", TeamRepositoryArgs.builder()
.teamId(someTeam.id())
.repository(someRepo.name())
.permission("pull")
.build());
}
}
Import
GitHub Team Repository can be imported using an ID made up of team_id:repository
or team_name:repository
, e.g.
$ pulumi import github:index/teamRepository:TeamRepository terraform_repo 1234567:terraform
$ pulumi import github:index/teamRepository:TeamRepository terraform_repo Administrators:terraform
Properties
The permissions of team members regarding the repository. Must be one of pull
, triage
, push
, maintain
, admin
or the name of an existing custom repository role within the organisation. Defaults to pull
.
The repository to add to the team.