# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import warnings
import pulumi
import pulumi.runtime
from typing import Union
from . import utilities, tables

class GetActionsPublicKeyResult:
    """
    A collection of values returned by getActionsPublicKey.
    """
    def __init__(__self__, id=None, key=None, key_id=None, repository=None):
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        __self__.id = id
        """
        The provider-assigned unique ID for this managed resource.
        """
        if key and not isinstance(key, str):
            raise TypeError("Expected argument 'key' to be a str")
        __self__.key = key
        """
        Actual key retrieved.
        """
        if key_id and not isinstance(key_id, str):
            raise TypeError("Expected argument 'key_id' to be a str")
        __self__.key_id = key_id
        """
        ID of the key that has been retrieved.
        """
        if repository and not isinstance(repository, str):
            raise TypeError("Expected argument 'repository' to be a str")
        __self__.repository = repository
class AwaitableGetActionsPublicKeyResult(GetActionsPublicKeyResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetActionsPublicKeyResult(
            id=self.id,
            key=self.key,
            key_id=self.key_id,
            repository=self.repository)

def get_actions_public_key(repository=None,opts=None):
    """
    Use this data source to retrieve information about a GitHub Actions public key. This data source is required to be used with other GitHub secrets interactions.
    Note that the provider `token` must have admin rights to a repository to retrieve it's action public key.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_github as github

    example = github.get_actions_public_key(repository="example_repo")
    ```


    :param str repository: Name of the repository to get public key from.
    """
    __args__ = dict()


    __args__['repository'] = repository
    if opts is None:
        opts = pulumi.InvokeOptions()
    if opts.version is None:
        opts.version = utilities.get_version()
    __ret__ = pulumi.runtime.invoke('github:index/getActionsPublicKey:getActionsPublicKey', __args__, opts=opts).value

    return AwaitableGetActionsPublicKeyResult(
        id=__ret__.get('id'),
        key=__ret__.get('key'),
        key_id=__ret__.get('keyId'),
        repository=__ret__.get('repository'))
