예제 #1
0
def get_pr_modified_files(pr_number):
    """
    Fetch all the files modified for a git pull request and return them as a string
    :param pr_number: int
    :return: str with all the modified files
    """
    github_handler = GitHubHandler("aws", "deep-learning-containers")
    files = github_handler.get_pr_files_changed(pr_number)
    files = "\n".join(files)
    return files
예제 #2
0
def get_pr_modified_files(pr_number):
    """
    Fetch all the files modified for a git pull request and return them as a string
    :param pr_number: int
    :return: str with all the modified files
    """
    # This import statement has been placed inside this function because it creates a dependency that is unnecessary
    # for local builds and builds outside of Pull Requests.
    from dlc.github_handler import GitHubHandler

    github_handler = GitHubHandler("aws", "deep-learning-containers")
    files = github_handler.get_pr_files_changed(pr_number)
    files = "\n".join(files)
    return files
예제 #3
0
def get_pr_modified_files(pr_number):
    """
    Fetch all the files modified for a git pull request and return them as a string
    :param pr_number: int
    :return: str with all the modified files
    """
    # This import statement has been placed inside this function because it creates a dependency that is unnecessary
    # for local builds and builds outside of Pull Requests.
    from dlc.github_handler import GitHubHandler

    # Example: "https://github.com/aws/deep-learning-containers.git"
    repo_url = os.getenv("CODEBUILD_SOURCE_REPO_URL")
    _, user, repo_name = repo_url.rstrip(".git").rsplit("/", 2)

    github_handler = GitHubHandler(user, repo_name)
    files = github_handler.get_pr_files_changed(pr_number)
    files = "\n".join(files)
    return files