mirror of
https://github.com/esphome/esphome.git
synced 2025-10-23 04:03:52 +01:00
tidy
This commit is contained in:
@@ -115,10 +115,10 @@ def find_existing_comment(pr_number: str) -> str | None:
|
|||||||
pr_number: PR number
|
pr_number: PR number
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Comment ID if found, None otherwise
|
Comment numeric ID (databaseId) if found, None otherwise
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
# List all comments on the PR
|
# List all comments on the PR with both id (node ID) and databaseId (numeric ID)
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
[
|
[
|
||||||
"gh",
|
"gh",
|
||||||
@@ -128,7 +128,7 @@ def find_existing_comment(pr_number: str) -> str | None:
|
|||||||
"--json",
|
"--json",
|
||||||
"comments",
|
"comments",
|
||||||
"--jq",
|
"--jq",
|
||||||
".comments[]",
|
".comments[] | {id, databaseId, body}",
|
||||||
],
|
],
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
text=True,
|
text=True,
|
||||||
@@ -143,7 +143,8 @@ def find_existing_comment(pr_number: str) -> str | None:
|
|||||||
try:
|
try:
|
||||||
comment = json.loads(line)
|
comment = json.loads(line)
|
||||||
if COMMENT_MARKER in comment.get("body", ""):
|
if COMMENT_MARKER in comment.get("body", ""):
|
||||||
return str(comment["id"])
|
# Return the numeric databaseId, not the node ID
|
||||||
|
return str(comment["databaseId"])
|
||||||
except json.JSONDecodeError:
|
except json.JSONDecodeError:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user