├── .gitignore ├── Dockerfile ├── LICENSE.txt ├── README.md ├── docs └── preview.png ├── mattermostgithub ├── __init__.py ├── config.template ├── payload.py └── server.py ├── requirements.txt ├── server.py ├── setup.py └── tests ├── __init__.py ├── config.py ├── conftest.py ├── json ├── commit_comment.json ├── create.json ├── delete_tag.json ├── fork.json ├── gollum.json ├── issue_comment_created.json ├── issues_edited.json ├── label.json ├── pull_request_closed.json ├── pull_request_review.json ├── pull_request_review_comment.json └── push_deleted.json └── test_payloads.py /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.swp 3 | config.py 4 | # distutils related files 5 | .cache 6 | *.egg-info 7 | build 8 | dist 9 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3-alpine 2 | 3 | RUN apk add --update jpeg-dev zlib-dev 4 | 5 | # for a flask server 6 | EXPOSE 5000 7 | 8 | COPY requirements.txt /root/requirements.txt 9 | RUN pip install -r /root/requirements.txt 10 | RUN pip install gunicorn 11 | CMD gunicorn -b 0.0.0.0:5000 mattermostgithub:app 12 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 King's College London 2 | Created by the Software Development Team 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to 6 | deal in the Software without restriction, including without limitation the 7 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 8 | sell copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 20 | IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Github integration for Mattermost 2 | 3 | Inspired by [mattermost-integration-gitlab](https://github.com/NotSqrt/mattermost-integration-gitlab) this program creates a server using [flask](https://github.com/mitsuhiko/flask) that listens for incoming GitHub event webhooks. These are then processed, formatted, and eventually forwarded to Mattermost where they are displayed inside a specified channel. 4 | ![](docs/preview.png) 5 | 6 | ## Requirements 7 | ### System requirements 8 | - Python3 or Python2 9 | 10 | ### Application requirements 11 | 12 | - Flask (install with `pip install flask`) 13 | - requests (install with `pip install requests`) 14 | - (optional) PIL (install with `pip install pillow`) - needed to hide big Github avatars 15 | 16 | All requirements can also be installed using the command 17 | 18 | `pip install -r requirements.txt` 19 | 20 | ## Installation and usage 21 | 22 | 1. Clone the repository 23 | 2. Within the `mattermostgithub` directory, copy `config.template` to `config.py` and edit it with your details. For example: 24 | 25 | ```python 26 | USERNAME = "Github" 27 | ICON_URL = "yourdomain.org/github.png" 28 | MATTERMOST_WEBHOOK_URLS = { 29 | 'default' : ("yourdomain.org/hooks/hookid", "off-topic"), 30 | 'teamname/repositoryname' : ("yourdomain.org/hooks/hookid2", "repository-channel-id"), 31 | 'teamname' : ("yourdomain.org/hooks/hookid3", "town-square"), 32 | 'teamname/unimportantrepo' : None, 33 | } 34 | GITHUB_IGNORE_ACTIONS = { 35 | "issues": ["labeled", "assigned"], 36 | } 37 | SECRET = 'secretkey' 38 | SHOW_AVATARS = True 39 | SERVER = { 40 | 'hook': "/" 41 | , 'address': "0.0.0.0" 42 | , 'port': 5000 43 | } 44 | ``` 45 | 46 | Test the server with `python server.py`. For deployment, please consider using 47 | WSGI (more details 48 | [here](https://flask.palletsprojects.com/en/1.0.x/deploying/wsgi-standalone/)). 49 | For example to run using Gunicorn, execute: 50 | ``` 51 | gunicorn -b 0.0.0.0:5000 mattermostgithub:app 52 | ``` 53 | 54 | Alternatively, a `Dockerfile` is provided to run using Docker (see below). 55 | 56 | ### Webhooks 57 | GitHub messages can be delegated to different Mattermost hooks. The order is as 58 | follows: 59 | - First try to find a hook for the repositories full name. 60 | - If that fails, try to find a hook for the organisation name. 61 | - Otherwise use the default hook. 62 | 63 | Repositories can be blacklisted by setting them to `None` instead of 64 | `(url, channel)`. 65 | 66 | ### Ignore actions 67 | Specific Github events can be ignored by adding `GITHUB_IGNORE_ACTIONS` to `config.py`. In the example above `labeled` and `assigned` events for 68 | issues are ignored, while `opened`, `closed`, etc. events will continue to show 69 | up on Mattermost. 70 | 71 | ### Server settings 72 | The server is listening by default on address `0.0.0.0`, port `5000`, and 73 | using `/` as base route. 74 | Make sure to point your Github webhooks to `http://yourdomain.org:5000/`. 75 | 76 | If you have a proxy/load-balancer in front of your machine, and do not want to 77 | expose port 5000 to the outside, change the `SERVER['hook']` value and redirect it 78 | to this service. 79 | For example, if `SERVER['hook']` is `/hooks/github`, your Github webhooks 80 | would be `http://yourdomain.org/hooks/github`. 81 | 82 | ### Secret 83 | The secret key that can be set when setting up the Github webhook. If you don't want to use a secret, set the field to `None`. 84 | 85 | ## Deploying with Docker 86 | 87 | To deploy with Docker, make sure you have Docker installed and run: 88 | 89 | ``` 90 | docker build --rm=true -t mm-github . 91 | docker run --rm -v "$(pwd)":/home/app -w /home/app -p 5000:5000 -ti mm-github 92 | ``` 93 | 94 | If you want to run in background mode, change the option `--rm` for `-d`. 95 | 96 | ## Supported Events 97 | 98 | Not all Github events are forwarded to Mattermost. Currently supported events are: 99 | 100 | * Ping events (send when first adding the Github webhook) 101 | * Commit pushes and comments 102 | * Issues (open, close, comment) 103 | * Pull Requests (create, merge, remove, comment) 104 | * Create/Delete repositories 105 | * Create/Delete branches and tags 106 | 107 | All other events will report back to GitHub with `400 Not Implemented`. 108 | 109 | ## Known issues 110 | 111 | - Channel names need to use the spelling that is used in their URL (the channel ID), e.g. instead 112 | of `Town Square` it needs to be `town-square`. 113 | 114 | - If you set a custom username (as shown in the default config), make sure you also set **Enable webhooks and slash commands to override usernames** under **Custom Integrations** in the System Console to **True**. Otherwise the bots username will be that of the person that setup the Mattermost integration. 115 | -------------------------------------------------------------------------------- /docs/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softdevteam/mattermost-github-integration/859c89c5420687a1203d7683c1dc9935b35059c1/docs/preview.png -------------------------------------------------------------------------------- /mattermostgithub/__init__.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | from flask import Flask 4 | app = Flask(__name__) 5 | 6 | module_name = 'mattermostgithub.config' 7 | try: 8 | # Load config in the root directory (legacy behaviour) 9 | import config 10 | import mattermostgithub 11 | sys.modules[module_name] = config 12 | except ImportError: 13 | if 'MGI_CONFIG_FILE' in os.environ: 14 | file_path = os.environ['MGI_CONFIG_FILE'] 15 | try: 16 | # python 3 17 | import importlib.util 18 | spec = importlib.util.spec_from_file_location(module_name, file_path) 19 | module = importlib.util.module_from_spec(spec) 20 | spec.loader.exec_module(module) 21 | sys.modules[module_name] = module 22 | except ImportError: 23 | # python 2 24 | import imp 25 | config = imp.load_source(module_name, file_path) 26 | 27 | 28 | import mattermostgithub.server 29 | -------------------------------------------------------------------------------- /mattermostgithub/config.template: -------------------------------------------------------------------------------- 1 | USERNAME = "Github" 2 | ICON_URL = "" 3 | 4 | # Repository settings 5 | MATTERMOST_WEBHOOK_URLS = { 6 | 'default' : ("yourdomain.org/hooks/hookid", "off-topic"), 7 | } 8 | 9 | # Ignore specified event actions 10 | GITHUB_IGNORE_ACTIONS = { 11 | "pull_request": ["synchronize"] 12 | } 13 | 14 | # Ignore events from specified users 15 | IGNORE_USERS = { 16 | "someuser": ["push"], 17 | "anotheruser": ["push", "create"] 18 | } 19 | 20 | # Redirect events to different channels 21 | REDIRECT_EVENTS = { 22 | "push": "commits" 23 | } 24 | SECRET = "" 25 | SHOW_AVATARS = True 26 | SERVER = { 27 | 'hook': "/", 28 | 'address': "0.0.0.0", 29 | 'port': 5000, 30 | } 31 | -------------------------------------------------------------------------------- /mattermostgithub/payload.py: -------------------------------------------------------------------------------- 1 | from io import BytesIO 2 | import requests 3 | try: 4 | from PIL import Image 5 | from mattermostgithub.config import SHOW_AVATARS 6 | except ImportError: 7 | SHOW_AVATARS = False 8 | 9 | class Payload(object): 10 | def __init__(self, data): 11 | self.data = data 12 | 13 | def user_link(self): 14 | name = self.data['sender']['login'] 15 | url = self.data['sender']['html_url'] 16 | avatar = self.data['sender']['avatar_url'] + "&s=18" 17 | return self.create_user_link(name, url, avatar) 18 | 19 | def check_avatar_size(self, url): 20 | f = requests.get(url) 21 | img = Image.open(BytesIO(f.content)) 22 | f.close() 23 | if img.size[0] <= 20 and img.size[1] <= 20: 24 | return True 25 | return False 26 | 27 | def create_user_link(self, name, url, avatar): 28 | if SHOW_AVATARS and self.check_avatar_size(avatar): 29 | return "![](%s) [%s](%s)" % (avatar, name, url) 30 | return "[%s](%s)" % (name, url) 31 | 32 | 33 | def repo_link(self): 34 | name = self.data['repository']['full_name'] 35 | url = self.data['repository']['html_url'] 36 | return "[%s](%s)" % (name, url) 37 | 38 | def preview(self, text): 39 | if not text: 40 | return text 41 | l = text.split("\n") 42 | # Show the first 4 lines of a message. 43 | result = "".join(l[:4]) 44 | # Remove trailing newlines. 45 | if result[-1] in "[\n, \r]": 46 | result = result[:-1] 47 | if result != text: 48 | result += " [...]" 49 | return result 50 | 51 | class PullRequest(Payload): 52 | def __init__(self, data): 53 | Payload.__init__(self, data) 54 | self.number = self.data['pull_request']['number'] 55 | self.title = self.data['pull_request']['title'] 56 | self.body = self.data['pull_request']['body'] 57 | self.url = self.data['pull_request']['html_url'] 58 | 59 | def opened(self): 60 | body = self.preview(self.body) 61 | msg = """%s opened new pull request [#%s %s](%s) in %s: 62 | > %s""" % (self.user_link(), self.number, self.title, 63 | self.url, self.repo_link(), body) 64 | return msg 65 | 66 | def assigned(self): 67 | to_name = self.data['assignee']['login'] 68 | to_url = self.data['assignee']['html_url'] 69 | to_avatar = self.data['assignee']['avatar_url'] + "&s=18" 70 | to = self.create_user_link(to_name, to_url, to_avatar) 71 | msg = """%s assigned %s to pull request [#%s %s](%s).""" % (self.user_link(), 72 | to, self.number, self.title, self.url) 73 | return msg 74 | 75 | def closed(self): 76 | merged = self.data['pull_request']['merged'] 77 | action = "merged" if merged else "closed" 78 | msg = """%s %s pull request [#%s %s](%s).""" % (self.user_link(), 79 | action, self.number, self.title, self.url) 80 | return msg 81 | 82 | def synchronize(self): 83 | msg = """%s modified pull request [#%s %s](%s).""" % (self.user_link(), 84 | self.number, self.title, self.url) 85 | return msg 86 | 87 | def review_requested(self): 88 | reviewers = ", ".join(self.data["requested_reviewers"]) 89 | msg = """%s requested a review from %s on [#%s %s](%s)""" % (self.user_link(), 90 | reviewers, 91 | self.number, self.title, self.url) 92 | return msg 93 | 94 | def pr_enqueued(self): 95 | msg = """[#%s %s](%s) added to merge queue.""" % ( 96 | self.number, self.title, self.url) 97 | return msg 98 | 99 | def pr_dequeued(self): 100 | reason = self.data["reason"] 101 | msg = """[#%s %s](%s) removed from merge queue. Reason: %s""" % ( 102 | self.number, self.title, self.url, reason) 103 | return msg 104 | 105 | class PullRequestReview(Payload): 106 | def __init__(self, data): 107 | Payload.__init__(self, data) 108 | self.number = self.data['pull_request']['number'] 109 | self.title = self.data['pull_request']['title'] 110 | self.body = self.data['review']['body'] 111 | self.url = self.data['review']['html_url'] 112 | 113 | def submitted(self): 114 | body = self.preview(self.body) 115 | if body is None: 116 | # Ignore empty PR reviews 117 | return "" 118 | msg = """%s submitted a review on pull request [#%s %s](%s): 119 | > %s""" % (self.user_link(), self.number, self.title, self.url, body) 120 | return msg 121 | 122 | class PullRequestComment(Payload): 123 | def __init__(self, data): 124 | Payload.__init__(self, data) 125 | self.number = self.data['pull_request']['number'] 126 | self.title = self.data['pull_request']['title'] 127 | self.body = self.data['comment']['body'] 128 | self.url = self.data['comment']['html_url'] 129 | 130 | def created(self): 131 | body = self.preview(self.body) 132 | msg = """%s commented on pull request [#%s %s](%s): 133 | > %s""" % (self.user_link(), self.number, self.title, self.url, body) 134 | return msg 135 | 136 | class Issue(Payload): 137 | def __init__(self, data): 138 | Payload.__init__(self, data) 139 | self.number = self.data['issue']['number'] 140 | self.title = self.data['issue']['title'] 141 | self.url = self.data['issue']['html_url'] 142 | self.body = self.data['issue']['body'] 143 | 144 | def opened(self): 145 | body = self.preview(self.body) 146 | msg = """%s opened new issue [#%s %s](%s) in %s: 147 | > %s""" % (self.user_link(), self.number, self.title, self.url, self.repo_link(), body) 148 | return msg 149 | 150 | def labeled(self): 151 | label = self.data['label']['name'] 152 | msg = """%s added label `%s` to issue [#%s %s](%s) in %s.""" % (self.user_link(), label, self.number, self.title, self.url, self.repo_link()) 153 | return msg 154 | 155 | def closed(self): 156 | msg = """%s closed issue [#%s %s](%s) in %s.""" % (self.user_link(), self.number, self.title, self.url, self.repo_link()) 157 | return msg 158 | 159 | def assigned(self): 160 | name = self.data['assignee']['login'] 161 | url = self.data['assignee']['html_url'] 162 | avatar = self.data['assignee']['avatar_url'] + "&s=18" 163 | assignee = self.create_user_link(name, url, avatar) 164 | msg = """%s assigned %s to issue [#%s %s](%s) in %s.""" % (self.user_link(), assignee, self.number, self.title, self.url, self.repo_link()) 165 | return msg 166 | 167 | class IssueComment(Payload): 168 | def __init__(self, data): 169 | Payload.__init__(self, data) 170 | self.number = self.data['issue']['number'] 171 | self.title = self.data['issue']['title'] 172 | self.url = self.data['comment']['html_url'] 173 | self.body = self.data['comment']['body'] 174 | 175 | def created(self): 176 | body = self.preview(self.body) 177 | msg = """%s commented on [#%s %s](%s): 178 | > %s""" % (self.user_link(), self.number, self.title, self.url, body) 179 | return msg 180 | 181 | class CommitComment(Payload): 182 | def __init__(self, data): 183 | Payload.__init__(self, data) 184 | self.cid = self.data['comment']['commit_id'][:7] 185 | self.url = self.data['comment']['html_url'] 186 | self.body = self.data['comment']['body'] 187 | 188 | def created(self): 189 | body = self.preview(self.body) 190 | msg = """%s commented on [%s](%s): 191 | > %s""" % (self.user_link(), self.cid, self.url, body) 192 | return msg 193 | 194 | class Repository(Payload): 195 | def __init__(self, data): 196 | Payload.__init__(self, data) 197 | 198 | def created(self): 199 | descr = self.data['repository']['description'] 200 | msg = """%s created new repository %s: 201 | > %s""" % (self.user_link(), self.repo_link(), descr) 202 | return msg 203 | 204 | class Branch(Payload): 205 | def __init__(self, data): 206 | Payload.__init__(self, data) 207 | self.name = self.data['ref'] 208 | 209 | def created(self): 210 | msg = """%s added branch `%s` to %s.""" % (self.user_link(), 211 | self.name, self.repo_link()) 212 | return msg 213 | 214 | def deleted(self): 215 | msg = """%s deleted branch `%s` in %s.""" % (self.user_link(), 216 | self.name, self.repo_link()) 217 | return msg 218 | 219 | class Tag(Payload): 220 | def __init__(self, data): 221 | Payload.__init__(self, data) 222 | self.name = self.data['ref'] 223 | 224 | def created(self): 225 | msg = """%s added tag `%s` to %s.""" % (self.user_link(), 226 | self.name, self.repo_link()) 227 | return msg 228 | 229 | class Push(Payload): 230 | def __init__(self, data): 231 | Payload.__init__(self, data) 232 | 233 | def commits(self): 234 | commits = self.data['commits'] 235 | branch = self.data['ref'].replace("refs/heads/", "") 236 | branch_url = self.data['repository']['html_url'] + "/tree/" + branch 237 | if not commits: 238 | commits = [self.data['head_commit']] 239 | changeset = "changesets" if len(commits) > 1 else "changeset" 240 | msg = [] 241 | msg.append("%s pushed %s %s to [%s](%s) at %s:" % (self.user_link(), len(commits), changeset, branch, branch_url, self.repo_link())) 242 | for commit in commits: 243 | cid = commit['id'][:7] 244 | curl = commit['url'] 245 | cmsg = self.preview(commit['message']) 246 | ctext = "- [`%s`](%s): %s" % (cid, curl, cmsg) 247 | msg.append("\n") 248 | msg.append(ctext) 249 | return "".join(msg) 250 | 251 | class Wiki(Payload): 252 | def __init__(self, data): 253 | Payload.__init__(self, data) 254 | 255 | def updated(self): 256 | pages = self.data['pages'] 257 | 258 | msg = [] 259 | msg.append("%s changes %s pages in Wiki at %s:" % (self.user_link(), len(pages), self.repo_link())) 260 | for page in pages: 261 | page_name = page['page_name'] 262 | title = page['title'] 263 | summary = page['summary'] 264 | url = "%s/_compare/%s" % (page['html_url'], page['sha']) 265 | action = page['action'] 266 | if summary : 267 | ctext = "- %s [%s](%s)\n>%s" % (action, page_name, url,summary) 268 | else : 269 | ctext = "- %s [%s](%s)\n" % (action, page_name, url) 270 | msg.append("\n") 271 | msg.append(ctext) 272 | return "".join(msg) 273 | 274 | class Status(Payload): 275 | def __init__(self, data): 276 | Payload.__init__(self, data) 277 | 278 | def updated(self): 279 | url = self.data["target_url"] 280 | description = self.data["description"] 281 | msg = "[%s](%s) in %s." % (description, url, self.repo_link()) 282 | return msg 283 | -------------------------------------------------------------------------------- /mattermostgithub/server.py: -------------------------------------------------------------------------------- 1 | import json 2 | import hmac 3 | import hashlib 4 | import requests 5 | from flask import request 6 | 7 | try: 8 | from mattermostgithub import config 9 | except ImportError: 10 | print("Could not import config. Using test-config instead.") 11 | from tests import config 12 | 13 | from mattermostgithub.payload import ( 14 | PullRequest, PullRequestReview, PullRequestComment, Issue, IssueComment, 15 | Repository, Branch, Push, Tag, CommitComment, Wiki, Status 16 | ) 17 | 18 | from mattermostgithub import app 19 | 20 | SECRET = hmac.new(config.SECRET.encode('utf8'), digestmod=hashlib.sha1) if config.SECRET else None 21 | 22 | @app.route(config.SERVER['hook'] or "/", methods=['POST']) 23 | def root(): 24 | if request.json is None: 25 | print('Invalid Content-Type') 26 | return 'Content-Type must be application/json and the request body must contain valid JSON', 400 27 | 28 | if SECRET: 29 | signature = request.headers.get('X-Hub-Signature', None) 30 | sig2 = SECRET.copy() 31 | sig2.update(request.data) 32 | 33 | if signature is None or sig2.hexdigest() != signature.split('=')[1]: 34 | return 'Invalid or missing X-Hub-Signature', 400 35 | 36 | data = request.json 37 | event = request.headers['X-Github-Event'] 38 | 39 | msg = "" 40 | if event == "ping": 41 | msg = "ping from %s" % data['repository']['full_name'] 42 | elif event == "pull_request": 43 | if data['action'] == "opened": 44 | msg = PullRequest(data).opened() 45 | elif data['action'] == "closed": 46 | msg = PullRequest(data).closed() 47 | elif data['action'] == "assigned": 48 | msg = PullRequest(data).assigned() 49 | elif data['action'] == "synchronize": 50 | msg = PullRequest(data).synchronize() 51 | elif data['action'] == "review_requested": 52 | msg = PullRequest(data).review_requested() 53 | elif data['action'] == "enqueued": 54 | msg = PullRequest(data).pr_enqueued() 55 | elif data['action'] == "dequeued": 56 | msg = PullRequest(data).pr_dequeued() 57 | elif event == "issues": 58 | if data['action'] == "opened": 59 | msg = Issue(data).opened() 60 | elif data['action'] == "closed": 61 | msg = Issue(data).closed() 62 | elif data['action'] == "labeled": 63 | msg = Issue(data).labeled() 64 | elif data['action'] == "assigned": 65 | msg = Issue(data).assigned() 66 | elif event == "issue_comment": 67 | if data['action'] == "created": 68 | msg = IssueComment(data).created() 69 | elif event == "repository": 70 | if data['action'] == "created": 71 | msg = Repository(data).created() 72 | elif event == "create": 73 | if data['ref_type'] == "branch": 74 | msg = Branch(data).created() 75 | elif data['ref_type'] == "tag": 76 | msg = Tag(data).created() 77 | elif event == "delete": 78 | if data['ref_type'] == "branch": 79 | msg = Branch(data).deleted() 80 | elif event == "pull_request_review": 81 | if data['action'] == "submitted": 82 | msg = PullRequestReview(data).submitted() 83 | elif event == "pull_request_review_comment": 84 | if data['action'] == "created": 85 | msg = PullRequestComment(data).created() 86 | elif event == "push": 87 | if not (data['deleted'] and data['forced']): 88 | if not data['ref'].startswith("refs/tags/"): 89 | msg = Push(data).commits() 90 | elif event == "commit_comment": 91 | if data['action'] == "created": 92 | msg = CommitComment(data).created() 93 | elif event == "gollum": 94 | msg = Wiki(data).updated() 95 | elif event == "status": 96 | if data["state"] in ["failure", "error"]: 97 | msg = Status(data).updated() 98 | 99 | if msg: 100 | hook_info = get_hook_info(data) 101 | if hook_info: 102 | url, channel = get_hook_info(data) 103 | 104 | action = None 105 | if "action" in data: 106 | action = data["action"] 107 | elif "ref_type" in data: 108 | action = data["ref_type"] 109 | 110 | if action: 111 | if hasattr(config, "GITHUB_IGNORE_ACTIONS") and \ 112 | event in config.GITHUB_IGNORE_ACTIONS and \ 113 | action in config.GITHUB_IGNORE_ACTIONS[event]: 114 | return "Notification action ignored (as per configuration)" 115 | 116 | if hasattr(config, "IGNORE_USER_EVENTS") and "sender" in data \ 117 | and data['sender']['login'] in config.IGNORE_USER_EVENTS \ 118 | and event in config.IGNORE_USER_EVENTS[data['sender']['login']]: 119 | return "User blocked from generating this notifications" 120 | 121 | if hasattr(config, "REDIRECT_EVENTS") and \ 122 | event in config.REDIRECT_EVENTS: 123 | channel = config.REDIRECT_EVENTS[event] 124 | 125 | post(msg, url, channel) 126 | return "Notification successfully posted to Mattermost" 127 | else: 128 | return "Notification ignored (repository is blacklisted)." 129 | else: 130 | return "Not implemented", 400 131 | 132 | def post(text, url, channel): 133 | data = {} 134 | data['text'] = text 135 | data['channel'] = channel 136 | data['username'] = config.USERNAME 137 | data['icon_url'] = config.ICON_URL 138 | 139 | headers = {'Content-Type': 'application/json'} 140 | r = requests.post(url, headers=headers, data=json.dumps(data), verify=False) 141 | 142 | if r.status_code is not requests.codes.ok: 143 | print('Encountered error posting to Mattermost URL %s, status=%d, response_body=%s' % (url, r.status_code, r.json())) 144 | 145 | def get_hook_info(data): 146 | if 'repository' in data: 147 | repo = data['repository']['full_name'] 148 | if repo in config.MATTERMOST_WEBHOOK_URLS: 149 | return config.MATTERMOST_WEBHOOK_URLS[repo] 150 | if 'organization' in data: 151 | org = data['organization']['login'] 152 | if org in config.MATTERMOST_WEBHOOK_URLS: 153 | return config.MATTERMOST_WEBHOOK_URLS[org] 154 | if 'repository' in data: 155 | if 'login' in data['repository']['owner']: 156 | owner = data['repository']['owner']['login'] 157 | if owner in config.MATTERMOST_WEBHOOK_URLS: 158 | return config.MATTERMOST_WEBHOOK_URLS[owner] 159 | if 'name' in data['repository']['owner']: 160 | owner = data['repository']['owner']['name'] 161 | if owner in config.MATTERMOST_WEBHOOK_URLS: 162 | return config.MATTERMOST_WEBHOOK_URLS[owner] 163 | return config.MATTERMOST_WEBHOOK_URLS['default'] 164 | 165 | if __name__ == "__main__": 166 | app.run( 167 | host=config.SERVER['address'] or "127.0.0.1", 168 | port=config.SERVER['port'] or 5000, 169 | debug=False 170 | ) 171 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | appdirs 2 | click 3 | flask 4 | itsdangerous 5 | Jinja2 6 | MarkupSafe 7 | olefile 8 | packaging 9 | Pillow 10 | pyparsing 11 | requests 12 | six 13 | Werkzeug 14 | -------------------------------------------------------------------------------- /server.py: -------------------------------------------------------------------------------- 1 | from mattermostgithub import app 2 | try: 3 | import config 4 | except ImportError: 5 | from mattermostgithub import config 6 | app.run( 7 | host=config.SERVER['address'] or "127.0.0.1", 8 | port=config.SERVER['port'] or 5000, 9 | debug=False 10 | ) 11 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from os.path import abspath, dirname, join 4 | from setuptools import find_packages, setup 5 | import codecs 6 | 7 | 8 | def read_relative_file(filename): 9 | """ 10 | Returns contents of the given file, whose path is supposed relative 11 | to this module. 12 | """ 13 | with codecs.open(join(dirname(abspath(__file__)), filename), encoding='utf-8') as f: 14 | return f.read() 15 | 16 | 17 | setup( 18 | name='mattermost-github', 19 | version="0.1.0", 20 | author='Mattermost Github Integration Developers', 21 | packages=["mattermostgithub"], 22 | include_package_data=True, 23 | long_description=read_relative_file('README.md'), 24 | url='https://github.com/softdevteam/mattermost-github-integration', 25 | license='MIT', 26 | description='Integration between Mattermost and Github', 27 | zip_safe=False, 28 | install_requires=[ 29 | "Flask>=0.12.1", 30 | "Pillow>=4.1.1", 31 | "requests>=2.13.0", 32 | ], 33 | classifiers=[ 34 | 'Development Status :: 4 - Beta', 35 | 'Environment :: Web Environment', 36 | 'Framework :: Flask', 37 | 'Intended Audience :: Developers', 38 | 'License :: OSI Approved :: MIT License', 39 | 'Programming Language :: Python :: 2', 40 | 'Programming Language :: Python :: 2.7', 41 | 'Programming Language :: Python :: 3', 42 | 'Programming Language :: Python :: 3.4', 43 | 'Programming Language :: Python :: 3.5', 44 | 'Programming Language :: Python :: 3.6', 45 | ], 46 | ) 47 | -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/softdevteam/mattermost-github-integration/859c89c5420687a1203d7683c1dc9935b35059c1/tests/__init__.py -------------------------------------------------------------------------------- /tests/config.py: -------------------------------------------------------------------------------- 1 | USERNAME = "Github" 2 | ICON_URL = "" 3 | MATTERMOST_WEBHOOK_URLS = { 4 | 'default' : ("yourdomain.org/hooks/hookid", "off-topic2"), 5 | } 6 | SECRET = "" 7 | SHOW_AVATARS = True 8 | SERVER = { 9 | 'hook': "/", 10 | 'address': "0.0.0.0", 11 | 'port': 5000, 12 | } 13 | 14 | # Ignore specified event actions 15 | GITHUB_IGNORE_ACTIONS = { 16 | "create": ["tag"] 17 | } 18 | -------------------------------------------------------------------------------- /tests/conftest.py: -------------------------------------------------------------------------------- 1 | from mattermostgithub import app as mig 2 | import pytest 3 | 4 | @pytest.fixture(scope="session") 5 | def app(): 6 | return mig 7 | -------------------------------------------------------------------------------- /tests/json/commit_comment.json: -------------------------------------------------------------------------------- 1 | { 2 | "action": "created", 3 | "comment": { 4 | "url": "https://api.github.com/repos/Codertocat/Hello-World/comments/29186860", 5 | "html_url": "https://github.com/Codertocat/Hello-World/commit/a10867b14bb761a232cd80139fbd4c0d33264240#commitcomment-29186860", 6 | "id": 29186860, 7 | "node_id": "MDEzOkNvbW1pdENvbW1lbnQyOTE4Njg2MA==", 8 | "user": { 9 | "login": "Codertocat", 10 | "id": 21031067, 11 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 12 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 13 | "gravatar_id": "", 14 | "url": "https://api.github.com/users/Codertocat", 15 | "html_url": "https://github.com/Codertocat", 16 | "followers_url": "https://api.github.com/users/Codertocat/followers", 17 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 18 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 19 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 20 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 21 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 22 | "repos_url": "https://api.github.com/users/Codertocat/repos", 23 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 24 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 25 | "type": "User", 26 | "site_admin": false 27 | }, 28 | "position": null, 29 | "line": null, 30 | "path": null, 31 | "commit_id": "a10867b14bb761a232cd80139fbd4c0d33264240", 32 | "created_at": "2018-05-30T20:18:33Z", 33 | "updated_at": "2018-05-30T20:18:33Z", 34 | "author_association": "OWNER", 35 | "body": "This is a really good change! :+1:" 36 | }, 37 | "repository": { 38 | "id": 135493233, 39 | "node_id": "MDEwOlJlcG9zaXRvcnkxMzU0OTMyMzM=", 40 | "name": "Hello-World", 41 | "full_name": "Codertocat/Hello-World", 42 | "owner": { 43 | "login": "Codertocat", 44 | "id": 21031067, 45 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 46 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 47 | "gravatar_id": "", 48 | "url": "https://api.github.com/users/Codertocat", 49 | "html_url": "https://github.com/Codertocat", 50 | "followers_url": "https://api.github.com/users/Codertocat/followers", 51 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 52 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 53 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 54 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 55 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 56 | "repos_url": "https://api.github.com/users/Codertocat/repos", 57 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 58 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 59 | "type": "User", 60 | "site_admin": false 61 | }, 62 | "private": false, 63 | "html_url": "https://github.com/Codertocat/Hello-World", 64 | "description": null, 65 | "fork": false, 66 | "url": "https://api.github.com/repos/Codertocat/Hello-World", 67 | "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", 68 | "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", 69 | "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", 70 | "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", 71 | "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", 72 | "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", 73 | "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", 74 | "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", 75 | "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", 76 | "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", 77 | "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", 78 | "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", 79 | "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", 80 | "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", 81 | "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", 82 | "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", 83 | "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", 84 | "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", 85 | "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", 86 | "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", 87 | "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", 88 | "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", 89 | "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", 90 | "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", 91 | "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", 92 | "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", 93 | "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", 94 | "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", 95 | "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", 96 | "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", 97 | "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", 98 | "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", 99 | "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", 100 | "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", 101 | "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", 102 | "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", 103 | "created_at": "2018-05-30T20:18:04Z", 104 | "updated_at": "2018-05-30T20:18:10Z", 105 | "pushed_at": "2018-05-30T20:18:30Z", 106 | "git_url": "git://github.com/Codertocat/Hello-World.git", 107 | "ssh_url": "git@github.com:Codertocat/Hello-World.git", 108 | "clone_url": "https://github.com/Codertocat/Hello-World.git", 109 | "svn_url": "https://github.com/Codertocat/Hello-World", 110 | "homepage": null, 111 | "size": 0, 112 | "stargazers_count": 0, 113 | "watchers_count": 0, 114 | "language": null, 115 | "has_issues": true, 116 | "has_projects": true, 117 | "has_downloads": true, 118 | "has_wiki": true, 119 | "has_pages": true, 120 | "forks_count": 0, 121 | "mirror_url": null, 122 | "archived": false, 123 | "open_issues_count": 2, 124 | "license": null, 125 | "forks": 0, 126 | "open_issues": 2, 127 | "watchers": 0, 128 | "default_branch": "master" 129 | }, 130 | "sender": { 131 | "login": "Codertocat", 132 | "id": 21031067, 133 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 134 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 135 | "gravatar_id": "", 136 | "url": "https://api.github.com/users/Codertocat", 137 | "html_url": "https://github.com/Codertocat", 138 | "followers_url": "https://api.github.com/users/Codertocat/followers", 139 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 140 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 141 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 142 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 143 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 144 | "repos_url": "https://api.github.com/users/Codertocat/repos", 145 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 146 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 147 | "type": "User", 148 | "site_admin": false 149 | } 150 | } 151 | -------------------------------------------------------------------------------- /tests/json/create.json: -------------------------------------------------------------------------------- 1 | { 2 | "ref": "simple-tag", 3 | "ref_type": "tag", 4 | "master_branch": "master", 5 | "description": null, 6 | "pusher_type": "user", 7 | "repository": { 8 | "id": 135493233, 9 | "node_id": "MDEwOlJlcG9zaXRvcnkxMzU0OTMyMzM=", 10 | "name": "Hello-World", 11 | "full_name": "Codertocat/Hello-World", 12 | "owner": { 13 | "login": "Codertocat", 14 | "id": 21031067, 15 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 16 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 17 | "gravatar_id": "", 18 | "url": "https://api.github.com/users/Codertocat", 19 | "html_url": "https://github.com/Codertocat", 20 | "followers_url": "https://api.github.com/users/Codertocat/followers", 21 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 22 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 23 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 24 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 25 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 26 | "repos_url": "https://api.github.com/users/Codertocat/repos", 27 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 28 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 29 | "type": "User", 30 | "site_admin": false 31 | }, 32 | "private": false, 33 | "html_url": "https://github.com/Codertocat/Hello-World", 34 | "description": null, 35 | "fork": false, 36 | "url": "https://api.github.com/repos/Codertocat/Hello-World", 37 | "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", 38 | "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", 39 | "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", 40 | "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", 41 | "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", 42 | "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", 43 | "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", 44 | "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", 45 | "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", 46 | "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", 47 | "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", 48 | "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", 49 | "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", 50 | "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", 51 | "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", 52 | "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", 53 | "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", 54 | "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", 55 | "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", 56 | "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", 57 | "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", 58 | "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", 59 | "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", 60 | "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", 61 | "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", 62 | "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", 63 | "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", 64 | "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", 65 | "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", 66 | "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", 67 | "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", 68 | "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", 69 | "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", 70 | "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", 71 | "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", 72 | "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", 73 | "created_at": "2018-05-30T20:18:04Z", 74 | "updated_at": "2018-05-30T20:18:35Z", 75 | "pushed_at": "2018-05-30T20:18:47Z", 76 | "git_url": "git://github.com/Codertocat/Hello-World.git", 77 | "ssh_url": "git@github.com:Codertocat/Hello-World.git", 78 | "clone_url": "https://github.com/Codertocat/Hello-World.git", 79 | "svn_url": "https://github.com/Codertocat/Hello-World", 80 | "homepage": null, 81 | "size": 0, 82 | "stargazers_count": 0, 83 | "watchers_count": 0, 84 | "language": null, 85 | "has_issues": true, 86 | "has_projects": true, 87 | "has_downloads": true, 88 | "has_wiki": true, 89 | "has_pages": true, 90 | "forks_count": 0, 91 | "mirror_url": null, 92 | "archived": false, 93 | "open_issues_count": 2, 94 | "license": null, 95 | "forks": 0, 96 | "open_issues": 2, 97 | "watchers": 0, 98 | "default_branch": "master" 99 | }, 100 | "sender": { 101 | "login": "Codertocat", 102 | "id": 21031067, 103 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 104 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 105 | "gravatar_id": "", 106 | "url": "https://api.github.com/users/Codertocat", 107 | "html_url": "https://github.com/Codertocat", 108 | "followers_url": "https://api.github.com/users/Codertocat/followers", 109 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 110 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 111 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 112 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 113 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 114 | "repos_url": "https://api.github.com/users/Codertocat/repos", 115 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 116 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 117 | "type": "User", 118 | "site_admin": false 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /tests/json/delete_tag.json: -------------------------------------------------------------------------------- 1 | { 2 | "ref": "simple-tag", 3 | "ref_type": "tag", 4 | "pusher_type": "user", 5 | "repository": { 6 | "id": 135493233, 7 | "node_id": "MDEwOlJlcG9zaXRvcnkxMzU0OTMyMzM=", 8 | "name": "Hello-World", 9 | "full_name": "Codertocat/Hello-World", 10 | "owner": { 11 | "login": "Codertocat", 12 | "id": 21031067, 13 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 14 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 15 | "gravatar_id": "", 16 | "url": "https://api.github.com/users/Codertocat", 17 | "html_url": "https://github.com/Codertocat", 18 | "followers_url": "https://api.github.com/users/Codertocat/followers", 19 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 20 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 21 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 22 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 23 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 24 | "repos_url": "https://api.github.com/users/Codertocat/repos", 25 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 26 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 27 | "type": "User", 28 | "site_admin": false 29 | }, 30 | "private": false, 31 | "html_url": "https://github.com/Codertocat/Hello-World", 32 | "description": null, 33 | "fork": false, 34 | "url": "https://api.github.com/repos/Codertocat/Hello-World", 35 | "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", 36 | "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", 37 | "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", 38 | "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", 39 | "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", 40 | "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", 41 | "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", 42 | "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", 43 | "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", 44 | "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", 45 | "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", 46 | "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", 47 | "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", 48 | "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", 49 | "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", 50 | "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", 51 | "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", 52 | "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", 53 | "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", 54 | "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", 55 | "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", 56 | "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", 57 | "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", 58 | "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", 59 | "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", 60 | "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", 61 | "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", 62 | "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", 63 | "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", 64 | "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", 65 | "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", 66 | "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", 67 | "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", 68 | "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", 69 | "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", 70 | "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", 71 | "created_at": "2018-05-30T20:18:04Z", 72 | "updated_at": "2018-05-30T20:18:35Z", 73 | "pushed_at": "2018-05-30T20:18:48Z", 74 | "git_url": "git://github.com/Codertocat/Hello-World.git", 75 | "ssh_url": "git@github.com:Codertocat/Hello-World.git", 76 | "clone_url": "https://github.com/Codertocat/Hello-World.git", 77 | "svn_url": "https://github.com/Codertocat/Hello-World", 78 | "homepage": null, 79 | "size": 0, 80 | "stargazers_count": 0, 81 | "watchers_count": 0, 82 | "language": null, 83 | "has_issues": true, 84 | "has_projects": true, 85 | "has_downloads": true, 86 | "has_wiki": true, 87 | "has_pages": true, 88 | "forks_count": 0, 89 | "mirror_url": null, 90 | "archived": false, 91 | "open_issues_count": 2, 92 | "license": null, 93 | "forks": 0, 94 | "open_issues": 2, 95 | "watchers": 0, 96 | "default_branch": "master" 97 | }, 98 | "sender": { 99 | "login": "Codertocat", 100 | "id": 21031067, 101 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 102 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 103 | "gravatar_id": "", 104 | "url": "https://api.github.com/users/Codertocat", 105 | "html_url": "https://github.com/Codertocat", 106 | "followers_url": "https://api.github.com/users/Codertocat/followers", 107 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 108 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 109 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 110 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 111 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 112 | "repos_url": "https://api.github.com/users/Codertocat/repos", 113 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 114 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 115 | "type": "User", 116 | "site_admin": false 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /tests/json/fork.json: -------------------------------------------------------------------------------- 1 | { 2 | "forkee": { 3 | "id": 135493281, 4 | "node_id": "MDEwOlJlcG9zaXRvcnkxMzU0OTMyODE=", 5 | "name": "Hello-World", 6 | "full_name": "Octocoders/Hello-World", 7 | "owner": { 8 | "login": "Octocoders", 9 | "id": 38302899, 10 | "node_id": "MDEyOk9yZ2FuaXphdGlvbjM4MzAyODk5", 11 | "avatar_url": "https://avatars1.githubusercontent.com/u/38302899?v=4", 12 | "gravatar_id": "", 13 | "url": "https://api.github.com/users/Octocoders", 14 | "html_url": "https://github.com/Octocoders", 15 | "followers_url": "https://api.github.com/users/Octocoders/followers", 16 | "following_url": "https://api.github.com/users/Octocoders/following{/other_user}", 17 | "gists_url": "https://api.github.com/users/Octocoders/gists{/gist_id}", 18 | "starred_url": "https://api.github.com/users/Octocoders/starred{/owner}{/repo}", 19 | "subscriptions_url": "https://api.github.com/users/Octocoders/subscriptions", 20 | "organizations_url": "https://api.github.com/users/Octocoders/orgs", 21 | "repos_url": "https://api.github.com/users/Octocoders/repos", 22 | "events_url": "https://api.github.com/users/Octocoders/events{/privacy}", 23 | "received_events_url": "https://api.github.com/users/Octocoders/received_events", 24 | "type": "Organization", 25 | "site_admin": false 26 | }, 27 | "private": false, 28 | "html_url": "https://github.com/Octocoders/Hello-World", 29 | "description": null, 30 | "fork": true, 31 | "url": "https://api.github.com/repos/Octocoders/Hello-World", 32 | "forks_url": "https://api.github.com/repos/Octocoders/Hello-World/forks", 33 | "keys_url": "https://api.github.com/repos/Octocoders/Hello-World/keys{/key_id}", 34 | "collaborators_url": "https://api.github.com/repos/Octocoders/Hello-World/collaborators{/collaborator}", 35 | "teams_url": "https://api.github.com/repos/Octocoders/Hello-World/teams", 36 | "hooks_url": "https://api.github.com/repos/Octocoders/Hello-World/hooks", 37 | "issue_events_url": "https://api.github.com/repos/Octocoders/Hello-World/issues/events{/number}", 38 | "events_url": "https://api.github.com/repos/Octocoders/Hello-World/events", 39 | "assignees_url": "https://api.github.com/repos/Octocoders/Hello-World/assignees{/user}", 40 | "branches_url": "https://api.github.com/repos/Octocoders/Hello-World/branches{/branch}", 41 | "tags_url": "https://api.github.com/repos/Octocoders/Hello-World/tags", 42 | "blobs_url": "https://api.github.com/repos/Octocoders/Hello-World/git/blobs{/sha}", 43 | "git_tags_url": "https://api.github.com/repos/Octocoders/Hello-World/git/tags{/sha}", 44 | "git_refs_url": "https://api.github.com/repos/Octocoders/Hello-World/git/refs{/sha}", 45 | "trees_url": "https://api.github.com/repos/Octocoders/Hello-World/git/trees{/sha}", 46 | "statuses_url": "https://api.github.com/repos/Octocoders/Hello-World/statuses/{sha}", 47 | "languages_url": "https://api.github.com/repos/Octocoders/Hello-World/languages", 48 | "stargazers_url": "https://api.github.com/repos/Octocoders/Hello-World/stargazers", 49 | "contributors_url": "https://api.github.com/repos/Octocoders/Hello-World/contributors", 50 | "subscribers_url": "https://api.github.com/repos/Octocoders/Hello-World/subscribers", 51 | "subscription_url": "https://api.github.com/repos/Octocoders/Hello-World/subscription", 52 | "commits_url": "https://api.github.com/repos/Octocoders/Hello-World/commits{/sha}", 53 | "git_commits_url": "https://api.github.com/repos/Octocoders/Hello-World/git/commits{/sha}", 54 | "comments_url": "https://api.github.com/repos/Octocoders/Hello-World/comments{/number}", 55 | "issue_comment_url": "https://api.github.com/repos/Octocoders/Hello-World/issues/comments{/number}", 56 | "contents_url": "https://api.github.com/repos/Octocoders/Hello-World/contents/{+path}", 57 | "compare_url": "https://api.github.com/repos/Octocoders/Hello-World/compare/{base}...{head}", 58 | "merges_url": "https://api.github.com/repos/Octocoders/Hello-World/merges", 59 | "archive_url": "https://api.github.com/repos/Octocoders/Hello-World/{archive_format}{/ref}", 60 | "downloads_url": "https://api.github.com/repos/Octocoders/Hello-World/downloads", 61 | "issues_url": "https://api.github.com/repos/Octocoders/Hello-World/issues{/number}", 62 | "pulls_url": "https://api.github.com/repos/Octocoders/Hello-World/pulls{/number}", 63 | "milestones_url": "https://api.github.com/repos/Octocoders/Hello-World/milestones{/number}", 64 | "notifications_url": "https://api.github.com/repos/Octocoders/Hello-World/notifications{?since,all,participating}", 65 | "labels_url": "https://api.github.com/repos/Octocoders/Hello-World/labels{/name}", 66 | "releases_url": "https://api.github.com/repos/Octocoders/Hello-World/releases{/id}", 67 | "deployments_url": "https://api.github.com/repos/Octocoders/Hello-World/deployments", 68 | "created_at": "2018-05-30T20:18:35Z", 69 | "updated_at": "2018-05-30T20:18:35Z", 70 | "pushed_at": "2018-05-30T20:18:30Z", 71 | "git_url": "git://github.com/Octocoders/Hello-World.git", 72 | "ssh_url": "git@github.com:Octocoders/Hello-World.git", 73 | "clone_url": "https://github.com/Octocoders/Hello-World.git", 74 | "svn_url": "https://github.com/Octocoders/Hello-World", 75 | "homepage": null, 76 | "size": 0, 77 | "stargazers_count": 0, 78 | "watchers_count": 0, 79 | "language": null, 80 | "has_issues": false, 81 | "has_projects": true, 82 | "has_downloads": true, 83 | "has_wiki": true, 84 | "has_pages": false, 85 | "forks_count": 0, 86 | "mirror_url": null, 87 | "archived": false, 88 | "open_issues_count": 0, 89 | "license": null, 90 | "forks": 0, 91 | "open_issues": 0, 92 | "watchers": 0, 93 | "default_branch": "master", 94 | "public": true 95 | }, 96 | "repository": { 97 | "id": 135493233, 98 | "node_id": "MDEwOlJlcG9zaXRvcnkxMzU0OTMyMzM=", 99 | "name": "Hello-World", 100 | "full_name": "Codertocat/Hello-World", 101 | "owner": { 102 | "login": "Codertocat", 103 | "id": 21031067, 104 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 105 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 106 | "gravatar_id": "", 107 | "url": "https://api.github.com/users/Codertocat", 108 | "html_url": "https://github.com/Codertocat", 109 | "followers_url": "https://api.github.com/users/Codertocat/followers", 110 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 111 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 112 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 113 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 114 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 115 | "repos_url": "https://api.github.com/users/Codertocat/repos", 116 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 117 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 118 | "type": "User", 119 | "site_admin": false 120 | }, 121 | "private": false, 122 | "html_url": "https://github.com/Codertocat/Hello-World", 123 | "description": null, 124 | "fork": false, 125 | "url": "https://api.github.com/repos/Codertocat/Hello-World", 126 | "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", 127 | "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", 128 | "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", 129 | "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", 130 | "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", 131 | "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", 132 | "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", 133 | "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", 134 | "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", 135 | "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", 136 | "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", 137 | "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", 138 | "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", 139 | "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", 140 | "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", 141 | "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", 142 | "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", 143 | "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", 144 | "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", 145 | "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", 146 | "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", 147 | "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", 148 | "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", 149 | "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", 150 | "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", 151 | "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", 152 | "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", 153 | "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", 154 | "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", 155 | "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", 156 | "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", 157 | "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", 158 | "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", 159 | "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", 160 | "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", 161 | "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", 162 | "created_at": "2018-05-30T20:18:04Z", 163 | "updated_at": "2018-05-30T20:18:35Z", 164 | "pushed_at": "2018-05-30T20:18:30Z", 165 | "git_url": "git://github.com/Codertocat/Hello-World.git", 166 | "ssh_url": "git@github.com:Codertocat/Hello-World.git", 167 | "clone_url": "https://github.com/Codertocat/Hello-World.git", 168 | "svn_url": "https://github.com/Codertocat/Hello-World", 169 | "homepage": null, 170 | "size": 0, 171 | "stargazers_count": 0, 172 | "watchers_count": 0, 173 | "language": null, 174 | "has_issues": true, 175 | "has_projects": true, 176 | "has_downloads": true, 177 | "has_wiki": true, 178 | "has_pages": true, 179 | "forks_count": 1, 180 | "mirror_url": null, 181 | "archived": false, 182 | "open_issues_count": 2, 183 | "license": null, 184 | "forks": 1, 185 | "open_issues": 2, 186 | "watchers": 0, 187 | "default_branch": "master" 188 | }, 189 | "sender": { 190 | "login": "Octocoders", 191 | "id": 38302899, 192 | "node_id": "MDEyOk9yZ2FuaXphdGlvbjM4MzAyODk5", 193 | "avatar_url": "https://avatars1.githubusercontent.com/u/38302899?v=4", 194 | "gravatar_id": "", 195 | "url": "https://api.github.com/users/Octocoders", 196 | "html_url": "https://github.com/Octocoders", 197 | "followers_url": "https://api.github.com/users/Octocoders/followers", 198 | "following_url": "https://api.github.com/users/Octocoders/following{/other_user}", 199 | "gists_url": "https://api.github.com/users/Octocoders/gists{/gist_id}", 200 | "starred_url": "https://api.github.com/users/Octocoders/starred{/owner}{/repo}", 201 | "subscriptions_url": "https://api.github.com/users/Octocoders/subscriptions", 202 | "organizations_url": "https://api.github.com/users/Octocoders/orgs", 203 | "repos_url": "https://api.github.com/users/Octocoders/repos", 204 | "events_url": "https://api.github.com/users/Octocoders/events{/privacy}", 205 | "received_events_url": "https://api.github.com/users/Octocoders/received_events", 206 | "type": "Organization", 207 | "site_admin": false 208 | } 209 | } 210 | -------------------------------------------------------------------------------- /tests/json/gollum.json: -------------------------------------------------------------------------------- 1 | { 2 | "pages": [ 3 | { 4 | "page_name": "Home", 5 | "title": "Home", 6 | "summary": null, 7 | "action": "edited", 8 | "sha": "562362bc141b9e2db1fb971e1ecb4fd0b7457f68", 9 | "html_url": "https://github.com/Codertocat/Hello-World/wiki/Home" 10 | } 11 | ], 12 | "repository": { 13 | "id": 135493233, 14 | "node_id": "MDEwOlJlcG9zaXRvcnkxMzU0OTMyMzM=", 15 | "name": "Hello-World", 16 | "full_name": "Codertocat/Hello-World", 17 | "owner": { 18 | "login": "Codertocat", 19 | "id": 21031067, 20 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 21 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 22 | "gravatar_id": "", 23 | "url": "https://api.github.com/users/Codertocat", 24 | "html_url": "https://github.com/Codertocat", 25 | "followers_url": "https://api.github.com/users/Codertocat/followers", 26 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 27 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 28 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 29 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 30 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 31 | "repos_url": "https://api.github.com/users/Codertocat/repos", 32 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 33 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 34 | "type": "User", 35 | "site_admin": false 36 | }, 37 | "private": false, 38 | "html_url": "https://github.com/Codertocat/Hello-World", 39 | "description": null, 40 | "fork": false, 41 | "url": "https://api.github.com/repos/Codertocat/Hello-World", 42 | "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", 43 | "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", 44 | "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", 45 | "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", 46 | "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", 47 | "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", 48 | "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", 49 | "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", 50 | "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", 51 | "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", 52 | "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", 53 | "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", 54 | "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", 55 | "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", 56 | "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", 57 | "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", 58 | "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", 59 | "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", 60 | "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", 61 | "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", 62 | "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", 63 | "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", 64 | "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", 65 | "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", 66 | "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", 67 | "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", 68 | "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", 69 | "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", 70 | "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", 71 | "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", 72 | "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", 73 | "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", 74 | "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", 75 | "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", 76 | "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", 77 | "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", 78 | "created_at": "2018-05-30T20:18:04Z", 79 | "updated_at": "2018-05-30T20:18:10Z", 80 | "pushed_at": "2018-05-30T20:18:19Z", 81 | "git_url": "git://github.com/Codertocat/Hello-World.git", 82 | "ssh_url": "git@github.com:Codertocat/Hello-World.git", 83 | "clone_url": "https://github.com/Codertocat/Hello-World.git", 84 | "svn_url": "https://github.com/Codertocat/Hello-World", 85 | "homepage": null, 86 | "size": 0, 87 | "stargazers_count": 0, 88 | "watchers_count": 0, 89 | "language": null, 90 | "has_issues": true, 91 | "has_projects": true, 92 | "has_downloads": true, 93 | "has_wiki": true, 94 | "has_pages": true, 95 | "forks_count": 0, 96 | "mirror_url": null, 97 | "archived": false, 98 | "open_issues_count": 0, 99 | "license": null, 100 | "forks": 0, 101 | "open_issues": 0, 102 | "watchers": 0, 103 | "default_branch": "master" 104 | }, 105 | "sender": { 106 | "login": "rachmari", 107 | "id": 9831992, 108 | "node_id": "MDQ6VXNlcjk4MzE5OTI=", 109 | "avatar_url": "https://avatars2.githubusercontent.com/u/9831992?v=4", 110 | "gravatar_id": "", 111 | "url": "https://api.github.com/users/rachmari", 112 | "html_url": "https://github.com/rachmari", 113 | "followers_url": "https://api.github.com/users/rachmari/followers", 114 | "following_url": "https://api.github.com/users/rachmari/following{/other_user}", 115 | "gists_url": "https://api.github.com/users/rachmari/gists{/gist_id}", 116 | "starred_url": "https://api.github.com/users/rachmari/starred{/owner}{/repo}", 117 | "subscriptions_url": "https://api.github.com/users/rachmari/subscriptions", 118 | "organizations_url": "https://api.github.com/users/rachmari/orgs", 119 | "repos_url": "https://api.github.com/users/rachmari/repos", 120 | "events_url": "https://api.github.com/users/rachmari/events{/privacy}", 121 | "received_events_url": "https://api.github.com/users/rachmari/received_events", 122 | "type": "User", 123 | "site_admin": true 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /tests/json/issue_comment_created.json: -------------------------------------------------------------------------------- 1 | { 2 | "action": "created", 3 | "issue": { 4 | "url": "https://api.github.com/repos/Codertocat/Hello-World/issues/2", 5 | "repository_url": "https://api.github.com/repos/Codertocat/Hello-World", 6 | "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/2/labels{/name}", 7 | "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/2/comments", 8 | "events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/2/events", 9 | "html_url": "https://github.com/Codertocat/Hello-World/issues/2", 10 | "id": 327883527, 11 | "node_id": "MDU6SXNzdWUzMjc4ODM1Mjc=", 12 | "number": 2, 13 | "title": "Spelling error in the README file", 14 | "user": { 15 | "login": "Codertocat", 16 | "id": 21031067, 17 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 18 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 19 | "gravatar_id": "", 20 | "url": "https://api.github.com/users/Codertocat", 21 | "html_url": "https://github.com/Codertocat", 22 | "followers_url": "https://api.github.com/users/Codertocat/followers", 23 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 24 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 25 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 26 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 27 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 28 | "repos_url": "https://api.github.com/users/Codertocat/repos", 29 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 30 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 31 | "type": "User", 32 | "site_admin": false 33 | }, 34 | "labels": [ 35 | { 36 | "id": 949737505, 37 | "node_id": "MDU6TGFiZWw5NDk3Mzc1MDU=", 38 | "url": "https://api.github.com/repos/Codertocat/Hello-World/labels/bug", 39 | "name": "bug", 40 | "color": "d73a4a", 41 | "default": true 42 | } 43 | ], 44 | "state": "open", 45 | "locked": false, 46 | "assignee": null, 47 | "assignees": [ 48 | 49 | ], 50 | "milestone": null, 51 | "comments": 0, 52 | "created_at": "2018-05-30T20:18:32Z", 53 | "updated_at": "2018-05-30T20:18:32Z", 54 | "closed_at": null, 55 | "author_association": "OWNER", 56 | "body": "It looks like you accidently spelled 'commit' with two 't's." 57 | }, 58 | "comment": { 59 | "url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments/393304133", 60 | "html_url": "https://github.com/Codertocat/Hello-World/issues/2#issuecomment-393304133", 61 | "issue_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/2", 62 | "id": 393304133, 63 | "node_id": "MDEyOklzc3VlQ29tbWVudDM5MzMwNDEzMw==", 64 | "user": { 65 | "login": "Codertocat", 66 | "id": 21031067, 67 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 68 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 69 | "gravatar_id": "", 70 | "url": "https://api.github.com/users/Codertocat", 71 | "html_url": "https://github.com/Codertocat", 72 | "followers_url": "https://api.github.com/users/Codertocat/followers", 73 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 74 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 75 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 76 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 77 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 78 | "repos_url": "https://api.github.com/users/Codertocat/repos", 79 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 80 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 81 | "type": "User", 82 | "site_admin": false 83 | }, 84 | "created_at": "2018-05-30T20:18:32Z", 85 | "updated_at": "2018-05-30T20:18:32Z", 86 | "author_association": "OWNER", 87 | "body": "You are totally right! I'll get this fixed right away." 88 | }, 89 | "repository": { 90 | "id": 135493233, 91 | "node_id": "MDEwOlJlcG9zaXRvcnkxMzU0OTMyMzM=", 92 | "name": "Hello-World", 93 | "full_name": "Codertocat/Hello-World", 94 | "owner": { 95 | "login": "Codertocat", 96 | "id": 21031067, 97 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 98 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 99 | "gravatar_id": "", 100 | "url": "https://api.github.com/users/Codertocat", 101 | "html_url": "https://github.com/Codertocat", 102 | "followers_url": "https://api.github.com/users/Codertocat/followers", 103 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 104 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 105 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 106 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 107 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 108 | "repos_url": "https://api.github.com/users/Codertocat/repos", 109 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 110 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 111 | "type": "User", 112 | "site_admin": false 113 | }, 114 | "private": false, 115 | "html_url": "https://github.com/Codertocat/Hello-World", 116 | "description": null, 117 | "fork": false, 118 | "url": "https://api.github.com/repos/Codertocat/Hello-World", 119 | "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", 120 | "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", 121 | "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", 122 | "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", 123 | "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", 124 | "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", 125 | "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", 126 | "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", 127 | "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", 128 | "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", 129 | "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", 130 | "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", 131 | "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", 132 | "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", 133 | "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", 134 | "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", 135 | "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", 136 | "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", 137 | "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", 138 | "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", 139 | "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", 140 | "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", 141 | "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", 142 | "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", 143 | "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", 144 | "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", 145 | "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", 146 | "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", 147 | "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", 148 | "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", 149 | "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", 150 | "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", 151 | "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", 152 | "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", 153 | "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", 154 | "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", 155 | "created_at": "2018-05-30T20:18:04Z", 156 | "updated_at": "2018-05-30T20:18:10Z", 157 | "pushed_at": "2018-05-30T20:18:30Z", 158 | "git_url": "git://github.com/Codertocat/Hello-World.git", 159 | "ssh_url": "git@github.com:Codertocat/Hello-World.git", 160 | "clone_url": "https://github.com/Codertocat/Hello-World.git", 161 | "svn_url": "https://github.com/Codertocat/Hello-World", 162 | "homepage": null, 163 | "size": 0, 164 | "stargazers_count": 0, 165 | "watchers_count": 0, 166 | "language": null, 167 | "has_issues": true, 168 | "has_projects": true, 169 | "has_downloads": true, 170 | "has_wiki": true, 171 | "has_pages": true, 172 | "forks_count": 0, 173 | "mirror_url": null, 174 | "archived": false, 175 | "open_issues_count": 2, 176 | "license": null, 177 | "forks": 0, 178 | "open_issues": 2, 179 | "watchers": 0, 180 | "default_branch": "master" 181 | }, 182 | "sender": { 183 | "login": "Codertocat", 184 | "id": 21031067, 185 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 186 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 187 | "gravatar_id": "", 188 | "url": "https://api.github.com/users/Codertocat", 189 | "html_url": "https://github.com/Codertocat", 190 | "followers_url": "https://api.github.com/users/Codertocat/followers", 191 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 192 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 193 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 194 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 195 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 196 | "repos_url": "https://api.github.com/users/Codertocat/repos", 197 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 198 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 199 | "type": "User", 200 | "site_admin": false 201 | } 202 | } 203 | -------------------------------------------------------------------------------- /tests/json/issues_edited.json: -------------------------------------------------------------------------------- 1 | { 2 | "action": "edited", 3 | "issue": { 4 | "url": "https://api.github.com/repos/Codertocat/Hello-World/issues/2", 5 | "repository_url": "https://api.github.com/repos/Codertocat/Hello-World", 6 | "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/2/labels{/name}", 7 | "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/2/comments", 8 | "events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/2/events", 9 | "html_url": "https://github.com/Codertocat/Hello-World/issues/2", 10 | "id": 327883527, 11 | "node_id": "MDU6SXNzdWUzMjc4ODM1Mjc=", 12 | "number": 2, 13 | "title": "Spelling error in the README file", 14 | "user": { 15 | "login": "Codertocat", 16 | "id": 21031067, 17 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 18 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 19 | "gravatar_id": "", 20 | "url": "https://api.github.com/users/Codertocat", 21 | "html_url": "https://github.com/Codertocat", 22 | "followers_url": "https://api.github.com/users/Codertocat/followers", 23 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 24 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 25 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 26 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 27 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 28 | "repos_url": "https://api.github.com/users/Codertocat/repos", 29 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 30 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 31 | "type": "User", 32 | "site_admin": false 33 | }, 34 | "labels": [ 35 | { 36 | "id": 949737505, 37 | "node_id": "MDU6TGFiZWw5NDk3Mzc1MDU=", 38 | "url": "https://api.github.com/repos/Codertocat/Hello-World/labels/bug", 39 | "name": "bug", 40 | "color": "d73a4a", 41 | "default": true 42 | } 43 | ], 44 | "state": "open", 45 | "locked": false, 46 | "assignee": null, 47 | "assignees": [ 48 | 49 | ], 50 | "milestone": null, 51 | "comments": 0, 52 | "created_at": "2018-05-30T20:18:32Z", 53 | "updated_at": "2018-05-30T20:18:32Z", 54 | "closed_at": null, 55 | "author_association": "OWNER", 56 | "body": "It looks like you accidently spelled 'commit' with two 't's." 57 | }, 58 | "changes": { 59 | }, 60 | "repository": { 61 | "id": 135493233, 62 | "node_id": "MDEwOlJlcG9zaXRvcnkxMzU0OTMyMzM=", 63 | "name": "Hello-World", 64 | "full_name": "Codertocat/Hello-World", 65 | "owner": { 66 | "login": "Codertocat", 67 | "id": 21031067, 68 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 69 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 70 | "gravatar_id": "", 71 | "url": "https://api.github.com/users/Codertocat", 72 | "html_url": "https://github.com/Codertocat", 73 | "followers_url": "https://api.github.com/users/Codertocat/followers", 74 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 75 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 76 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 77 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 78 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 79 | "repos_url": "https://api.github.com/users/Codertocat/repos", 80 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 81 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 82 | "type": "User", 83 | "site_admin": false 84 | }, 85 | "private": false, 86 | "html_url": "https://github.com/Codertocat/Hello-World", 87 | "description": null, 88 | "fork": false, 89 | "url": "https://api.github.com/repos/Codertocat/Hello-World", 90 | "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", 91 | "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", 92 | "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", 93 | "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", 94 | "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", 95 | "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", 96 | "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", 97 | "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", 98 | "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", 99 | "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", 100 | "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", 101 | "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", 102 | "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", 103 | "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", 104 | "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", 105 | "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", 106 | "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", 107 | "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", 108 | "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", 109 | "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", 110 | "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", 111 | "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", 112 | "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", 113 | "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", 114 | "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", 115 | "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", 116 | "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", 117 | "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", 118 | "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", 119 | "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", 120 | "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", 121 | "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", 122 | "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", 123 | "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", 124 | "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", 125 | "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", 126 | "created_at": "2018-05-30T20:18:04Z", 127 | "updated_at": "2018-05-30T20:18:10Z", 128 | "pushed_at": "2018-05-30T20:18:30Z", 129 | "git_url": "git://github.com/Codertocat/Hello-World.git", 130 | "ssh_url": "git@github.com:Codertocat/Hello-World.git", 131 | "clone_url": "https://github.com/Codertocat/Hello-World.git", 132 | "svn_url": "https://github.com/Codertocat/Hello-World", 133 | "homepage": null, 134 | "size": 0, 135 | "stargazers_count": 0, 136 | "watchers_count": 0, 137 | "language": null, 138 | "has_issues": true, 139 | "has_projects": true, 140 | "has_downloads": true, 141 | "has_wiki": true, 142 | "has_pages": true, 143 | "forks_count": 0, 144 | "mirror_url": null, 145 | "archived": false, 146 | "open_issues_count": 2, 147 | "license": null, 148 | "forks": 0, 149 | "open_issues": 2, 150 | "watchers": 0, 151 | "default_branch": "master" 152 | }, 153 | "sender": { 154 | "login": "Codertocat", 155 | "id": 21031067, 156 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 157 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 158 | "gravatar_id": "", 159 | "url": "https://api.github.com/users/Codertocat", 160 | "html_url": "https://github.com/Codertocat", 161 | "followers_url": "https://api.github.com/users/Codertocat/followers", 162 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 163 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 164 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 165 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 166 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 167 | "repos_url": "https://api.github.com/users/Codertocat/repos", 168 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 169 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 170 | "type": "User", 171 | "site_admin": false 172 | } 173 | } 174 | -------------------------------------------------------------------------------- /tests/json/label.json: -------------------------------------------------------------------------------- 1 | { 2 | "action": "deleted", 3 | "label": { 4 | "id": 949738130, 5 | "node_id": "MDU6TGFiZWw5NDk3MzgxMzA=", 6 | "url": "https://api.github.com/repos/Codertocat/Hello-World/labels/:bug:%20Bugfix", 7 | "name": ":bug: Bugfix", 8 | "color": "cb1f00", 9 | "default": false 10 | }, 11 | "repository": { 12 | "id": 135493233, 13 | "node_id": "MDEwOlJlcG9zaXRvcnkxMzU0OTMyMzM=", 14 | "name": "Hello-World", 15 | "full_name": "Codertocat/Hello-World", 16 | "owner": { 17 | "login": "Codertocat", 18 | "id": 21031067, 19 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 20 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 21 | "gravatar_id": "", 22 | "url": "https://api.github.com/users/Codertocat", 23 | "html_url": "https://github.com/Codertocat", 24 | "followers_url": "https://api.github.com/users/Codertocat/followers", 25 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 26 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 27 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 28 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 29 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 30 | "repos_url": "https://api.github.com/users/Codertocat/repos", 31 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 32 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 33 | "type": "User", 34 | "site_admin": false 35 | }, 36 | "private": false, 37 | "html_url": "https://github.com/Codertocat/Hello-World", 38 | "description": null, 39 | "fork": false, 40 | "url": "https://api.github.com/repos/Codertocat/Hello-World", 41 | "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", 42 | "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", 43 | "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", 44 | "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", 45 | "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", 46 | "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", 47 | "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", 48 | "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", 49 | "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", 50 | "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", 51 | "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", 52 | "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", 53 | "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", 54 | "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", 55 | "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", 56 | "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", 57 | "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", 58 | "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", 59 | "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", 60 | "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", 61 | "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", 62 | "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", 63 | "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", 64 | "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", 65 | "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", 66 | "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", 67 | "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", 68 | "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", 69 | "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", 70 | "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", 71 | "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", 72 | "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", 73 | "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", 74 | "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", 75 | "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", 76 | "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", 77 | "created_at": "2018-05-30T20:18:04Z", 78 | "updated_at": "2018-05-30T20:18:50Z", 79 | "pushed_at": "2018-05-30T20:18:48Z", 80 | "git_url": "git://github.com/Codertocat/Hello-World.git", 81 | "ssh_url": "git@github.com:Codertocat/Hello-World.git", 82 | "clone_url": "https://github.com/Codertocat/Hello-World.git", 83 | "svn_url": "https://github.com/Codertocat/Hello-World", 84 | "homepage": null, 85 | "size": 0, 86 | "stargazers_count": 0, 87 | "watchers_count": 0, 88 | "language": null, 89 | "has_issues": true, 90 | "has_projects": true, 91 | "has_downloads": true, 92 | "has_wiki": true, 93 | "has_pages": true, 94 | "forks_count": 0, 95 | "mirror_url": null, 96 | "archived": false, 97 | "open_issues_count": 1, 98 | "license": null, 99 | "forks": 0, 100 | "open_issues": 1, 101 | "watchers": 0, 102 | "default_branch": "master" 103 | }, 104 | "sender": { 105 | "login": "Codertocat", 106 | "id": 21031067, 107 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 108 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 109 | "gravatar_id": "", 110 | "url": "https://api.github.com/users/Codertocat", 111 | "html_url": "https://github.com/Codertocat", 112 | "followers_url": "https://api.github.com/users/Codertocat/followers", 113 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 114 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 115 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 116 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 117 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 118 | "repos_url": "https://api.github.com/users/Codertocat/repos", 119 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 120 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 121 | "type": "User", 122 | "site_admin": false 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /tests/json/pull_request_closed.json: -------------------------------------------------------------------------------- 1 | { 2 | "action": "closed", 3 | "number": 1, 4 | "pull_request": { 5 | "url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/1", 6 | "id": 191568743, 7 | "node_id": "MDExOlB1bGxSZXF1ZXN0MTkxNTY4NzQz", 8 | "html_url": "https://github.com/Codertocat/Hello-World/pull/1", 9 | "diff_url": "https://github.com/Codertocat/Hello-World/pull/1.diff", 10 | "patch_url": "https://github.com/Codertocat/Hello-World/pull/1.patch", 11 | "issue_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/1", 12 | "number": 1, 13 | "state": "closed", 14 | "locked": false, 15 | "title": "Update the README with new information", 16 | "user": { 17 | "login": "Codertocat", 18 | "id": 21031067, 19 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 20 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 21 | "gravatar_id": "", 22 | "url": "https://api.github.com/users/Codertocat", 23 | "html_url": "https://github.com/Codertocat", 24 | "followers_url": "https://api.github.com/users/Codertocat/followers", 25 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 26 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 27 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 28 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 29 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 30 | "repos_url": "https://api.github.com/users/Codertocat/repos", 31 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 32 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 33 | "type": "User", 34 | "site_admin": false 35 | }, 36 | "body": "This is a pretty simple change that we need to pull into master.", 37 | "created_at": "2018-05-30T20:18:30Z", 38 | "updated_at": "2018-05-30T20:18:50Z", 39 | "closed_at": "2018-05-30T20:18:50Z", 40 | "merged_at": null, 41 | "merge_commit_sha": "414cb0069601a32b00bd122a2380cd283626a8e5", 42 | "assignee": null, 43 | "assignees": [ 44 | 45 | ], 46 | "requested_reviewers": [ 47 | 48 | ], 49 | "requested_teams": [ 50 | 51 | ], 52 | "labels": [ 53 | 54 | ], 55 | "milestone": null, 56 | "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/1/commits", 57 | "review_comments_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/1/comments", 58 | "review_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/comments{/number}", 59 | "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/1/comments", 60 | "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/34c5c7793cb3b279e22454cb6750c80560547b3a", 61 | "head": { 62 | "label": "Codertocat:changes", 63 | "ref": "changes", 64 | "sha": "34c5c7793cb3b279e22454cb6750c80560547b3a", 65 | "user": { 66 | "login": "Codertocat", 67 | "id": 21031067, 68 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 69 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 70 | "gravatar_id": "", 71 | "url": "https://api.github.com/users/Codertocat", 72 | "html_url": "https://github.com/Codertocat", 73 | "followers_url": "https://api.github.com/users/Codertocat/followers", 74 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 75 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 76 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 77 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 78 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 79 | "repos_url": "https://api.github.com/users/Codertocat/repos", 80 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 81 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 82 | "type": "User", 83 | "site_admin": false 84 | }, 85 | "repo": { 86 | "id": 135493233, 87 | "node_id": "MDEwOlJlcG9zaXRvcnkxMzU0OTMyMzM=", 88 | "name": "Hello-World", 89 | "full_name": "Codertocat/Hello-World", 90 | "owner": { 91 | "login": "Codertocat", 92 | "id": 21031067, 93 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 94 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 95 | "gravatar_id": "", 96 | "url": "https://api.github.com/users/Codertocat", 97 | "html_url": "https://github.com/Codertocat", 98 | "followers_url": "https://api.github.com/users/Codertocat/followers", 99 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 100 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 101 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 102 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 103 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 104 | "repos_url": "https://api.github.com/users/Codertocat/repos", 105 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 106 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 107 | "type": "User", 108 | "site_admin": false 109 | }, 110 | "private": false, 111 | "html_url": "https://github.com/Codertocat/Hello-World", 112 | "description": null, 113 | "fork": false, 114 | "url": "https://api.github.com/repos/Codertocat/Hello-World", 115 | "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", 116 | "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", 117 | "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", 118 | "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", 119 | "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", 120 | "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", 121 | "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", 122 | "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", 123 | "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", 124 | "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", 125 | "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", 126 | "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", 127 | "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", 128 | "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", 129 | "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", 130 | "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", 131 | "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", 132 | "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", 133 | "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", 134 | "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", 135 | "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", 136 | "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", 137 | "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", 138 | "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", 139 | "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", 140 | "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", 141 | "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", 142 | "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", 143 | "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", 144 | "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", 145 | "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", 146 | "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", 147 | "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", 148 | "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", 149 | "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", 150 | "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", 151 | "created_at": "2018-05-30T20:18:04Z", 152 | "updated_at": "2018-05-30T20:18:50Z", 153 | "pushed_at": "2018-05-30T20:18:48Z", 154 | "git_url": "git://github.com/Codertocat/Hello-World.git", 155 | "ssh_url": "git@github.com:Codertocat/Hello-World.git", 156 | "clone_url": "https://github.com/Codertocat/Hello-World.git", 157 | "svn_url": "https://github.com/Codertocat/Hello-World", 158 | "homepage": null, 159 | "size": 0, 160 | "stargazers_count": 0, 161 | "watchers_count": 0, 162 | "language": null, 163 | "has_issues": true, 164 | "has_projects": true, 165 | "has_downloads": true, 166 | "has_wiki": true, 167 | "has_pages": true, 168 | "forks_count": 0, 169 | "mirror_url": null, 170 | "archived": false, 171 | "open_issues_count": 1, 172 | "license": null, 173 | "forks": 0, 174 | "open_issues": 1, 175 | "watchers": 0, 176 | "default_branch": "master" 177 | } 178 | }, 179 | "base": { 180 | "label": "Codertocat:master", 181 | "ref": "master", 182 | "sha": "a10867b14bb761a232cd80139fbd4c0d33264240", 183 | "user": { 184 | "login": "Codertocat", 185 | "id": 21031067, 186 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 187 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 188 | "gravatar_id": "", 189 | "url": "https://api.github.com/users/Codertocat", 190 | "html_url": "https://github.com/Codertocat", 191 | "followers_url": "https://api.github.com/users/Codertocat/followers", 192 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 193 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 194 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 195 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 196 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 197 | "repos_url": "https://api.github.com/users/Codertocat/repos", 198 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 199 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 200 | "type": "User", 201 | "site_admin": false 202 | }, 203 | "repo": { 204 | "id": 135493233, 205 | "node_id": "MDEwOlJlcG9zaXRvcnkxMzU0OTMyMzM=", 206 | "name": "Hello-World", 207 | "full_name": "Codertocat/Hello-World", 208 | "owner": { 209 | "login": "Codertocat", 210 | "id": 21031067, 211 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 212 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 213 | "gravatar_id": "", 214 | "url": "https://api.github.com/users/Codertocat", 215 | "html_url": "https://github.com/Codertocat", 216 | "followers_url": "https://api.github.com/users/Codertocat/followers", 217 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 218 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 219 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 220 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 221 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 222 | "repos_url": "https://api.github.com/users/Codertocat/repos", 223 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 224 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 225 | "type": "User", 226 | "site_admin": false 227 | }, 228 | "private": false, 229 | "html_url": "https://github.com/Codertocat/Hello-World", 230 | "description": null, 231 | "fork": false, 232 | "url": "https://api.github.com/repos/Codertocat/Hello-World", 233 | "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", 234 | "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", 235 | "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", 236 | "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", 237 | "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", 238 | "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", 239 | "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", 240 | "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", 241 | "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", 242 | "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", 243 | "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", 244 | "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", 245 | "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", 246 | "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", 247 | "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", 248 | "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", 249 | "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", 250 | "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", 251 | "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", 252 | "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", 253 | "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", 254 | "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", 255 | "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", 256 | "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", 257 | "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", 258 | "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", 259 | "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", 260 | "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", 261 | "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", 262 | "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", 263 | "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", 264 | "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", 265 | "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", 266 | "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", 267 | "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", 268 | "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", 269 | "created_at": "2018-05-30T20:18:04Z", 270 | "updated_at": "2018-05-30T20:18:50Z", 271 | "pushed_at": "2018-05-30T20:18:48Z", 272 | "git_url": "git://github.com/Codertocat/Hello-World.git", 273 | "ssh_url": "git@github.com:Codertocat/Hello-World.git", 274 | "clone_url": "https://github.com/Codertocat/Hello-World.git", 275 | "svn_url": "https://github.com/Codertocat/Hello-World", 276 | "homepage": null, 277 | "size": 0, 278 | "stargazers_count": 0, 279 | "watchers_count": 0, 280 | "language": null, 281 | "has_issues": true, 282 | "has_projects": true, 283 | "has_downloads": true, 284 | "has_wiki": true, 285 | "has_pages": true, 286 | "forks_count": 0, 287 | "mirror_url": null, 288 | "archived": false, 289 | "open_issues_count": 1, 290 | "license": null, 291 | "forks": 0, 292 | "open_issues": 1, 293 | "watchers": 0, 294 | "default_branch": "master" 295 | } 296 | }, 297 | "_links": { 298 | "self": { 299 | "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/1" 300 | }, 301 | "html": { 302 | "href": "https://github.com/Codertocat/Hello-World/pull/1" 303 | }, 304 | "issue": { 305 | "href": "https://api.github.com/repos/Codertocat/Hello-World/issues/1" 306 | }, 307 | "comments": { 308 | "href": "https://api.github.com/repos/Codertocat/Hello-World/issues/1/comments" 309 | }, 310 | "review_comments": { 311 | "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/1/comments" 312 | }, 313 | "review_comment": { 314 | "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/comments{/number}" 315 | }, 316 | "commits": { 317 | "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/1/commits" 318 | }, 319 | "statuses": { 320 | "href": "https://api.github.com/repos/Codertocat/Hello-World/statuses/34c5c7793cb3b279e22454cb6750c80560547b3a" 321 | } 322 | }, 323 | "author_association": "OWNER", 324 | "merged": false, 325 | "mergeable": true, 326 | "rebaseable": true, 327 | "mergeable_state": "clean", 328 | "merged_by": null, 329 | "comments": 0, 330 | "review_comments": 1, 331 | "maintainer_can_modify": false, 332 | "commits": 1, 333 | "additions": 1, 334 | "deletions": 1, 335 | "changed_files": 1 336 | }, 337 | "repository": { 338 | "id": 135493233, 339 | "node_id": "MDEwOlJlcG9zaXRvcnkxMzU0OTMyMzM=", 340 | "name": "Hello-World", 341 | "full_name": "Codertocat/Hello-World", 342 | "owner": { 343 | "login": "Codertocat", 344 | "id": 21031067, 345 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 346 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 347 | "gravatar_id": "", 348 | "url": "https://api.github.com/users/Codertocat", 349 | "html_url": "https://github.com/Codertocat", 350 | "followers_url": "https://api.github.com/users/Codertocat/followers", 351 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 352 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 353 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 354 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 355 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 356 | "repos_url": "https://api.github.com/users/Codertocat/repos", 357 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 358 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 359 | "type": "User", 360 | "site_admin": false 361 | }, 362 | "private": false, 363 | "html_url": "https://github.com/Codertocat/Hello-World", 364 | "description": null, 365 | "fork": false, 366 | "url": "https://api.github.com/repos/Codertocat/Hello-World", 367 | "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", 368 | "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", 369 | "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", 370 | "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", 371 | "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", 372 | "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", 373 | "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", 374 | "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", 375 | "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", 376 | "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", 377 | "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", 378 | "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", 379 | "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", 380 | "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", 381 | "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", 382 | "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", 383 | "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", 384 | "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", 385 | "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", 386 | "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", 387 | "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", 388 | "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", 389 | "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", 390 | "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", 391 | "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", 392 | "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", 393 | "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", 394 | "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", 395 | "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", 396 | "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", 397 | "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", 398 | "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", 399 | "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", 400 | "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", 401 | "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", 402 | "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", 403 | "created_at": "2018-05-30T20:18:04Z", 404 | "updated_at": "2018-05-30T20:18:50Z", 405 | "pushed_at": "2018-05-30T20:18:48Z", 406 | "git_url": "git://github.com/Codertocat/Hello-World.git", 407 | "ssh_url": "git@github.com:Codertocat/Hello-World.git", 408 | "clone_url": "https://github.com/Codertocat/Hello-World.git", 409 | "svn_url": "https://github.com/Codertocat/Hello-World", 410 | "homepage": null, 411 | "size": 0, 412 | "stargazers_count": 0, 413 | "watchers_count": 0, 414 | "language": null, 415 | "has_issues": true, 416 | "has_projects": true, 417 | "has_downloads": true, 418 | "has_wiki": true, 419 | "has_pages": true, 420 | "forks_count": 0, 421 | "mirror_url": null, 422 | "archived": false, 423 | "open_issues_count": 1, 424 | "license": null, 425 | "forks": 0, 426 | "open_issues": 1, 427 | "watchers": 0, 428 | "default_branch": "master" 429 | }, 430 | "sender": { 431 | "login": "Codertocat", 432 | "id": 21031067, 433 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 434 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 435 | "gravatar_id": "", 436 | "url": "https://api.github.com/users/Codertocat", 437 | "html_url": "https://github.com/Codertocat", 438 | "followers_url": "https://api.github.com/users/Codertocat/followers", 439 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 440 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 441 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 442 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 443 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 444 | "repos_url": "https://api.github.com/users/Codertocat/repos", 445 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 446 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 447 | "type": "User", 448 | "site_admin": false 449 | } 450 | } 451 | -------------------------------------------------------------------------------- /tests/json/pull_request_review.json: -------------------------------------------------------------------------------- 1 | { 2 | "action": "submitted", 3 | "review": { 4 | "id": 124575911, 5 | "node_id": "MDE3OlB1bGxSZXF1ZXN0UmV2aWV3MTI0NTc1OTEx", 6 | "user": { 7 | "login": "Codertocat", 8 | "id": 21031067, 9 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 10 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 11 | "gravatar_id": "", 12 | "url": "https://api.github.com/users/Codertocat", 13 | "html_url": "https://github.com/Codertocat", 14 | "followers_url": "https://api.github.com/users/Codertocat/followers", 15 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 16 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 17 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 18 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 19 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 20 | "repos_url": "https://api.github.com/users/Codertocat/repos", 21 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 22 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 23 | "type": "User", 24 | "site_admin": false 25 | }, 26 | "body": null, 27 | "commit_id": "34c5c7793cb3b279e22454cb6750c80560547b3a", 28 | "submitted_at": "2018-05-30T20:18:31Z", 29 | "state": "commented", 30 | "html_url": "https://github.com/Codertocat/Hello-World/pull/1#pullrequestreview-124575911", 31 | "pull_request_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/1", 32 | "author_association": "OWNER", 33 | "_links": { 34 | "html": { 35 | "href": "https://github.com/Codertocat/Hello-World/pull/1#pullrequestreview-124575911" 36 | }, 37 | "pull_request": { 38 | "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/1" 39 | } 40 | } 41 | }, 42 | "pull_request": { 43 | "url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/1", 44 | "id": 191568743, 45 | "node_id": "MDExOlB1bGxSZXF1ZXN0MTkxNTY4NzQz", 46 | "html_url": "https://github.com/Codertocat/Hello-World/pull/1", 47 | "diff_url": "https://github.com/Codertocat/Hello-World/pull/1.diff", 48 | "patch_url": "https://github.com/Codertocat/Hello-World/pull/1.patch", 49 | "issue_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/1", 50 | "number": 1, 51 | "state": "open", 52 | "locked": false, 53 | "title": "Update the README with new information", 54 | "user": { 55 | "login": "Codertocat", 56 | "id": 21031067, 57 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 58 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 59 | "gravatar_id": "", 60 | "url": "https://api.github.com/users/Codertocat", 61 | "html_url": "https://github.com/Codertocat", 62 | "followers_url": "https://api.github.com/users/Codertocat/followers", 63 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 64 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 65 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 66 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 67 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 68 | "repos_url": "https://api.github.com/users/Codertocat/repos", 69 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 70 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 71 | "type": "User", 72 | "site_admin": false 73 | }, 74 | "body": "This is a pretty simple change that we need to pull into master.", 75 | "created_at": "2018-05-30T20:18:30Z", 76 | "updated_at": "2018-05-30T20:18:31Z", 77 | "closed_at": null, 78 | "merged_at": null, 79 | "merge_commit_sha": "414cb0069601a32b00bd122a2380cd283626a8e5", 80 | "assignee": null, 81 | "assignees": [ 82 | 83 | ], 84 | "requested_reviewers": [ 85 | 86 | ], 87 | "requested_teams": [ 88 | 89 | ], 90 | "labels": [ 91 | 92 | ], 93 | "milestone": null, 94 | "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/1/commits", 95 | "review_comments_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/1/comments", 96 | "review_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/comments{/number}", 97 | "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/1/comments", 98 | "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/34c5c7793cb3b279e22454cb6750c80560547b3a", 99 | "head": { 100 | "label": "Codertocat:changes", 101 | "ref": "changes", 102 | "sha": "34c5c7793cb3b279e22454cb6750c80560547b3a", 103 | "user": { 104 | "login": "Codertocat", 105 | "id": 21031067, 106 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 107 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 108 | "gravatar_id": "", 109 | "url": "https://api.github.com/users/Codertocat", 110 | "html_url": "https://github.com/Codertocat", 111 | "followers_url": "https://api.github.com/users/Codertocat/followers", 112 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 113 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 114 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 115 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 116 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 117 | "repos_url": "https://api.github.com/users/Codertocat/repos", 118 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 119 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 120 | "type": "User", 121 | "site_admin": false 122 | }, 123 | "repo": { 124 | "id": 135493233, 125 | "node_id": "MDEwOlJlcG9zaXRvcnkxMzU0OTMyMzM=", 126 | "name": "Hello-World", 127 | "full_name": "Codertocat/Hello-World", 128 | "owner": { 129 | "login": "Codertocat", 130 | "id": 21031067, 131 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 132 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 133 | "gravatar_id": "", 134 | "url": "https://api.github.com/users/Codertocat", 135 | "html_url": "https://github.com/Codertocat", 136 | "followers_url": "https://api.github.com/users/Codertocat/followers", 137 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 138 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 139 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 140 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 141 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 142 | "repos_url": "https://api.github.com/users/Codertocat/repos", 143 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 144 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 145 | "type": "User", 146 | "site_admin": false 147 | }, 148 | "private": false, 149 | "html_url": "https://github.com/Codertocat/Hello-World", 150 | "description": null, 151 | "fork": false, 152 | "url": "https://api.github.com/repos/Codertocat/Hello-World", 153 | "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", 154 | "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", 155 | "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", 156 | "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", 157 | "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", 158 | "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", 159 | "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", 160 | "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", 161 | "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", 162 | "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", 163 | "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", 164 | "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", 165 | "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", 166 | "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", 167 | "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", 168 | "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", 169 | "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", 170 | "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", 171 | "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", 172 | "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", 173 | "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", 174 | "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", 175 | "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", 176 | "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", 177 | "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", 178 | "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", 179 | "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", 180 | "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", 181 | "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", 182 | "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", 183 | "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", 184 | "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", 185 | "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", 186 | "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", 187 | "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", 188 | "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", 189 | "created_at": "2018-05-30T20:18:04Z", 190 | "updated_at": "2018-05-30T20:18:10Z", 191 | "pushed_at": "2018-05-30T20:18:30Z", 192 | "git_url": "git://github.com/Codertocat/Hello-World.git", 193 | "ssh_url": "git@github.com:Codertocat/Hello-World.git", 194 | "clone_url": "https://github.com/Codertocat/Hello-World.git", 195 | "svn_url": "https://github.com/Codertocat/Hello-World", 196 | "homepage": null, 197 | "size": 0, 198 | "stargazers_count": 0, 199 | "watchers_count": 0, 200 | "language": null, 201 | "has_issues": true, 202 | "has_projects": true, 203 | "has_downloads": true, 204 | "has_wiki": true, 205 | "has_pages": true, 206 | "forks_count": 0, 207 | "mirror_url": null, 208 | "archived": false, 209 | "open_issues_count": 1, 210 | "license": null, 211 | "forks": 0, 212 | "open_issues": 1, 213 | "watchers": 0, 214 | "default_branch": "master" 215 | } 216 | }, 217 | "base": { 218 | "label": "Codertocat:master", 219 | "ref": "master", 220 | "sha": "a10867b14bb761a232cd80139fbd4c0d33264240", 221 | "user": { 222 | "login": "Codertocat", 223 | "id": 21031067, 224 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 225 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 226 | "gravatar_id": "", 227 | "url": "https://api.github.com/users/Codertocat", 228 | "html_url": "https://github.com/Codertocat", 229 | "followers_url": "https://api.github.com/users/Codertocat/followers", 230 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 231 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 232 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 233 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 234 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 235 | "repos_url": "https://api.github.com/users/Codertocat/repos", 236 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 237 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 238 | "type": "User", 239 | "site_admin": false 240 | }, 241 | "repo": { 242 | "id": 135493233, 243 | "node_id": "MDEwOlJlcG9zaXRvcnkxMzU0OTMyMzM=", 244 | "name": "Hello-World", 245 | "full_name": "Codertocat/Hello-World", 246 | "owner": { 247 | "login": "Codertocat", 248 | "id": 21031067, 249 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 250 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 251 | "gravatar_id": "", 252 | "url": "https://api.github.com/users/Codertocat", 253 | "html_url": "https://github.com/Codertocat", 254 | "followers_url": "https://api.github.com/users/Codertocat/followers", 255 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 256 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 257 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 258 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 259 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 260 | "repos_url": "https://api.github.com/users/Codertocat/repos", 261 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 262 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 263 | "type": "User", 264 | "site_admin": false 265 | }, 266 | "private": false, 267 | "html_url": "https://github.com/Codertocat/Hello-World", 268 | "description": null, 269 | "fork": false, 270 | "url": "https://api.github.com/repos/Codertocat/Hello-World", 271 | "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", 272 | "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", 273 | "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", 274 | "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", 275 | "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", 276 | "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", 277 | "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", 278 | "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", 279 | "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", 280 | "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", 281 | "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", 282 | "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", 283 | "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", 284 | "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", 285 | "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", 286 | "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", 287 | "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", 288 | "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", 289 | "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", 290 | "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", 291 | "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", 292 | "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", 293 | "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", 294 | "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", 295 | "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", 296 | "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", 297 | "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", 298 | "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", 299 | "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", 300 | "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", 301 | "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", 302 | "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", 303 | "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", 304 | "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", 305 | "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", 306 | "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", 307 | "created_at": "2018-05-30T20:18:04Z", 308 | "updated_at": "2018-05-30T20:18:10Z", 309 | "pushed_at": "2018-05-30T20:18:30Z", 310 | "git_url": "git://github.com/Codertocat/Hello-World.git", 311 | "ssh_url": "git@github.com:Codertocat/Hello-World.git", 312 | "clone_url": "https://github.com/Codertocat/Hello-World.git", 313 | "svn_url": "https://github.com/Codertocat/Hello-World", 314 | "homepage": null, 315 | "size": 0, 316 | "stargazers_count": 0, 317 | "watchers_count": 0, 318 | "language": null, 319 | "has_issues": true, 320 | "has_projects": true, 321 | "has_downloads": true, 322 | "has_wiki": true, 323 | "has_pages": true, 324 | "forks_count": 0, 325 | "mirror_url": null, 326 | "archived": false, 327 | "open_issues_count": 1, 328 | "license": null, 329 | "forks": 0, 330 | "open_issues": 1, 331 | "watchers": 0, 332 | "default_branch": "master" 333 | } 334 | }, 335 | "_links": { 336 | "self": { 337 | "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/1" 338 | }, 339 | "html": { 340 | "href": "https://github.com/Codertocat/Hello-World/pull/1" 341 | }, 342 | "issue": { 343 | "href": "https://api.github.com/repos/Codertocat/Hello-World/issues/1" 344 | }, 345 | "comments": { 346 | "href": "https://api.github.com/repos/Codertocat/Hello-World/issues/1/comments" 347 | }, 348 | "review_comments": { 349 | "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/1/comments" 350 | }, 351 | "review_comment": { 352 | "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/comments{/number}" 353 | }, 354 | "commits": { 355 | "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/1/commits" 356 | }, 357 | "statuses": { 358 | "href": "https://api.github.com/repos/Codertocat/Hello-World/statuses/34c5c7793cb3b279e22454cb6750c80560547b3a" 359 | } 360 | }, 361 | "author_association": "OWNER" 362 | }, 363 | "repository": { 364 | "id": 135493233, 365 | "node_id": "MDEwOlJlcG9zaXRvcnkxMzU0OTMyMzM=", 366 | "name": "Hello-World", 367 | "full_name": "Codertocat/Hello-World", 368 | "owner": { 369 | "login": "Codertocat", 370 | "id": 21031067, 371 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 372 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 373 | "gravatar_id": "", 374 | "url": "https://api.github.com/users/Codertocat", 375 | "html_url": "https://github.com/Codertocat", 376 | "followers_url": "https://api.github.com/users/Codertocat/followers", 377 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 378 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 379 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 380 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 381 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 382 | "repos_url": "https://api.github.com/users/Codertocat/repos", 383 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 384 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 385 | "type": "User", 386 | "site_admin": false 387 | }, 388 | "private": false, 389 | "html_url": "https://github.com/Codertocat/Hello-World", 390 | "description": null, 391 | "fork": false, 392 | "url": "https://api.github.com/repos/Codertocat/Hello-World", 393 | "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", 394 | "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", 395 | "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", 396 | "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", 397 | "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", 398 | "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", 399 | "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", 400 | "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", 401 | "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", 402 | "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", 403 | "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", 404 | "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", 405 | "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", 406 | "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", 407 | "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", 408 | "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", 409 | "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", 410 | "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", 411 | "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", 412 | "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", 413 | "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", 414 | "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", 415 | "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", 416 | "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", 417 | "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", 418 | "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", 419 | "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", 420 | "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", 421 | "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", 422 | "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", 423 | "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", 424 | "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", 425 | "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", 426 | "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", 427 | "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", 428 | "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", 429 | "created_at": "2018-05-30T20:18:04Z", 430 | "updated_at": "2018-05-30T20:18:10Z", 431 | "pushed_at": "2018-05-30T20:18:30Z", 432 | "git_url": "git://github.com/Codertocat/Hello-World.git", 433 | "ssh_url": "git@github.com:Codertocat/Hello-World.git", 434 | "clone_url": "https://github.com/Codertocat/Hello-World.git", 435 | "svn_url": "https://github.com/Codertocat/Hello-World", 436 | "homepage": null, 437 | "size": 0, 438 | "stargazers_count": 0, 439 | "watchers_count": 0, 440 | "language": null, 441 | "has_issues": true, 442 | "has_projects": true, 443 | "has_downloads": true, 444 | "has_wiki": true, 445 | "has_pages": true, 446 | "forks_count": 0, 447 | "mirror_url": null, 448 | "archived": false, 449 | "open_issues_count": 1, 450 | "license": null, 451 | "forks": 0, 452 | "open_issues": 1, 453 | "watchers": 0, 454 | "default_branch": "master" 455 | }, 456 | "sender": { 457 | "login": "Codertocat", 458 | "id": 21031067, 459 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 460 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 461 | "gravatar_id": "", 462 | "url": "https://api.github.com/users/Codertocat", 463 | "html_url": "https://github.com/Codertocat", 464 | "followers_url": "https://api.github.com/users/Codertocat/followers", 465 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 466 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 467 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 468 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 469 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 470 | "repos_url": "https://api.github.com/users/Codertocat/repos", 471 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 472 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 473 | "type": "User", 474 | "site_admin": false 475 | } 476 | } -------------------------------------------------------------------------------- /tests/json/pull_request_review_comment.json: -------------------------------------------------------------------------------- 1 | { 2 | "action": "created", 3 | "comment": { 4 | "url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/comments/191908831", 5 | "pull_request_review_id": 124575911, 6 | "id": 191908831, 7 | "node_id": "MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MTkwODgzMQ==", 8 | "diff_hunk": "@@ -1 +1 @@\n-# Hello-World", 9 | "path": "README.md", 10 | "position": 1, 11 | "original_position": 1, 12 | "commit_id": "34c5c7793cb3b279e22454cb6750c80560547b3a", 13 | "original_commit_id": "34c5c7793cb3b279e22454cb6750c80560547b3a", 14 | "user": { 15 | "login": "Codertocat", 16 | "id": 21031067, 17 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 18 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 19 | "gravatar_id": "", 20 | "url": "https://api.github.com/users/Codertocat", 21 | "html_url": "https://github.com/Codertocat", 22 | "followers_url": "https://api.github.com/users/Codertocat/followers", 23 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 24 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 25 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 26 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 27 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 28 | "repos_url": "https://api.github.com/users/Codertocat/repos", 29 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 30 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 31 | "type": "User", 32 | "site_admin": false 33 | }, 34 | "body": "Maybe you should use more emojji on this line.", 35 | "created_at": "2018-05-30T20:18:31Z", 36 | "updated_at": "2018-05-30T20:18:31Z", 37 | "html_url": "https://github.com/Codertocat/Hello-World/pull/1#discussion_r191908831", 38 | "pull_request_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/1", 39 | "author_association": "OWNER", 40 | "_links": { 41 | "self": { 42 | "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/comments/191908831" 43 | }, 44 | "html": { 45 | "href": "https://github.com/Codertocat/Hello-World/pull/1#discussion_r191908831" 46 | }, 47 | "pull_request": { 48 | "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/1" 49 | } 50 | } 51 | }, 52 | "pull_request": { 53 | "url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/1", 54 | "id": 191568743, 55 | "node_id": "MDExOlB1bGxSZXF1ZXN0MTkxNTY4NzQz", 56 | "html_url": "https://github.com/Codertocat/Hello-World/pull/1", 57 | "diff_url": "https://github.com/Codertocat/Hello-World/pull/1.diff", 58 | "patch_url": "https://github.com/Codertocat/Hello-World/pull/1.patch", 59 | "issue_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/1", 60 | "number": 1, 61 | "state": "open", 62 | "locked": false, 63 | "title": "Update the README with new information", 64 | "user": { 65 | "login": "Codertocat", 66 | "id": 21031067, 67 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 68 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 69 | "gravatar_id": "", 70 | "url": "https://api.github.com/users/Codertocat", 71 | "html_url": "https://github.com/Codertocat", 72 | "followers_url": "https://api.github.com/users/Codertocat/followers", 73 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 74 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 75 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 76 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 77 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 78 | "repos_url": "https://api.github.com/users/Codertocat/repos", 79 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 80 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 81 | "type": "User", 82 | "site_admin": false 83 | }, 84 | "body": "This is a pretty simple change that we need to pull into master.", 85 | "created_at": "2018-05-30T20:18:30Z", 86 | "updated_at": "2018-05-30T20:18:31Z", 87 | "closed_at": null, 88 | "merged_at": null, 89 | "merge_commit_sha": "414cb0069601a32b00bd122a2380cd283626a8e5", 90 | "assignee": null, 91 | "assignees": [ 92 | 93 | ], 94 | "requested_reviewers": [ 95 | 96 | ], 97 | "requested_teams": [ 98 | 99 | ], 100 | "labels": [ 101 | 102 | ], 103 | "milestone": null, 104 | "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/1/commits", 105 | "review_comments_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/1/comments", 106 | "review_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls/comments{/number}", 107 | "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/1/comments", 108 | "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/34c5c7793cb3b279e22454cb6750c80560547b3a", 109 | "head": { 110 | "label": "Codertocat:changes", 111 | "ref": "changes", 112 | "sha": "34c5c7793cb3b279e22454cb6750c80560547b3a", 113 | "user": { 114 | "login": "Codertocat", 115 | "id": 21031067, 116 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 117 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 118 | "gravatar_id": "", 119 | "url": "https://api.github.com/users/Codertocat", 120 | "html_url": "https://github.com/Codertocat", 121 | "followers_url": "https://api.github.com/users/Codertocat/followers", 122 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 123 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 124 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 125 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 126 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 127 | "repos_url": "https://api.github.com/users/Codertocat/repos", 128 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 129 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 130 | "type": "User", 131 | "site_admin": false 132 | }, 133 | "repo": { 134 | "id": 135493233, 135 | "node_id": "MDEwOlJlcG9zaXRvcnkxMzU0OTMyMzM=", 136 | "name": "Hello-World", 137 | "full_name": "Codertocat/Hello-World", 138 | "owner": { 139 | "login": "Codertocat", 140 | "id": 21031067, 141 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 142 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 143 | "gravatar_id": "", 144 | "url": "https://api.github.com/users/Codertocat", 145 | "html_url": "https://github.com/Codertocat", 146 | "followers_url": "https://api.github.com/users/Codertocat/followers", 147 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 148 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 149 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 150 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 151 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 152 | "repos_url": "https://api.github.com/users/Codertocat/repos", 153 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 154 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 155 | "type": "User", 156 | "site_admin": false 157 | }, 158 | "private": false, 159 | "html_url": "https://github.com/Codertocat/Hello-World", 160 | "description": null, 161 | "fork": false, 162 | "url": "https://api.github.com/repos/Codertocat/Hello-World", 163 | "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", 164 | "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", 165 | "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", 166 | "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", 167 | "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", 168 | "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", 169 | "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", 170 | "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", 171 | "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", 172 | "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", 173 | "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", 174 | "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", 175 | "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", 176 | "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", 177 | "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", 178 | "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", 179 | "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", 180 | "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", 181 | "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", 182 | "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", 183 | "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", 184 | "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", 185 | "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", 186 | "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", 187 | "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", 188 | "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", 189 | "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", 190 | "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", 191 | "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", 192 | "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", 193 | "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", 194 | "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", 195 | "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", 196 | "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", 197 | "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", 198 | "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", 199 | "created_at": "2018-05-30T20:18:04Z", 200 | "updated_at": "2018-05-30T20:18:10Z", 201 | "pushed_at": "2018-05-30T20:18:30Z", 202 | "git_url": "git://github.com/Codertocat/Hello-World.git", 203 | "ssh_url": "git@github.com:Codertocat/Hello-World.git", 204 | "clone_url": "https://github.com/Codertocat/Hello-World.git", 205 | "svn_url": "https://github.com/Codertocat/Hello-World", 206 | "homepage": null, 207 | "size": 0, 208 | "stargazers_count": 0, 209 | "watchers_count": 0, 210 | "language": null, 211 | "has_issues": true, 212 | "has_projects": true, 213 | "has_downloads": true, 214 | "has_wiki": true, 215 | "has_pages": true, 216 | "forks_count": 0, 217 | "mirror_url": null, 218 | "archived": false, 219 | "open_issues_count": 1, 220 | "license": null, 221 | "forks": 0, 222 | "open_issues": 1, 223 | "watchers": 0, 224 | "default_branch": "master" 225 | } 226 | }, 227 | "base": { 228 | "label": "Codertocat:master", 229 | "ref": "master", 230 | "sha": "a10867b14bb761a232cd80139fbd4c0d33264240", 231 | "user": { 232 | "login": "Codertocat", 233 | "id": 21031067, 234 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 235 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 236 | "gravatar_id": "", 237 | "url": "https://api.github.com/users/Codertocat", 238 | "html_url": "https://github.com/Codertocat", 239 | "followers_url": "https://api.github.com/users/Codertocat/followers", 240 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 241 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 242 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 243 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 244 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 245 | "repos_url": "https://api.github.com/users/Codertocat/repos", 246 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 247 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 248 | "type": "User", 249 | "site_admin": false 250 | }, 251 | "repo": { 252 | "id": 135493233, 253 | "node_id": "MDEwOlJlcG9zaXRvcnkxMzU0OTMyMzM=", 254 | "name": "Hello-World", 255 | "full_name": "Codertocat/Hello-World", 256 | "owner": { 257 | "login": "Codertocat", 258 | "id": 21031067, 259 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 260 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 261 | "gravatar_id": "", 262 | "url": "https://api.github.com/users/Codertocat", 263 | "html_url": "https://github.com/Codertocat", 264 | "followers_url": "https://api.github.com/users/Codertocat/followers", 265 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 266 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 267 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 268 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 269 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 270 | "repos_url": "https://api.github.com/users/Codertocat/repos", 271 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 272 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 273 | "type": "User", 274 | "site_admin": false 275 | }, 276 | "private": false, 277 | "html_url": "https://github.com/Codertocat/Hello-World", 278 | "description": null, 279 | "fork": false, 280 | "url": "https://api.github.com/repos/Codertocat/Hello-World", 281 | "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", 282 | "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", 283 | "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", 284 | "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", 285 | "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", 286 | "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", 287 | "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", 288 | "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", 289 | "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", 290 | "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", 291 | "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", 292 | "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", 293 | "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", 294 | "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", 295 | "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", 296 | "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", 297 | "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", 298 | "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", 299 | "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", 300 | "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", 301 | "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", 302 | "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", 303 | "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", 304 | "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", 305 | "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", 306 | "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", 307 | "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", 308 | "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", 309 | "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", 310 | "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", 311 | "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", 312 | "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", 313 | "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", 314 | "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", 315 | "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", 316 | "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", 317 | "created_at": "2018-05-30T20:18:04Z", 318 | "updated_at": "2018-05-30T20:18:10Z", 319 | "pushed_at": "2018-05-30T20:18:30Z", 320 | "git_url": "git://github.com/Codertocat/Hello-World.git", 321 | "ssh_url": "git@github.com:Codertocat/Hello-World.git", 322 | "clone_url": "https://github.com/Codertocat/Hello-World.git", 323 | "svn_url": "https://github.com/Codertocat/Hello-World", 324 | "homepage": null, 325 | "size": 0, 326 | "stargazers_count": 0, 327 | "watchers_count": 0, 328 | "language": null, 329 | "has_issues": true, 330 | "has_projects": true, 331 | "has_downloads": true, 332 | "has_wiki": true, 333 | "has_pages": true, 334 | "forks_count": 0, 335 | "mirror_url": null, 336 | "archived": false, 337 | "open_issues_count": 1, 338 | "license": null, 339 | "forks": 0, 340 | "open_issues": 1, 341 | "watchers": 0, 342 | "default_branch": "master" 343 | } 344 | }, 345 | "_links": { 346 | "self": { 347 | "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/1" 348 | }, 349 | "html": { 350 | "href": "https://github.com/Codertocat/Hello-World/pull/1" 351 | }, 352 | "issue": { 353 | "href": "https://api.github.com/repos/Codertocat/Hello-World/issues/1" 354 | }, 355 | "comments": { 356 | "href": "https://api.github.com/repos/Codertocat/Hello-World/issues/1/comments" 357 | }, 358 | "review_comments": { 359 | "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/1/comments" 360 | }, 361 | "review_comment": { 362 | "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/comments{/number}" 363 | }, 364 | "commits": { 365 | "href": "https://api.github.com/repos/Codertocat/Hello-World/pulls/1/commits" 366 | }, 367 | "statuses": { 368 | "href": "https://api.github.com/repos/Codertocat/Hello-World/statuses/34c5c7793cb3b279e22454cb6750c80560547b3a" 369 | } 370 | }, 371 | "author_association": "OWNER" 372 | }, 373 | "repository": { 374 | "id": 135493233, 375 | "node_id": "MDEwOlJlcG9zaXRvcnkxMzU0OTMyMzM=", 376 | "name": "Hello-World", 377 | "full_name": "Codertocat/Hello-World", 378 | "owner": { 379 | "login": "Codertocat", 380 | "id": 21031067, 381 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 382 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 383 | "gravatar_id": "", 384 | "url": "https://api.github.com/users/Codertocat", 385 | "html_url": "https://github.com/Codertocat", 386 | "followers_url": "https://api.github.com/users/Codertocat/followers", 387 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 388 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 389 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 390 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 391 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 392 | "repos_url": "https://api.github.com/users/Codertocat/repos", 393 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 394 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 395 | "type": "User", 396 | "site_admin": false 397 | }, 398 | "private": false, 399 | "html_url": "https://github.com/Codertocat/Hello-World", 400 | "description": null, 401 | "fork": false, 402 | "url": "https://api.github.com/repos/Codertocat/Hello-World", 403 | "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", 404 | "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", 405 | "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", 406 | "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", 407 | "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", 408 | "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", 409 | "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", 410 | "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", 411 | "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", 412 | "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", 413 | "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", 414 | "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", 415 | "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", 416 | "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", 417 | "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", 418 | "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", 419 | "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", 420 | "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", 421 | "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", 422 | "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", 423 | "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", 424 | "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", 425 | "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", 426 | "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", 427 | "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", 428 | "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", 429 | "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", 430 | "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", 431 | "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", 432 | "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", 433 | "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", 434 | "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", 435 | "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", 436 | "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", 437 | "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", 438 | "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", 439 | "created_at": "2018-05-30T20:18:04Z", 440 | "updated_at": "2018-05-30T20:18:10Z", 441 | "pushed_at": "2018-05-30T20:18:30Z", 442 | "git_url": "git://github.com/Codertocat/Hello-World.git", 443 | "ssh_url": "git@github.com:Codertocat/Hello-World.git", 444 | "clone_url": "https://github.com/Codertocat/Hello-World.git", 445 | "svn_url": "https://github.com/Codertocat/Hello-World", 446 | "homepage": null, 447 | "size": 0, 448 | "stargazers_count": 0, 449 | "watchers_count": 0, 450 | "language": null, 451 | "has_issues": true, 452 | "has_projects": true, 453 | "has_downloads": true, 454 | "has_wiki": true, 455 | "has_pages": true, 456 | "forks_count": 0, 457 | "mirror_url": null, 458 | "archived": false, 459 | "open_issues_count": 1, 460 | "license": null, 461 | "forks": 0, 462 | "open_issues": 1, 463 | "watchers": 0, 464 | "default_branch": "master" 465 | }, 466 | "sender": { 467 | "login": "Codertocat", 468 | "id": 21031067, 469 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 470 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 471 | "gravatar_id": "", 472 | "url": "https://api.github.com/users/Codertocat", 473 | "html_url": "https://github.com/Codertocat", 474 | "followers_url": "https://api.github.com/users/Codertocat/followers", 475 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 476 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 477 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 478 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 479 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 480 | "repos_url": "https://api.github.com/users/Codertocat/repos", 481 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 482 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 483 | "type": "User", 484 | "site_admin": false 485 | } 486 | } 487 | -------------------------------------------------------------------------------- /tests/json/push_deleted.json: -------------------------------------------------------------------------------- 1 | { 2 | "ref": "refs/tags/simple-tag", 3 | "before": "a10867b14bb761a232cd80139fbd4c0d33264240", 4 | "after": "0000000000000000000000000000000000000000", 5 | "created": false, 6 | "deleted": true, 7 | "forced": false, 8 | "base_ref": null, 9 | "compare": "https://github.com/Codertocat/Hello-World/compare/a10867b14bb7...000000000000", 10 | "commits": [ 11 | 12 | ], 13 | "head_commit": null, 14 | "repository": { 15 | "id": 135493233, 16 | "node_id": "MDEwOlJlcG9zaXRvcnkxMzU0OTMyMzM=", 17 | "name": "Hello-World", 18 | "full_name": "Codertocat/Hello-World", 19 | "owner": { 20 | "name": "Codertocat", 21 | "email": "21031067+Codertocat@users.noreply.github.com", 22 | "login": "Codertocat", 23 | "id": 21031067, 24 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 25 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 26 | "gravatar_id": "", 27 | "url": "https://api.github.com/users/Codertocat", 28 | "html_url": "https://github.com/Codertocat", 29 | "followers_url": "https://api.github.com/users/Codertocat/followers", 30 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 31 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 32 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 33 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 34 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 35 | "repos_url": "https://api.github.com/users/Codertocat/repos", 36 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 37 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 38 | "type": "User", 39 | "site_admin": false 40 | }, 41 | "private": false, 42 | "html_url": "https://github.com/Codertocat/Hello-World", 43 | "description": null, 44 | "fork": false, 45 | "url": "https://github.com/Codertocat/Hello-World", 46 | "forks_url": "https://api.github.com/repos/Codertocat/Hello-World/forks", 47 | "keys_url": "https://api.github.com/repos/Codertocat/Hello-World/keys{/key_id}", 48 | "collaborators_url": "https://api.github.com/repos/Codertocat/Hello-World/collaborators{/collaborator}", 49 | "teams_url": "https://api.github.com/repos/Codertocat/Hello-World/teams", 50 | "hooks_url": "https://api.github.com/repos/Codertocat/Hello-World/hooks", 51 | "issue_events_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/events{/number}", 52 | "events_url": "https://api.github.com/repos/Codertocat/Hello-World/events", 53 | "assignees_url": "https://api.github.com/repos/Codertocat/Hello-World/assignees{/user}", 54 | "branches_url": "https://api.github.com/repos/Codertocat/Hello-World/branches{/branch}", 55 | "tags_url": "https://api.github.com/repos/Codertocat/Hello-World/tags", 56 | "blobs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/blobs{/sha}", 57 | "git_tags_url": "https://api.github.com/repos/Codertocat/Hello-World/git/tags{/sha}", 58 | "git_refs_url": "https://api.github.com/repos/Codertocat/Hello-World/git/refs{/sha}", 59 | "trees_url": "https://api.github.com/repos/Codertocat/Hello-World/git/trees{/sha}", 60 | "statuses_url": "https://api.github.com/repos/Codertocat/Hello-World/statuses/{sha}", 61 | "languages_url": "https://api.github.com/repos/Codertocat/Hello-World/languages", 62 | "stargazers_url": "https://api.github.com/repos/Codertocat/Hello-World/stargazers", 63 | "contributors_url": "https://api.github.com/repos/Codertocat/Hello-World/contributors", 64 | "subscribers_url": "https://api.github.com/repos/Codertocat/Hello-World/subscribers", 65 | "subscription_url": "https://api.github.com/repos/Codertocat/Hello-World/subscription", 66 | "commits_url": "https://api.github.com/repos/Codertocat/Hello-World/commits{/sha}", 67 | "git_commits_url": "https://api.github.com/repos/Codertocat/Hello-World/git/commits{/sha}", 68 | "comments_url": "https://api.github.com/repos/Codertocat/Hello-World/comments{/number}", 69 | "issue_comment_url": "https://api.github.com/repos/Codertocat/Hello-World/issues/comments{/number}", 70 | "contents_url": "https://api.github.com/repos/Codertocat/Hello-World/contents/{+path}", 71 | "compare_url": "https://api.github.com/repos/Codertocat/Hello-World/compare/{base}...{head}", 72 | "merges_url": "https://api.github.com/repos/Codertocat/Hello-World/merges", 73 | "archive_url": "https://api.github.com/repos/Codertocat/Hello-World/{archive_format}{/ref}", 74 | "downloads_url": "https://api.github.com/repos/Codertocat/Hello-World/downloads", 75 | "issues_url": "https://api.github.com/repos/Codertocat/Hello-World/issues{/number}", 76 | "pulls_url": "https://api.github.com/repos/Codertocat/Hello-World/pulls{/number}", 77 | "milestones_url": "https://api.github.com/repos/Codertocat/Hello-World/milestones{/number}", 78 | "notifications_url": "https://api.github.com/repos/Codertocat/Hello-World/notifications{?since,all,participating}", 79 | "labels_url": "https://api.github.com/repos/Codertocat/Hello-World/labels{/name}", 80 | "releases_url": "https://api.github.com/repos/Codertocat/Hello-World/releases{/id}", 81 | "deployments_url": "https://api.github.com/repos/Codertocat/Hello-World/deployments", 82 | "created_at": 1527711484, 83 | "updated_at": "2018-05-30T20:18:35Z", 84 | "pushed_at": 1527711528, 85 | "git_url": "git://github.com/Codertocat/Hello-World.git", 86 | "ssh_url": "git@github.com:Codertocat/Hello-World.git", 87 | "clone_url": "https://github.com/Codertocat/Hello-World.git", 88 | "svn_url": "https://github.com/Codertocat/Hello-World", 89 | "homepage": null, 90 | "size": 0, 91 | "stargazers_count": 0, 92 | "watchers_count": 0, 93 | "language": null, 94 | "has_issues": true, 95 | "has_projects": true, 96 | "has_downloads": true, 97 | "has_wiki": true, 98 | "has_pages": true, 99 | "forks_count": 0, 100 | "mirror_url": null, 101 | "archived": false, 102 | "open_issues_count": 2, 103 | "license": null, 104 | "forks": 0, 105 | "open_issues": 2, 106 | "watchers": 0, 107 | "default_branch": "master", 108 | "stargazers": 0, 109 | "master_branch": "master" 110 | }, 111 | "pusher": { 112 | "name": "Codertocat", 113 | "email": "21031067+Codertocat@users.noreply.github.com" 114 | }, 115 | "sender": { 116 | "login": "Codertocat", 117 | "id": 21031067, 118 | "node_id": "MDQ6VXNlcjIxMDMxMDY3", 119 | "avatar_url": "https://avatars1.githubusercontent.com/u/21031067?v=4", 120 | "gravatar_id": "", 121 | "url": "https://api.github.com/users/Codertocat", 122 | "html_url": "https://github.com/Codertocat", 123 | "followers_url": "https://api.github.com/users/Codertocat/followers", 124 | "following_url": "https://api.github.com/users/Codertocat/following{/other_user}", 125 | "gists_url": "https://api.github.com/users/Codertocat/gists{/gist_id}", 126 | "starred_url": "https://api.github.com/users/Codertocat/starred{/owner}{/repo}", 127 | "subscriptions_url": "https://api.github.com/users/Codertocat/subscriptions", 128 | "organizations_url": "https://api.github.com/users/Codertocat/orgs", 129 | "repos_url": "https://api.github.com/users/Codertocat/repos", 130 | "events_url": "https://api.github.com/users/Codertocat/events{/privacy}", 131 | "received_events_url": "https://api.github.com/users/Codertocat/received_events", 132 | "type": "User", 133 | "site_admin": false 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /tests/test_payloads.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import json 3 | import subprocess 4 | import pytest 5 | from flask import url_for 6 | 7 | 8 | def dummy(text, url, channel): 9 | pass 10 | 11 | from tests import config 12 | 13 | from mattermostgithub import server 14 | server.post = dummy 15 | server.config = config # use testing config instead 16 | 17 | @pytest.mark.usefixtures('live_server') 18 | class TestLiveServer: 19 | 20 | def send(self, filename, _type): 21 | f = open("tests/{}".format(filename), "r") 22 | payload = json.load(f) 23 | f.close() 24 | headers = {"X-GitHub-Event": _type} 25 | res = requests.post(url_for("root", _external=True), json=payload, headers=headers) 26 | return res.status_code 27 | 28 | def test_pull_request_review(self): 29 | assert self.send("json/commit_comment.json", "commit_comment") == 200 30 | assert self.send("json/create.json", "create") == 200 31 | assert self.send("json/delete_tag.json", "delete") == 400 32 | assert self.send("json/fork.json", "fork") == 400 33 | assert self.send("json/gollum.json", "gollum") == 200 34 | assert self.send("json/issue_comment_created.json", "issue_comment") == 200 35 | assert self.send("json/issues_edited.json", "issues") == 400 36 | assert self.send("json/pull_request_closed.json", "pull_request") == 200 37 | assert self.send("json/pull_request_review.json", "pull_request_review") == 200 38 | assert self.send("json/pull_request_review_comment.json", "pull_request_review_comment") == 200 39 | assert self.send("json/push_deleted.json", "push") == 400 40 | --------------------------------------------------------------------------------