import requests


def get_linked_status(gh_headers, linked_issue_info):
    """
    Returns the open/closed status of the linked issue
    """
    lorg, lrepo, lnum = linked_issue_info
    print(f"::set-output name=linkedIssueInfo::Found a \
           linked issue: {lorg} {lrepo} {lnum}")
    issue_url = f"https://api.github.com/repos/{lorg}/{lrepo}/issues/{lnum}"

    response = requests.get(issue_url, headers=gh_headers).json()

    return response["state"]