• Home
  • Raw
  • Download

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

4 # This source code is licensed under the BSD-style license found in the
41 ) -> Tuple[Any, Any]:
44 token = os.environ.get("GITHUB_TOKEN")
45 if token is not None and url.startswith(f"{GITHUB_API_URL}/"):
46 headers["Authorization"] = f"token {token}"
57 key in err.headers for key in ["X-RateLimit-Limit", "X-RateLimit-Used"]
61 Used: {err.headers['X-RateLimit-Used']}
62 Limit: {err.headers['X-RateLimit-Limit']}
63 Remaining: {err.headers['X-RateLimit-Remaining']}
64 Resets at: {err.headers['x-RateLimit-Reset']}"""
76 ) -> Any:
87 ) -> List[Dict[str, Any]]:
103 ) -> Any:
116 ) -> List[Dict[str, Any]]:
124 ) -> Dict[str, Any]:
128 def gh_graphql(query: str, **kwargs: Any) -> Dict[str, Any]:
143 ) -> List[Dict[str, Any]]:
151 org: str, repo: str, pr_num: int, comment: str, dry_run: bool = False
152 ) -> List[Dict[str, Any]]:
154 f"{GITHUB_API_URL}/repos/{org}/{repo}/issues/{pr_num}/comments",
161 org: str, repo: str, sha: str, comment: str, dry_run: bool = False
162 ) -> List[Dict[str, Any]]:
164 f"{GITHUB_API_URL}/repos/{org}/{repo}/commits/{sha}/comments",
170 def gh_delete_comment(org: str, repo: str, comment_id: int) -> None:
171 url = f"{GITHUB_API_URL}/repos/{org}/{repo}/issues/comments/{comment_id}"
175 def gh_fetch_merge_base(org: str, repo: str, base: str, head: str) -> str:
178 # git merge-base without the need to have git. The API doc can be found at
179 # https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28#compare-two-commits
182 f"{GITHUB_API_URL}/repos/{org}/{repo}/compare/{base}...{head}",
198 def gh_update_pr_state(org: str, repo: str, pr_num: int, state: str = "open") -> None:
199 url = f"{GITHUB_API_URL}/repos/{org}/{repo}/pulls/{pr_num}"
204 # has been deleted and the API couldn't re-open it
214 org: str, repo: str, labels: List[str], state: str = "open"
215 ) -> List[Dict[str, Any]]:
216 url = f"{GITHUB_API_URL}/repos/{org}/{repo}/issues"