INNER CODE UNIT · Python
handle_issue_comment
Steam-Headless/docker-steam-headless · .github/scripts/manage-compatibility-report.py:172
def handle_issue_comment(owner, repo, issue_number, token):
api_base = f"https://api.github.com/repos/{owner}/{repo}"
issue = github_api_request(f"{api_base}/issues/{issue_number}", token=token)
labels = [lbl["name"] for lbl in issue.get("labels", [])]
if "type:compatibility" in labels and issue.get("state") == "closed":
print(f"Reopening closed compatibility report #{issue_number} following new comment.")
github_api_request(
f"{api_base}/issues/{issue_number}",
method="PATCH",
data={"state": "open"},
token=token,
)
if "state:stale" in labels:
try:
github_api_request(
f"{api_base}/issues/{issue_number}/labels/state:stale",
method="DELETE",