|
23 | 23 | # |
24 | 24 | # Important files in your $HOME: |
25 | 25 | # |
26 | | -# ~/.redmine_key -- Your redmine API key from right side of: https://tracker.ceph.com/my/account |
| 26 | +# ~/.redmine_key -- Your redmine API access key from right side of: https://tracker.ceph.com/my/account |
27 | 27 | # |
28 | | -# ~/.github.key -- Your github API key: https://github.com/settings/tokens |
| 28 | +# ~/.github_token -- Your github Personal access token: https://github.com/settings/tokens |
29 | 29 | # |
30 | 30 | # Some important environment variables: |
31 | 31 | # |
32 | 32 | # - PTL_TOOL_GITHUB_USER (your github username) |
33 | | -# - PTL_TOOL_GITHUB_API_KEY (your github api key, or what is stored in ~/.github.key) |
| 33 | +# - PTL_TOOL_GITHUB_TOKEN (your github Personal access token, or what is stored in ~/.github_token) |
34 | 34 | # - PTL_TOOL_REDMINE_USER (your redmine username) |
35 | 35 | # - PTL_TOOL_REDMINE_API_KEY (your redmine api key, or what is stored in ~/redmine_key) |
36 | 36 | # - PTL_TOOL_USER (your desired username embedded in test branch names) |
|
170 | 170 | CI_REMOTE_URL = os. getenv( "PTL_TOOL_CI_REMOTE_URL", f"[email protected]:{BASE_PROJECT}/{CI_REPO}.git") |
171 | 171 | GITDIR = os.getenv("PTL_TOOL_GITDIR", ".") |
172 | 172 | GITHUB_USER = os.getenv("PTL_TOOL_GITHUB_USER", os.getenv("PTL_TOOL_USER", getuser())) |
173 | | -GITHUB_API_KEY = None |
| 173 | +GITHUB_TOKEN = None |
174 | 174 | try: |
175 | | - with open(expanduser("~/.github.key")) as f: |
176 | | - GITHUB_API_KEY = f.read().strip() |
| 175 | + with open(expanduser("~/.github_token")) as f: |
| 176 | + GITHUB_TOKEN = f.read().strip() |
177 | 177 | except FileNotFoundError: |
178 | 178 | pass |
179 | | -GITHUB_API_KEY = os.getenv("PTL_TOOL_GITHUB_API_KEY", GITHUB_API_KEY) |
| 179 | +GITHUB_TOKEN = os.getenv("PTL_TOOL_GITHUB_TOKEN", GITHUB_TOKEN) |
180 | 180 | INDICATIONS = [ |
181 | 181 | re. compile( "(Reviewed-by: .+ <[\[email protected]]+>)", re. IGNORECASE), |
182 | 182 | re. compile( "(Acked-by: .+ <[\[email protected]]+>)", re. IGNORECASE), |
|
230 | 230 | TRACKER_MATCH = re.compile("(.*https?://tracker.ceph.com/.*)") |
231 | 231 |
|
232 | 232 | def gitauth(): |
233 | | - return (GITHUB_USER, GITHUB_API_KEY) |
| 233 | + return (GITHUB_USER, GITHUB_TOKEN) |
234 | 234 |
|
235 | 235 | def get(session, url, params=None, paging=True): |
236 | 236 | if params is None: |
|
0 commit comments