INNER CODE UNIT · Python

find_marker_comment

RockxyApp/Rockxy · .github/tools/cla_gate.py:110

    def find_marker_comment(self, issue_number: int) -> dict | None:
        page = 1
        while True:
            status, data = self._request(
                "GET", f"/repos/{self._repo}/issues/{issue_number}/comments?per_page=100&page={page}"
            )
            if status != 200 or not isinstance(data, list):
                raise RuntimeError(f"failed to list comments for #{issue_number}: HTTP {status}")
            for comment in data:
                if (
                    comment.get("user", {}).get("id") == lib.WORKFLOW_BOT_USER_ID
                    and COMMENT_MARKER in (comment.get("body") or "")
                ):
                    return comment
            if len(data) < 100:
                return None
            page += 1

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…