• Home
  • Raw
  • Download

Lines Matching +full:repo +full:- +full:token

34 ) -> Tuple[Any, Any]:
37 token = os.environ.get("GITHUB_TOKEN")
38 if token is not None and url.startswith(f"{GITHUB_API_URL}/"):
39 headers["Authorization"] = f"token {token}"
53 for key in ["X-RateLimit-Limit", "X-RateLimit-Remaining"]
55 and int(err.headers["X-RateLimit-Remaining"]) == 0
60 Used: {err.headers['X-RateLimit-Used']}
61 Limit: {err.headers['X-RateLimit-Limit']}
62 Remaining: {err.headers['X-RateLimit-Remaining']}
63 Resets at: {err.headers['x-RateLimit-Reset']}"""
77 ) -> Any:
88 ) -> List[Dict[str, Any]]:
104 ) -> Any:
117 ) -> List[Dict[str, Any]]:
125 ) -> Dict[str, Any]:
129 def gh_graphql(query: str, **kwargs: Any) -> Dict[str, Any]:
144 ) -> List[Dict[str, Any]]:
152 org: str, repo: str, pr_num: int, comment: str, dry_run: bool = False
153 ) -> List[Dict[str, Any]]:
155 f"{GITHUB_API_URL}/repos/{org}/{repo}/issues/{pr_num}/comments",
162 org: str, repo: str, sha: str, comment: str, dry_run: bool = False
163 ) -> List[Dict[str, Any]]:
165 f"{GITHUB_API_URL}/repos/{org}/{repo}/commits/{sha}/comments",
171 def gh_delete_comment(org: str, repo: str, comment_id: int) -> None:
172 url = f"{GITHUB_API_URL}/repos/{org}/{repo}/issues/comments/{comment_id}"
176 def gh_fetch_merge_base(org: str, repo: str, base: str, head: str) -> str:
179 # git merge-base without the need to have git. The API doc can be found at
180 # https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28#compare-two-commits
183 f"{GITHUB_API_URL}/repos/{org}/{repo}/compare/{base}...{head}",
199 def gh_update_pr_state(org: str, repo: str, pr_num: int, state: str = "open") -> None:
200 url = f"{GITHUB_API_URL}/repos/{org}/{repo}/pulls/{pr_num}"
205 # has been deleted and the API couldn't re-open it
215 org: str, repo: str, labels: List[str], state: str = "open"
216 ) -> List[Dict[str, Any]]:
217 url = f"{GITHUB_API_URL}/repos/{org}/{repo}/issues"