Get latest commit info from GitHub API.
(repo, branch)
| 159 | |
| 160 | |
| 161 | def get_latest_commit_info(repo, branch): |
| 162 | """Get latest commit info from GitHub API.""" |
| 163 | |
| 164 | url = "https://api.github.com/repos/{repo}/commits/{branch}".format( |
| 165 | repo=repo, branch=branch |
| 166 | ) |
| 167 | req = requests.get(url) |
| 168 | assert req.status_code == 200, "Failed to fetch commit info: %s" % req.text |
| 169 | commit = req.json() |
| 170 | |
| 171 | return { |
| 172 | "vcs_revision": commit["sha"], |
| 173 | "committer_date": commit["commit"]["committer"]["date"], |
| 174 | } |
| 175 | |
| 176 | |
| 177 | def get_bundle_schema_local(local): |
no test coverage detected