1. Packages
  2. Github Provider
  3. API Docs
  4. getRepositoryTeams
GitHub v6.7.0 published on Friday, Feb 28, 2025 by Pulumi

github.getRepositoryTeams

Explore with Pulumi AI

Use this data source to retrieve the list of teams which have access to a GitHub repository.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";

const example = github.getRepositoryTeams({
    name: "example",
});
Copy
import pulumi
import pulumi_github as github

example = github.get_repository_teams(name="example")
Copy
package main

import (
	"github.com/pulumi/pulumi-github/sdk/v6/go/github"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := github.GetRepositoryTeams(ctx, &github.GetRepositoryTeamsArgs{
			Name: pulumi.StringRef("example"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;

return await Deployment.RunAsync(() => 
{
    var example = Github.GetRepositoryTeams.Invoke(new()
    {
        Name = "example",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.github.GithubFunctions;
import com.pulumi.github.inputs.GetRepositoryTeamsArgs;
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) {
        final var example = GithubFunctions.getRepositoryTeams(GetRepositoryTeamsArgs.builder()
            .name("example")
            .build());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: github:getRepositoryTeams
      arguments:
        name: example
Copy

Using getRepositoryTeams

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getRepositoryTeams(args: GetRepositoryTeamsArgs, opts?: InvokeOptions): Promise<GetRepositoryTeamsResult>
function getRepositoryTeamsOutput(args: GetRepositoryTeamsOutputArgs, opts?: InvokeOptions): Output<GetRepositoryTeamsResult>
Copy
def get_repository_teams(full_name: Optional[str] = None,
                         name: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetRepositoryTeamsResult
def get_repository_teams_output(full_name: Optional[pulumi.Input[str]] = None,
                         name: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetRepositoryTeamsResult]
Copy
func GetRepositoryTeams(ctx *Context, args *GetRepositoryTeamsArgs, opts ...InvokeOption) (*GetRepositoryTeamsResult, error)
func GetRepositoryTeamsOutput(ctx *Context, args *GetRepositoryTeamsOutputArgs, opts ...InvokeOption) GetRepositoryTeamsResultOutput
Copy

> Note: This function is named GetRepositoryTeams in the Go SDK.

public static class GetRepositoryTeams 
{
    public static Task<GetRepositoryTeamsResult> InvokeAsync(GetRepositoryTeamsArgs args, InvokeOptions? opts = null)
    public static Output<GetRepositoryTeamsResult> Invoke(GetRepositoryTeamsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetRepositoryTeamsResult> getRepositoryTeams(GetRepositoryTeamsArgs args, InvokeOptions options)
public static Output<GetRepositoryTeamsResult> getRepositoryTeams(GetRepositoryTeamsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: github:index/getRepositoryTeams:getRepositoryTeams
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

FullName string
Full name of the repository (in org/name format).
Name string
The name of the repository.
FullName string
Full name of the repository (in org/name format).
Name string
The name of the repository.
fullName String
Full name of the repository (in org/name format).
name String
The name of the repository.
fullName string
Full name of the repository (in org/name format).
name string
The name of the repository.
full_name str
Full name of the repository (in org/name format).
name str
The name of the repository.
fullName String
Full name of the repository (in org/name format).
name String
The name of the repository.

getRepositoryTeams Result

The following output properties are available:

FullName string
Id string
The provider-assigned unique ID for this managed resource.
Name string
Team name
Teams List<GetRepositoryTeamsTeam>
List of teams which have access to the repository
FullName string
Id string
The provider-assigned unique ID for this managed resource.
Name string
Team name
Teams []GetRepositoryTeamsTeam
List of teams which have access to the repository
fullName String
id String
The provider-assigned unique ID for this managed resource.
name String
Team name
teams List<GetRepositoryTeamsTeam>
List of teams which have access to the repository
fullName string
id string
The provider-assigned unique ID for this managed resource.
name string
Team name
teams GetRepositoryTeamsTeam[]
List of teams which have access to the repository
full_name str
id str
The provider-assigned unique ID for this managed resource.
name str
Team name
teams Sequence[GetRepositoryTeamsTeam]
List of teams which have access to the repository
fullName String
id String
The provider-assigned unique ID for this managed resource.
name String
Team name
teams List<Property Map>
List of teams which have access to the repository

Supporting Types

GetRepositoryTeamsTeam

Name This property is required. string
The name of the repository.
Permission This property is required. string
Team permission
Slug This property is required. string
Team slug
Name This property is required. string
The name of the repository.
Permission This property is required. string
Team permission
Slug This property is required. string
Team slug
name This property is required. String
The name of the repository.
permission This property is required. String
Team permission
slug This property is required. String
Team slug
name This property is required. string
The name of the repository.
permission This property is required. string
Team permission
slug This property is required. string
Team slug
name This property is required. str
The name of the repository.
permission This property is required. str
Team permission
slug This property is required. str
Team slug
name This property is required. String
The name of the repository.
permission This property is required. String
Team permission
slug This property is required. String
Team slug

Package Details

Repository
GitHub pulumi/pulumi-github
License
Apache-2.0
Notes
This Pulumi package is based on the github Terraform Provider.