1. Packages
  2. Github Provider
  3. API Docs
  4. getUser
GitHub v6.3.2 published on Friday, Oct 11, 2024 by Pulumi

github.getUser

Explore with Pulumi AI

github logo
GitHub v6.3.2 published on Friday, Oct 11, 2024 by Pulumi

    Use this data source to retrieve information about a GitHub user.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as github from "@pulumi/github";
    
    // Retrieve information about a GitHub user.
    const example = github.getUser({
        username: "example",
    });
    // Retrieve information about the currently authenticated user.
    const current = github.getUser({
        username: "",
    });
    export const currentGithubLogin = current.then(current => current.login);
    
    import pulumi
    import pulumi_github as github
    
    # Retrieve information about a GitHub user.
    example = github.get_user(username="example")
    # Retrieve information about the currently authenticated user.
    current = github.get_user(username="")
    pulumi.export("currentGithubLogin", current.login)
    
    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 {
    		// Retrieve information about a GitHub user.
    		_, err := github.GetUser(ctx, &github.GetUserArgs{
    			Username: "example",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// Retrieve information about the currently authenticated user.
    		current, err := github.GetUser(ctx, &github.GetUserArgs{
    			Username: "",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("currentGithubLogin", current.Login)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Github = Pulumi.Github;
    
    return await Deployment.RunAsync(() => 
    {
        // Retrieve information about a GitHub user.
        var example = Github.GetUser.Invoke(new()
        {
            Username = "example",
        });
    
        // Retrieve information about the currently authenticated user.
        var current = Github.GetUser.Invoke(new()
        {
            Username = "",
        });
    
        return new Dictionary<string, object?>
        {
            ["currentGithubLogin"] = current.Apply(getUserResult => getUserResult.Login),
        };
    });
    
    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.GetUserArgs;
    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) {
            // Retrieve information about a GitHub user.
            final var example = GithubFunctions.getUser(GetUserArgs.builder()
                .username("example")
                .build());
    
            // Retrieve information about the currently authenticated user.
            final var current = GithubFunctions.getUser(GetUserArgs.builder()
                .username("")
                .build());
    
            ctx.export("currentGithubLogin", current.applyValue(getUserResult -> getUserResult.login()));
        }
    }
    
    variables:
      # Retrieve information about a GitHub user.
      example:
        fn::invoke:
          Function: github:getUser
          Arguments:
            username: example
      # Retrieve information about the currently authenticated user.
      current:
        fn::invoke:
          Function: github:getUser
          Arguments:
            username:
    outputs:
      currentGithubLogin: ${current.login}
    

    Using getUser

    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 getUser(args: GetUserArgs, opts?: InvokeOptions): Promise<GetUserResult>
    function getUserOutput(args: GetUserOutputArgs, opts?: InvokeOptions): Output<GetUserResult>
    def get_user(username: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetUserResult
    def get_user_output(username: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetUserResult]
    func GetUser(ctx *Context, args *GetUserArgs, opts ...InvokeOption) (*GetUserResult, error)
    func GetUserOutput(ctx *Context, args *GetUserOutputArgs, opts ...InvokeOption) GetUserResultOutput

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

    public static class GetUser 
    {
        public static Task<GetUserResult> InvokeAsync(GetUserArgs args, InvokeOptions? opts = null)
        public static Output<GetUserResult> Invoke(GetUserInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetUserResult> getUser(GetUserArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: github:index/getUser:getUser
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Username string
    The username. Use an empty string "" to retrieve information about the currently authenticated user.
    Username string
    The username. Use an empty string "" to retrieve information about the currently authenticated user.
    username String
    The username. Use an empty string "" to retrieve information about the currently authenticated user.
    username string
    The username. Use an empty string "" to retrieve information about the currently authenticated user.
    username str
    The username. Use an empty string "" to retrieve information about the currently authenticated user.
    username String
    The username. Use an empty string "" to retrieve information about the currently authenticated user.

    getUser Result

    The following output properties are available:

    AvatarUrl string
    the user's avatar URL.
    Bio string
    the user's bio.
    Blog string
    the user's blog location.
    Company string
    the user's company name.
    CreatedAt string
    the creation date.
    Email string
    the user's email.
    Followers int
    the number of followers.
    Following int
    the number of following users.
    GpgKeys List<string>
    list of user's GPG keys.
    GravatarId string
    the user's gravatar ID.
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    the user's location.
    Login string
    the user's login.
    Name string
    the user's full name.
    NodeId string
    the Node ID of the user.
    PublicGists int
    the number of public gists.
    PublicRepos int
    the number of public repositories.
    SiteAdmin bool
    whether the user is a GitHub admin.
    SshKeys List<string>
    list of user's SSH keys.
    SuspendedAt string
    the suspended date if the user is suspended.
    UpdatedAt string
    the update date.
    Username string
    AvatarUrl string
    the user's avatar URL.
    Bio string
    the user's bio.
    Blog string
    the user's blog location.
    Company string
    the user's company name.
    CreatedAt string
    the creation date.
    Email string
    the user's email.
    Followers int
    the number of followers.
    Following int
    the number of following users.
    GpgKeys []string
    list of user's GPG keys.
    GravatarId string
    the user's gravatar ID.
    Id string
    The provider-assigned unique ID for this managed resource.
    Location string
    the user's location.
    Login string
    the user's login.
    Name string
    the user's full name.
    NodeId string
    the Node ID of the user.
    PublicGists int
    the number of public gists.
    PublicRepos int
    the number of public repositories.
    SiteAdmin bool
    whether the user is a GitHub admin.
    SshKeys []string
    list of user's SSH keys.
    SuspendedAt string
    the suspended date if the user is suspended.
    UpdatedAt string
    the update date.
    Username string
    avatarUrl String
    the user's avatar URL.
    bio String
    the user's bio.
    blog String
    the user's blog location.
    company String
    the user's company name.
    createdAt String
    the creation date.
    email String
    the user's email.
    followers Integer
    the number of followers.
    following Integer
    the number of following users.
    gpgKeys List<String>
    list of user's GPG keys.
    gravatarId String
    the user's gravatar ID.
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    the user's location.
    login String
    the user's login.
    name String
    the user's full name.
    nodeId String
    the Node ID of the user.
    publicGists Integer
    the number of public gists.
    publicRepos Integer
    the number of public repositories.
    siteAdmin Boolean
    whether the user is a GitHub admin.
    sshKeys List<String>
    list of user's SSH keys.
    suspendedAt String
    the suspended date if the user is suspended.
    updatedAt String
    the update date.
    username String
    avatarUrl string
    the user's avatar URL.
    bio string
    the user's bio.
    blog string
    the user's blog location.
    company string
    the user's company name.
    createdAt string
    the creation date.
    email string
    the user's email.
    followers number
    the number of followers.
    following number
    the number of following users.
    gpgKeys string[]
    list of user's GPG keys.
    gravatarId string
    the user's gravatar ID.
    id string
    The provider-assigned unique ID for this managed resource.
    location string
    the user's location.
    login string
    the user's login.
    name string
    the user's full name.
    nodeId string
    the Node ID of the user.
    publicGists number
    the number of public gists.
    publicRepos number
    the number of public repositories.
    siteAdmin boolean
    whether the user is a GitHub admin.
    sshKeys string[]
    list of user's SSH keys.
    suspendedAt string
    the suspended date if the user is suspended.
    updatedAt string
    the update date.
    username string
    avatar_url str
    the user's avatar URL.
    bio str
    the user's bio.
    blog str
    the user's blog location.
    company str
    the user's company name.
    created_at str
    the creation date.
    email str
    the user's email.
    followers int
    the number of followers.
    following int
    the number of following users.
    gpg_keys Sequence[str]
    list of user's GPG keys.
    gravatar_id str
    the user's gravatar ID.
    id str
    The provider-assigned unique ID for this managed resource.
    location str
    the user's location.
    login str
    the user's login.
    name str
    the user's full name.
    node_id str
    the Node ID of the user.
    public_gists int
    the number of public gists.
    public_repos int
    the number of public repositories.
    site_admin bool
    whether the user is a GitHub admin.
    ssh_keys Sequence[str]
    list of user's SSH keys.
    suspended_at str
    the suspended date if the user is suspended.
    updated_at str
    the update date.
    username str
    avatarUrl String
    the user's avatar URL.
    bio String
    the user's bio.
    blog String
    the user's blog location.
    company String
    the user's company name.
    createdAt String
    the creation date.
    email String
    the user's email.
    followers Number
    the number of followers.
    following Number
    the number of following users.
    gpgKeys List<String>
    list of user's GPG keys.
    gravatarId String
    the user's gravatar ID.
    id String
    The provider-assigned unique ID for this managed resource.
    location String
    the user's location.
    login String
    the user's login.
    name String
    the user's full name.
    nodeId String
    the Node ID of the user.
    publicGists Number
    the number of public gists.
    publicRepos Number
    the number of public repositories.
    siteAdmin Boolean
    whether the user is a GitHub admin.
    sshKeys List<String>
    list of user's SSH keys.
    suspendedAt String
    the suspended date if the user is suspended.
    updatedAt String
    the update date.
    username String

    Package Details

    Repository
    GitHub pulumi/pulumi-github
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the github Terraform Provider.
    github logo
    GitHub v6.3.2 published on Friday, Oct 11, 2024 by Pulumi