├── .github └── config.yml ├── .gitignore ├── .travis.yml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── index.js ├── package-lock.json ├── package.json └── test ├── events ├── failEvent.json ├── failIssueRes.json ├── succIssueRes.json └── succeedEvent.json └── index.js /.github/config.yml: -------------------------------------------------------------------------------- 1 | updateDocsWhiteList: 2 | - BUG 3 | - Chore 4 | - minor 5 | 6 | updateDocsComment: > 7 | Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would update some of our documentation based on your changes. 8 | 9 | requestInfoReplyComment: > 10 | We would appreciate it if you could provide us with more info about this issue/pr! 11 | 12 | requestInfoLabelToAdd: request-more-info 13 | 14 | newPRWelcomeComment: > 15 | Thanks so much for opening your first PR here! 16 | 17 | firstPRMergeComment: > 18 | Congrats on merging your first pull request here! :tada: How awesome! 19 | 20 | newIssueWelcomeComment: > 21 | Thanks for opening this issue, a maintainer will get back to you shortly! 22 | 23 | sentimentBotToxicityThreshold: .7 24 | 25 | sentimentBotReplyComment: > 26 | Please be sure to review the code of conduct and be respectful of other users. cc/ @hiimbex 27 | 28 | lockThreads: 29 | toxicityThreshold: .7 30 | numComments: 2 31 | setTimeInHours: 72 32 | replyComment: > 33 | This thread is being locked due to exceeding the toxicity minimums. cc/ @hiimbex 34 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .env 2 | node_modules 3 | *.pem 4 | .DS_Store 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: node_js 3 | node_js: 4 | - "10" 5 | - "8" 6 | notifications: 7 | disabled: true 8 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at hiimbex@github.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing 2 | 3 | [fork]: https://github.com/behaviorbot/new-pr-welcome/fork 4 | [pr]: https://github.com/behaviorbot/new-pr-welcome/compare 5 | [style]: https://github.com/probot/eslint-config-probot 6 | [code-of-conduct]: CODE_OF_CONDUCT.md 7 | 8 | Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great. 9 | 10 | Please note that this project is released with a [Contributor Code of Conduct][code-of-conduct]. By participating in this project you agree to abide by its terms. 11 | 12 | ## Submitting a pull request 13 | 14 | 0. [Fork][fork] and clone the repository 15 | 0. Configure and install the dependencies: `npm install` 16 | 0. Make sure the tests pass on your machine: `npm test` 17 | 0. Create a new branch: `git checkout -b my-branch-name` 18 | 0. Make your change, add tests, and make sure the tests still pass 19 | 0. Push to your fork and [submit a pull request][pr] 20 | 0. Pat your self on the back and wait for your pull request to be reviewed and merged. 21 | 22 | Here are a few things you can do that will increase the likelihood of your pull request being accepted: 23 | 24 | - Follow the [style guide][style] which is a custom eslint linter. 25 | - Write and update tests. 26 | - Keep your change as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests. 27 | - Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). 28 | 29 | Work in Progress pull request are also welcome to get feedback early on, or if there is something blocked you. 30 | 31 | ## Resources 32 | 33 | - [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/) 34 | - [Using Pull Requests](https://help.github.com/articles/about-pull-requests/) 35 | - [GitHub Help](https://help.github.com) 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Bex Warner 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # new-pr-welcome 2 | 3 | > a GitHub App built with [probot](https://github.com/probot/probot) that welcomes new users when they open their first pull request. You can use this welcome message to provide links to resources like the contributing guidelines, code of conduct, etc. It should be located in a `.github/config.yml` 4 | 5 | screen shot 2017-07-07 at 10 40 26 am 6 | 7 | ## Usage 8 | 9 | 1. Install the bot on the intended repositories. The plugin requires the following **Permissions and Events**: 10 | - Pull requests: **Read & Write** 11 | - [x] check the box for **Pull Request** events 12 | 2. Add a `.github/config.yml` file that contains the contents you would like to reply within an `newPRWelcomeComment` 13 | ```yml 14 | # Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome 15 | 16 | # Comment to be posted to on PRs from first time contributors in your repository 17 | newPRWelcomeComment: > 18 | Thanks for opening this pull request! Please check out our contributing guidelines here: example.md 19 | ``` 20 | 21 | ## Setup 22 | 23 | ``` 24 | # Install dependencies 25 | npm install 26 | 27 | # Run the bot 28 | npm start 29 | ``` 30 | 31 | See [the probot deployment docs](https://github.com/probot/probot/blob/master/docs/deployment.md) if you would like to run your own instance of this plugin. 32 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | module.exports = app => { 2 | app.on('pull_request.opened', receive); 3 | async function receive(context) { 4 | // Get all issues for repo with user as creator 5 | const response = await context.github.issues.listForRepo(context.repo({ 6 | state: 'all', 7 | creator: context.payload.pull_request.user.login 8 | })); 9 | 10 | const countPR = response.data.filter(data => data.pull_request); 11 | if (countPR.length === 1) { 12 | try { 13 | const config = await context.config('config.yml'); 14 | if (config.newPRWelcomeComment) { 15 | context.github.issues.createComment(context.issue({body: config.newPRWelcomeComment})); 16 | } 17 | } catch (error) { 18 | if (error.code !== 404) { 19 | throw error; 20 | } 21 | } 22 | } 23 | } 24 | }; 25 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "new-pr-welcome", 3 | "version": "1.0.0", 4 | "description": "welcomes users who submit their first pr", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "probot run ./index.js", 8 | "test": "mocha && xo --extend probot" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "git+https://github.com/behaviorbot/new-pr-welcome.git" 13 | }, 14 | "author": "hiimbex", 15 | "license": "ISC", 16 | "bugs": { 17 | "url": "https://github.com/behaviorbot/new-pr-welcome/issues" 18 | }, 19 | "homepage": "https://github.com/behaviorbot/new-pr-welcome#readme", 20 | "dependencies": { 21 | "probot": "9.3.0" 22 | }, 23 | "devDependencies": { 24 | "eslint-config-probot": "^0.1.0", 25 | "expect": "^1.20.2", 26 | "mocha": "^5.2.0", 27 | "xo": "^0.23.0" 28 | }, 29 | "engines": { 30 | "node": ">= 8.0.0", 31 | "npm": ">= 4.0.0" 32 | }, 33 | "xo": { 34 | "space": 4 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /test/events/failEvent.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pull_request", 3 | "payload": { 4 | "action": "opened", 5 | "number": 10, 6 | "pull_request": { 7 | "url": "https://api.github.com/repos/hiimbex/testing-things/pulls/10", 8 | "id": 128496059, 9 | "html_url": "https://github.com/hiimbex/testing-things/pull/10", 10 | "diff_url": "https://github.com/hiimbex/testing-things/pull/10.diff", 11 | "patch_url": "https://github.com/hiimbex/testing-things/pull/10.patch", 12 | "issue_url": "https://api.github.com/repos/hiimbex/testing-things/issues/10", 13 | "number": 10, 14 | "state": "open", 15 | "locked": false, 16 | "title": "Update README.md", 17 | "user": { 18 | "login": "hiimbex", 19 | "id": 13410355, 20 | "avatar_url": "https://avatars2.githubusercontent.com/u/13410355?v=3", 21 | "gravatar_id": "", 22 | "url": "https://api.github.com/users/hiimbex", 23 | "html_url": "https://github.com/hiimbex", 24 | "followers_url": "https://api.github.com/users/hiimbex/followers", 25 | "following_url": "https://api.github.com/users/hiimbex/following{/other_user}", 26 | "gists_url": "https://api.github.com/users/hiimbex/gists{/gist_id}", 27 | "starred_url": "https://api.github.com/users/hiimbex/starred{/owner}{/repo}", 28 | "subscriptions_url": "https://api.github.com/users/hiimbex/subscriptions", 29 | "organizations_url": "https://api.github.com/users/hiimbex/orgs", 30 | "repos_url": "https://api.github.com/users/hiimbex/repos", 31 | "events_url": "https://api.github.com/users/hiimbex/events{/privacy}", 32 | "received_events_url": "https://api.github.com/users/hiimbex/received_events", 33 | "type": "User", 34 | "site_admin": false 35 | }, 36 | "body": "", 37 | "created_at": "2017-07-01T17:55:26Z", 38 | "updated_at": "2017-07-01T17:55:26Z", 39 | "closed_at": null, 40 | "merged_at": null, 41 | "merge_commit_sha": null, 42 | "assignee": null, 43 | "assignees": [ 44 | 45 | ], 46 | "requested_reviewers": [ 47 | 48 | ], 49 | "milestone": null, 50 | "commits_url": "https://api.github.com/repos/hiimbex/testing-things/pulls/10/commits", 51 | "review_comments_url": "https://api.github.com/repos/hiimbex/testing-things/pulls/10/comments", 52 | "review_comment_url": "https://api.github.com/repos/hiimbex/testing-things/pulls/comments{/number}", 53 | "comments_url": "https://api.github.com/repos/hiimbex/testing-things/issues/10/comments", 54 | "statuses_url": "https://api.github.com/repos/hiimbex/testing-things/statuses/ca1f91172727cf29094e907acf212878d2613db6", 55 | "head": { 56 | "label": "hiimbex:hiimbex-patch-3", 57 | "ref": "hiimbex-patch-3", 58 | "sha": "ca1f91172727cf29094e907acf212878d2613db6", 59 | "user": { 60 | "login": "hiimbex", 61 | "id": 13410355, 62 | "avatar_url": "https://avatars2.githubusercontent.com/u/13410355?v=3", 63 | "gravatar_id": "", 64 | "url": "https://api.github.com/users/hiimbex", 65 | "html_url": "https://github.com/hiimbex", 66 | "followers_url": "https://api.github.com/users/hiimbex/followers", 67 | "following_url": "https://api.github.com/users/hiimbex/following{/other_user}", 68 | "gists_url": "https://api.github.com/users/hiimbex/gists{/gist_id}", 69 | "starred_url": "https://api.github.com/users/hiimbex/starred{/owner}{/repo}", 70 | "subscriptions_url": "https://api.github.com/users/hiimbex/subscriptions", 71 | "organizations_url": "https://api.github.com/users/hiimbex/orgs", 72 | "repos_url": "https://api.github.com/users/hiimbex/repos", 73 | "events_url": "https://api.github.com/users/hiimbex/events{/privacy}", 74 | "received_events_url": "https://api.github.com/users/hiimbex/received_events", 75 | "type": "User", 76 | "site_admin": false 77 | }, 78 | "repo": { 79 | "id": 95162387, 80 | "name": "testing-things", 81 | "full_name": "hiimbex/testing-things", 82 | "owner": { 83 | "login": "hiimbex", 84 | "id": 13410355, 85 | "avatar_url": "https://avatars2.githubusercontent.com/u/13410355?v=3", 86 | "gravatar_id": "", 87 | "url": "https://api.github.com/users/hiimbex", 88 | "html_url": "https://github.com/hiimbex", 89 | "followers_url": "https://api.github.com/users/hiimbex/followers", 90 | "following_url": "https://api.github.com/users/hiimbex/following{/other_user}", 91 | "gists_url": "https://api.github.com/users/hiimbex/gists{/gist_id}", 92 | "starred_url": "https://api.github.com/users/hiimbex/starred{/owner}{/repo}", 93 | "subscriptions_url": "https://api.github.com/users/hiimbex/subscriptions", 94 | "organizations_url": "https://api.github.com/users/hiimbex/orgs", 95 | "repos_url": "https://api.github.com/users/hiimbex/repos", 96 | "events_url": "https://api.github.com/users/hiimbex/events{/privacy}", 97 | "received_events_url": "https://api.github.com/users/hiimbex/received_events", 98 | "type": "User", 99 | "site_admin": false 100 | }, 101 | "private": false, 102 | "html_url": "https://github.com/hiimbex/testing-things", 103 | "description": null, 104 | "fork": false, 105 | "url": "https://api.github.com/repos/hiimbex/testing-things", 106 | "forks_url": "https://api.github.com/repos/hiimbex/testing-things/forks", 107 | "keys_url": "https://api.github.com/repos/hiimbex/testing-things/keys{/key_id}", 108 | "collaborators_url": "https://api.github.com/repos/hiimbex/testing-things/collaborators{/collaborator}", 109 | "teams_url": "https://api.github.com/repos/hiimbex/testing-things/teams", 110 | "hooks_url": "https://api.github.com/repos/hiimbex/testing-things/hooks", 111 | "issue_events_url": "https://api.github.com/repos/hiimbex/testing-things/issues/events{/number}", 112 | "events_url": "https://api.github.com/repos/hiimbex/testing-things/events", 113 | "assignees_url": "https://api.github.com/repos/hiimbex/testing-things/assignees{/user}", 114 | "branches_url": "https://api.github.com/repos/hiimbex/testing-things/branches{/branch}", 115 | "tags_url": "https://api.github.com/repos/hiimbex/testing-things/tags", 116 | "blobs_url": "https://api.github.com/repos/hiimbex/testing-things/git/blobs{/sha}", 117 | "git_tags_url": "https://api.github.com/repos/hiimbex/testing-things/git/tags{/sha}", 118 | "git_refs_url": "https://api.github.com/repos/hiimbex/testing-things/git/refs{/sha}", 119 | "trees_url": "https://api.github.com/repos/hiimbex/testing-things/git/trees{/sha}", 120 | "statuses_url": "https://api.github.com/repos/hiimbex/testing-things/statuses/{sha}", 121 | "languages_url": "https://api.github.com/repos/hiimbex/testing-things/languages", 122 | "stargazers_url": "https://api.github.com/repos/hiimbex/testing-things/stargazers", 123 | "contributors_url": "https://api.github.com/repos/hiimbex/testing-things/contributors", 124 | "subscribers_url": "https://api.github.com/repos/hiimbex/testing-things/subscribers", 125 | "subscription_url": "https://api.github.com/repos/hiimbex/testing-things/subscription", 126 | "commits_url": "https://api.github.com/repos/hiimbex/testing-things/commits{/sha}", 127 | "git_commits_url": "https://api.github.com/repos/hiimbex/testing-things/git/commits{/sha}", 128 | "comments_url": "https://api.github.com/repos/hiimbex/testing-things/comments{/number}", 129 | "issue_comment_url": "https://api.github.com/repos/hiimbex/testing-things/issues/comments{/number}", 130 | "contents_url": "https://api.github.com/repos/hiimbex/testing-things/contents/{+path}", 131 | "compare_url": "https://api.github.com/repos/hiimbex/testing-things/compare/{base}...{head}", 132 | "merges_url": "https://api.github.com/repos/hiimbex/testing-things/merges", 133 | "archive_url": "https://api.github.com/repos/hiimbex/testing-things/{archive_format}{/ref}", 134 | "downloads_url": "https://api.github.com/repos/hiimbex/testing-things/downloads", 135 | "issues_url": "https://api.github.com/repos/hiimbex/testing-things/issues{/number}", 136 | "pulls_url": "https://api.github.com/repos/hiimbex/testing-things/pulls{/number}", 137 | "milestones_url": "https://api.github.com/repos/hiimbex/testing-things/milestones{/number}", 138 | "notifications_url": "https://api.github.com/repos/hiimbex/testing-things/notifications{?since,all,participating}", 139 | "labels_url": "https://api.github.com/repos/hiimbex/testing-things/labels{/name}", 140 | "releases_url": "https://api.github.com/repos/hiimbex/testing-things/releases{/id}", 141 | "deployments_url": "https://api.github.com/repos/hiimbex/testing-things/deployments", 142 | "created_at": "2017-06-22T22:38:49Z", 143 | "updated_at": "2017-06-22T22:38:49Z", 144 | "pushed_at": "2017-07-01T17:55:20Z", 145 | "git_url": "git://github.com/hiimbex/testing-things.git", 146 | "ssh_url": "git@github.com:hiimbex/testing-things.git", 147 | "clone_url": "https://github.com/hiimbex/testing-things.git", 148 | "svn_url": "https://github.com/hiimbex/testing-things", 149 | "homepage": null, 150 | "size": 4, 151 | "stargazers_count": 0, 152 | "watchers_count": 0, 153 | "language": null, 154 | "has_issues": true, 155 | "has_projects": true, 156 | "has_downloads": true, 157 | "has_wiki": true, 158 | "has_pages": false, 159 | "forks_count": 2, 160 | "mirror_url": null, 161 | "open_issues_count": 7, 162 | "forks": 2, 163 | "open_issues": 7, 164 | "watchers": 0, 165 | "default_branch": "master" 166 | } 167 | }, 168 | "base": { 169 | "label": "hiimbex:master", 170 | "ref": "master", 171 | "sha": "f3be5fd16a7967a0ae441ded78c242485777945b", 172 | "user": { 173 | "login": "hiimbex", 174 | "id": 13410355, 175 | "avatar_url": "https://avatars2.githubusercontent.com/u/13410355?v=3", 176 | "gravatar_id": "", 177 | "url": "https://api.github.com/users/hiimbex", 178 | "html_url": "https://github.com/hiimbex", 179 | "followers_url": "https://api.github.com/users/hiimbex/followers", 180 | "following_url": "https://api.github.com/users/hiimbex/following{/other_user}", 181 | "gists_url": "https://api.github.com/users/hiimbex/gists{/gist_id}", 182 | "starred_url": "https://api.github.com/users/hiimbex/starred{/owner}{/repo}", 183 | "subscriptions_url": "https://api.github.com/users/hiimbex/subscriptions", 184 | "organizations_url": "https://api.github.com/users/hiimbex/orgs", 185 | "repos_url": "https://api.github.com/users/hiimbex/repos", 186 | "events_url": "https://api.github.com/users/hiimbex/events{/privacy}", 187 | "received_events_url": "https://api.github.com/users/hiimbex/received_events", 188 | "type": "User", 189 | "site_admin": false 190 | }, 191 | "repo": { 192 | "id": 95162387, 193 | "name": "testing-things", 194 | "full_name": "hiimbex/testing-things", 195 | "owner": { 196 | "login": "hiimbex", 197 | "id": 13410355, 198 | "avatar_url": "https://avatars2.githubusercontent.com/u/13410355?v=3", 199 | "gravatar_id": "", 200 | "url": "https://api.github.com/users/hiimbex", 201 | "html_url": "https://github.com/hiimbex", 202 | "followers_url": "https://api.github.com/users/hiimbex/followers", 203 | "following_url": "https://api.github.com/users/hiimbex/following{/other_user}", 204 | "gists_url": "https://api.github.com/users/hiimbex/gists{/gist_id}", 205 | "starred_url": "https://api.github.com/users/hiimbex/starred{/owner}{/repo}", 206 | "subscriptions_url": "https://api.github.com/users/hiimbex/subscriptions", 207 | "organizations_url": "https://api.github.com/users/hiimbex/orgs", 208 | "repos_url": "https://api.github.com/users/hiimbex/repos", 209 | "events_url": "https://api.github.com/users/hiimbex/events{/privacy}", 210 | "received_events_url": "https://api.github.com/users/hiimbex/received_events", 211 | "type": "User", 212 | "site_admin": false 213 | }, 214 | "private": false, 215 | "html_url": "https://github.com/hiimbex/testing-things", 216 | "description": null, 217 | "fork": false, 218 | "url": "https://api.github.com/repos/hiimbex/testing-things", 219 | "forks_url": "https://api.github.com/repos/hiimbex/testing-things/forks", 220 | "keys_url": "https://api.github.com/repos/hiimbex/testing-things/keys{/key_id}", 221 | "collaborators_url": "https://api.github.com/repos/hiimbex/testing-things/collaborators{/collaborator}", 222 | "teams_url": "https://api.github.com/repos/hiimbex/testing-things/teams", 223 | "hooks_url": "https://api.github.com/repos/hiimbex/testing-things/hooks", 224 | "issue_events_url": "https://api.github.com/repos/hiimbex/testing-things/issues/events{/number}", 225 | "events_url": "https://api.github.com/repos/hiimbex/testing-things/events", 226 | "assignees_url": "https://api.github.com/repos/hiimbex/testing-things/assignees{/user}", 227 | "branches_url": "https://api.github.com/repos/hiimbex/testing-things/branches{/branch}", 228 | "tags_url": "https://api.github.com/repos/hiimbex/testing-things/tags", 229 | "blobs_url": "https://api.github.com/repos/hiimbex/testing-things/git/blobs{/sha}", 230 | "git_tags_url": "https://api.github.com/repos/hiimbex/testing-things/git/tags{/sha}", 231 | "git_refs_url": "https://api.github.com/repos/hiimbex/testing-things/git/refs{/sha}", 232 | "trees_url": "https://api.github.com/repos/hiimbex/testing-things/git/trees{/sha}", 233 | "statuses_url": "https://api.github.com/repos/hiimbex/testing-things/statuses/{sha}", 234 | "languages_url": "https://api.github.com/repos/hiimbex/testing-things/languages", 235 | "stargazers_url": "https://api.github.com/repos/hiimbex/testing-things/stargazers", 236 | "contributors_url": "https://api.github.com/repos/hiimbex/testing-things/contributors", 237 | "subscribers_url": "https://api.github.com/repos/hiimbex/testing-things/subscribers", 238 | "subscription_url": "https://api.github.com/repos/hiimbex/testing-things/subscription", 239 | "commits_url": "https://api.github.com/repos/hiimbex/testing-things/commits{/sha}", 240 | "git_commits_url": "https://api.github.com/repos/hiimbex/testing-things/git/commits{/sha}", 241 | "comments_url": "https://api.github.com/repos/hiimbex/testing-things/comments{/number}", 242 | "issue_comment_url": "https://api.github.com/repos/hiimbex/testing-things/issues/comments{/number}", 243 | "contents_url": "https://api.github.com/repos/hiimbex/testing-things/contents/{+path}", 244 | "compare_url": "https://api.github.com/repos/hiimbex/testing-things/compare/{base}...{head}", 245 | "merges_url": "https://api.github.com/repos/hiimbex/testing-things/merges", 246 | "archive_url": "https://api.github.com/repos/hiimbex/testing-things/{archive_format}{/ref}", 247 | "downloads_url": "https://api.github.com/repos/hiimbex/testing-things/downloads", 248 | "issues_url": "https://api.github.com/repos/hiimbex/testing-things/issues{/number}", 249 | "pulls_url": "https://api.github.com/repos/hiimbex/testing-things/pulls{/number}", 250 | "milestones_url": "https://api.github.com/repos/hiimbex/testing-things/milestones{/number}", 251 | "notifications_url": "https://api.github.com/repos/hiimbex/testing-things/notifications{?since,all,participating}", 252 | "labels_url": "https://api.github.com/repos/hiimbex/testing-things/labels{/name}", 253 | "releases_url": "https://api.github.com/repos/hiimbex/testing-things/releases{/id}", 254 | "deployments_url": "https://api.github.com/repos/hiimbex/testing-things/deployments", 255 | "created_at": "2017-06-22T22:38:49Z", 256 | "updated_at": "2017-06-22T22:38:49Z", 257 | "pushed_at": "2017-07-01T17:55:20Z", 258 | "git_url": "git://github.com/hiimbex/testing-things.git", 259 | "ssh_url": "git@github.com:hiimbex/testing-things.git", 260 | "clone_url": "https://github.com/hiimbex/testing-things.git", 261 | "svn_url": "https://github.com/hiimbex/testing-things", 262 | "homepage": null, 263 | "size": 4, 264 | "stargazers_count": 0, 265 | "watchers_count": 0, 266 | "language": null, 267 | "has_issues": true, 268 | "has_projects": true, 269 | "has_downloads": true, 270 | "has_wiki": true, 271 | "has_pages": false, 272 | "forks_count": 2, 273 | "mirror_url": null, 274 | "open_issues_count": 7, 275 | "forks": 2, 276 | "open_issues": 7, 277 | "watchers": 0, 278 | "default_branch": "master" 279 | } 280 | }, 281 | "_links": { 282 | "self": { 283 | "href": "https://api.github.com/repos/hiimbex/testing-things/pulls/10" 284 | }, 285 | "html": { 286 | "href": "https://github.com/hiimbex/testing-things/pull/10" 287 | }, 288 | "issue": { 289 | "href": "https://api.github.com/repos/hiimbex/testing-things/issues/10" 290 | }, 291 | "comments": { 292 | "href": "https://api.github.com/repos/hiimbex/testing-things/issues/10/comments" 293 | }, 294 | "review_comments": { 295 | "href": "https://api.github.com/repos/hiimbex/testing-things/pulls/10/comments" 296 | }, 297 | "review_comment": { 298 | "href": "https://api.github.com/repos/hiimbex/testing-things/pulls/comments{/number}" 299 | }, 300 | "commits": { 301 | "href": "https://api.github.com/repos/hiimbex/testing-things/pulls/10/commits" 302 | }, 303 | "statuses": { 304 | "href": "https://api.github.com/repos/hiimbex/testing-things/statuses/ca1f91172727cf29094e907acf212878d2613db6" 305 | } 306 | }, 307 | "merged": false, 308 | "mergeable": null, 309 | "rebaseable": null, 310 | "mergeable_state": "unknown", 311 | "merged_by": null, 312 | "comments": 0, 313 | "review_comments": 0, 314 | "maintainer_can_modify": false, 315 | "commits": 1, 316 | "additions": 1, 317 | "deletions": 1, 318 | "changed_files": 1 319 | }, 320 | "repository": { 321 | "id": 95162387, 322 | "name": "testing-things", 323 | "full_name": "hiimbex/testing-things", 324 | "owner": { 325 | "login": "hiimbex", 326 | "id": 13410355, 327 | "avatar_url": "https://avatars2.githubusercontent.com/u/13410355?v=3", 328 | "gravatar_id": "", 329 | "url": "https://api.github.com/users/hiimbex", 330 | "html_url": "https://github.com/hiimbex", 331 | "followers_url": "https://api.github.com/users/hiimbex/followers", 332 | "following_url": "https://api.github.com/users/hiimbex/following{/other_user}", 333 | "gists_url": "https://api.github.com/users/hiimbex/gists{/gist_id}", 334 | "starred_url": "https://api.github.com/users/hiimbex/starred{/owner}{/repo}", 335 | "subscriptions_url": "https://api.github.com/users/hiimbex/subscriptions", 336 | "organizations_url": "https://api.github.com/users/hiimbex/orgs", 337 | "repos_url": "https://api.github.com/users/hiimbex/repos", 338 | "events_url": "https://api.github.com/users/hiimbex/events{/privacy}", 339 | "received_events_url": "https://api.github.com/users/hiimbex/received_events", 340 | "type": "User", 341 | "site_admin": false 342 | }, 343 | "private": false, 344 | "html_url": "https://github.com/hiimbex/testing-things", 345 | "description": null, 346 | "fork": false, 347 | "url": "https://api.github.com/repos/hiimbex/testing-things", 348 | "forks_url": "https://api.github.com/repos/hiimbex/testing-things/forks", 349 | "keys_url": "https://api.github.com/repos/hiimbex/testing-things/keys{/key_id}", 350 | "collaborators_url": "https://api.github.com/repos/hiimbex/testing-things/collaborators{/collaborator}", 351 | "teams_url": "https://api.github.com/repos/hiimbex/testing-things/teams", 352 | "hooks_url": "https://api.github.com/repos/hiimbex/testing-things/hooks", 353 | "issue_events_url": "https://api.github.com/repos/hiimbex/testing-things/issues/events{/number}", 354 | "events_url": "https://api.github.com/repos/hiimbex/testing-things/events", 355 | "assignees_url": "https://api.github.com/repos/hiimbex/testing-things/assignees{/user}", 356 | "branches_url": "https://api.github.com/repos/hiimbex/testing-things/branches{/branch}", 357 | "tags_url": "https://api.github.com/repos/hiimbex/testing-things/tags", 358 | "blobs_url": "https://api.github.com/repos/hiimbex/testing-things/git/blobs{/sha}", 359 | "git_tags_url": "https://api.github.com/repos/hiimbex/testing-things/git/tags{/sha}", 360 | "git_refs_url": "https://api.github.com/repos/hiimbex/testing-things/git/refs{/sha}", 361 | "trees_url": "https://api.github.com/repos/hiimbex/testing-things/git/trees{/sha}", 362 | "statuses_url": "https://api.github.com/repos/hiimbex/testing-things/statuses/{sha}", 363 | "languages_url": "https://api.github.com/repos/hiimbex/testing-things/languages", 364 | "stargazers_url": "https://api.github.com/repos/hiimbex/testing-things/stargazers", 365 | "contributors_url": "https://api.github.com/repos/hiimbex/testing-things/contributors", 366 | "subscribers_url": "https://api.github.com/repos/hiimbex/testing-things/subscribers", 367 | "subscription_url": "https://api.github.com/repos/hiimbex/testing-things/subscription", 368 | "commits_url": "https://api.github.com/repos/hiimbex/testing-things/commits{/sha}", 369 | "git_commits_url": "https://api.github.com/repos/hiimbex/testing-things/git/commits{/sha}", 370 | "comments_url": "https://api.github.com/repos/hiimbex/testing-things/comments{/number}", 371 | "issue_comment_url": "https://api.github.com/repos/hiimbex/testing-things/issues/comments{/number}", 372 | "contents_url": "https://api.github.com/repos/hiimbex/testing-things/contents/{+path}", 373 | "compare_url": "https://api.github.com/repos/hiimbex/testing-things/compare/{base}...{head}", 374 | "merges_url": "https://api.github.com/repos/hiimbex/testing-things/merges", 375 | "archive_url": "https://api.github.com/repos/hiimbex/testing-things/{archive_format}{/ref}", 376 | "downloads_url": "https://api.github.com/repos/hiimbex/testing-things/downloads", 377 | "issues_url": "https://api.github.com/repos/hiimbex/testing-things/issues{/number}", 378 | "pulls_url": "https://api.github.com/repos/hiimbex/testing-things/pulls{/number}", 379 | "milestones_url": "https://api.github.com/repos/hiimbex/testing-things/milestones{/number}", 380 | "notifications_url": "https://api.github.com/repos/hiimbex/testing-things/notifications{?since,all,participating}", 381 | "labels_url": "https://api.github.com/repos/hiimbex/testing-things/labels{/name}", 382 | "releases_url": "https://api.github.com/repos/hiimbex/testing-things/releases{/id}", 383 | "deployments_url": "https://api.github.com/repos/hiimbex/testing-things/deployments", 384 | "created_at": "2017-06-22T22:38:49Z", 385 | "updated_at": "2017-06-22T22:38:49Z", 386 | "pushed_at": "2017-07-01T17:55:20Z", 387 | "git_url": "git://github.com/hiimbex/testing-things.git", 388 | "ssh_url": "git@github.com:hiimbex/testing-things.git", 389 | "clone_url": "https://github.com/hiimbex/testing-things.git", 390 | "svn_url": "https://github.com/hiimbex/testing-things", 391 | "homepage": null, 392 | "size": 4, 393 | "stargazers_count": 0, 394 | "watchers_count": 0, 395 | "language": null, 396 | "has_issues": true, 397 | "has_projects": true, 398 | "has_downloads": true, 399 | "has_wiki": true, 400 | "has_pages": false, 401 | "forks_count": 2, 402 | "mirror_url": null, 403 | "open_issues_count": 7, 404 | "forks": 2, 405 | "open_issues": 7, 406 | "watchers": 0, 407 | "default_branch": "master" 408 | }, 409 | "sender": { 410 | "login": "hiimbex", 411 | "id": 13410355, 412 | "avatar_url": "https://avatars2.githubusercontent.com/u/13410355?v=3", 413 | "gravatar_id": "", 414 | "url": "https://api.github.com/users/hiimbex", 415 | "html_url": "https://github.com/hiimbex", 416 | "followers_url": "https://api.github.com/users/hiimbex/followers", 417 | "following_url": "https://api.github.com/users/hiimbex/following{/other_user}", 418 | "gists_url": "https://api.github.com/users/hiimbex/gists{/gist_id}", 419 | "starred_url": "https://api.github.com/users/hiimbex/starred{/owner}{/repo}", 420 | "subscriptions_url": "https://api.github.com/users/hiimbex/subscriptions", 421 | "organizations_url": "https://api.github.com/users/hiimbex/orgs", 422 | "repos_url": "https://api.github.com/users/hiimbex/repos", 423 | "events_url": "https://api.github.com/users/hiimbex/events{/privacy}", 424 | "received_events_url": "https://api.github.com/users/hiimbex/received_events", 425 | "type": "User", 426 | "site_admin": false 427 | }, 428 | "installation": { 429 | "id": 34739 430 | } 431 | } 432 | } 433 | -------------------------------------------------------------------------------- /test/events/failIssueRes.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "url": "https://api.github.com/repos/hiimbex/testing-things/issues/10", 5 | "repository_url": "https://api.github.com/repos/hiimbex/testing-things", 6 | "labels_url": "https://api.github.com/repos/hiimbex/testing-things/issues/10/labels{/name}", 7 | "comments_url": "https://api.github.com/repos/hiimbex/testing-things/issues/10/comments", 8 | "events_url": "https://api.github.com/repos/hiimbex/testing-things/issues/10/events", 9 | "html_url": "https://github.com/hiimbex/testing-things/pull/10", 10 | "id": 239963411, 11 | "number": 10, 12 | "title": "Update README.md", 13 | "user": { 14 | "login": "hiimbex", 15 | "id": 13410355, 16 | "avatar_url": "https://avatars2.githubusercontent.com/u/13410355?v=3", 17 | "gravatar_id": "", 18 | "url": "https://api.github.com/users/hiimbex", 19 | "html_url": "https://github.com/hiimbex", 20 | "followers_url": "https://api.github.com/users/hiimbex/followers", 21 | "following_url": "https://api.github.com/users/hiimbex/following{/other_user}", 22 | "gists_url": "https://api.github.com/users/hiimbex/gists{/gist_id}", 23 | "starred_url": "https://api.github.com/users/hiimbex/starred{/owner}{/repo}", 24 | "subscriptions_url": "https://api.github.com/users/hiimbex/subscriptions", 25 | "organizations_url": "https://api.github.com/users/hiimbex/orgs", 26 | "repos_url": "https://api.github.com/users/hiimbex/repos", 27 | "events_url": "https://api.github.com/users/hiimbex/events{/privacy}", 28 | "received_events_url": "https://api.github.com/users/hiimbex/received_events", 29 | "type": "User", 30 | "site_admin": false 31 | }, 32 | "labels": [], 33 | "state": "open", 34 | "locked": false, 35 | "assignee": null, 36 | "assignees": [], 37 | "milestone": null, 38 | "comments": 0, 39 | "created_at": "2017-07-01T17:55:26Z", 40 | "updated_at": "2017-07-01T17:55:26Z", 41 | "closed_at": null, 42 | "pull_request": { 43 | "url": "https://api.github.com/repos/hiimbex/testing-things/pulls/10", 44 | "html_url": "https://github.com/hiimbex/testing-things/pull/10", 45 | "diff_url": "https://github.com/hiimbex/testing-things/pull/10.diff", 46 | "patch_url": "https://github.com/hiimbex/testing-things/pull/10.patch" 47 | }, 48 | "body": "" 49 | }, 50 | { 51 | "url": "https://api.github.com/repos/hiimbex/testing-things/issues/9", 52 | "repository_url": "https://api.github.com/repos/hiimbex/testing-things", 53 | "labels_url": "https://api.github.com/repos/hiimbex/testing-things/issues/9/labels{/name}", 54 | "comments_url": "https://api.github.com/repos/hiimbex/testing-things/issues/9/comments", 55 | "events_url": "https://api.github.com/repos/hiimbex/testing-things/issues/9/events", 56 | "html_url": "https://github.com/hiimbex/testing-things/issues/9", 57 | "id": 239242442, 58 | "number": 9, 59 | "title": "ur thing is broken fix it!!", 60 | "user": { 61 | "login": "hiimbex", 62 | "id": 13410355, 63 | "avatar_url": "https://avatars2.githubusercontent.com/u/13410355?v=3", 64 | "gravatar_id": "", 65 | "url": "https://api.github.com/users/hiimbex", 66 | "html_url": "https://github.com/hiimbex", 67 | "followers_url": "https://api.github.com/users/hiimbex/followers", 68 | "following_url": "https://api.github.com/users/hiimbex/following{/other_user}", 69 | "gists_url": "https://api.github.com/users/hiimbex/gists{/gist_id}", 70 | "starred_url": "https://api.github.com/users/hiimbex/starred{/owner}{/repo}", 71 | "subscriptions_url": "https://api.github.com/users/hiimbex/subscriptions", 72 | "organizations_url": "https://api.github.com/users/hiimbex/orgs", 73 | "repos_url": "https://api.github.com/users/hiimbex/repos", 74 | "events_url": "https://api.github.com/users/hiimbex/events{/privacy}", 75 | "received_events_url": "https://api.github.com/users/hiimbex/received_events", 76 | "type": "User", 77 | "site_admin": false 78 | }, 79 | "labels": [], 80 | "state": "open", 81 | "locked": false, 82 | "assignee": null, 83 | "assignees": [], 84 | "milestone": null, 85 | "comments": 1, 86 | "created_at": "2017-06-28T17:45:21Z", 87 | "updated_at": "2017-06-28T17:45:23Z", 88 | "closed_at": null, 89 | "body": "" 90 | }, 91 | { 92 | "url": "https://api.github.com/repos/hiimbex/testing-things/issues/8", 93 | "repository_url": "https://api.github.com/repos/hiimbex/testing-things", 94 | "labels_url": "https://api.github.com/repos/hiimbex/testing-things/issues/8/labels{/name}", 95 | "comments_url": "https://api.github.com/repos/hiimbex/testing-things/issues/8/comments", 96 | "events_url": "https://api.github.com/repos/hiimbex/testing-things/issues/8/events", 97 | "html_url": "https://github.com/hiimbex/testing-things/issues/8", 98 | "id": 239237301, 99 | "number": 8, 100 | "title": "new issue for testing!", 101 | "user": { 102 | "login": "hiimbex", 103 | "id": 13410355, 104 | "avatar_url": "https://avatars2.githubusercontent.com/u/13410355?v=3", 105 | "gravatar_id": "", 106 | "url": "https://api.github.com/users/hiimbex", 107 | "html_url": "https://github.com/hiimbex", 108 | "followers_url": "https://api.github.com/users/hiimbex/followers", 109 | "following_url": "https://api.github.com/users/hiimbex/following{/other_user}", 110 | "gists_url": "https://api.github.com/users/hiimbex/gists{/gist_id}", 111 | "starred_url": "https://api.github.com/users/hiimbex/starred{/owner}{/repo}", 112 | "subscriptions_url": "https://api.github.com/users/hiimbex/subscriptions", 113 | "organizations_url": "https://api.github.com/users/hiimbex/orgs", 114 | "repos_url": "https://api.github.com/users/hiimbex/repos", 115 | "events_url": "https://api.github.com/users/hiimbex/events{/privacy}", 116 | "received_events_url": "https://api.github.com/users/hiimbex/received_events", 117 | "type": "User", 118 | "site_admin": false 119 | }, 120 | "labels": [], 121 | "state": "open", 122 | "locked": false, 123 | "assignee": null, 124 | "assignees": [], 125 | "milestone": null, 126 | "comments": 0, 127 | "created_at": "2017-06-28T17:25:52Z", 128 | "updated_at": "2017-06-28T17:25:52Z", 129 | "closed_at": null, 130 | "body": "!!!" 131 | }, 132 | { 133 | "url": "https://api.github.com/repos/hiimbex/testing-things/issues/6", 134 | "repository_url": "https://api.github.com/repos/hiimbex/testing-things", 135 | "labels_url": "https://api.github.com/repos/hiimbex/testing-things/issues/6/labels{/name}", 136 | "comments_url": "https://api.github.com/repos/hiimbex/testing-things/issues/6/comments", 137 | "events_url": "https://api.github.com/repos/hiimbex/testing-things/issues/6/events", 138 | "html_url": "https://github.com/hiimbex/testing-things/issues/6", 139 | "id": 238258033, 140 | "number": 6, 141 | "title": "New Issue!", 142 | "user": { 143 | "login": "hiimbex", 144 | "id": 13410355, 145 | "avatar_url": "https://avatars2.githubusercontent.com/u/13410355?v=3", 146 | "gravatar_id": "", 147 | "url": "https://api.github.com/users/hiimbex", 148 | "html_url": "https://github.com/hiimbex", 149 | "followers_url": "https://api.github.com/users/hiimbex/followers", 150 | "following_url": "https://api.github.com/users/hiimbex/following{/other_user}", 151 | "gists_url": "https://api.github.com/users/hiimbex/gists{/gist_id}", 152 | "starred_url": "https://api.github.com/users/hiimbex/starred{/owner}{/repo}", 153 | "subscriptions_url": "https://api.github.com/users/hiimbex/subscriptions", 154 | "organizations_url": "https://api.github.com/users/hiimbex/orgs", 155 | "repos_url": "https://api.github.com/users/hiimbex/repos", 156 | "events_url": "https://api.github.com/users/hiimbex/events{/privacy}", 157 | "received_events_url": "https://api.github.com/users/hiimbex/received_events", 158 | "type": "User", 159 | "site_admin": false 160 | }, 161 | "labels": [], 162 | "state": "open", 163 | "locked": false, 164 | "assignee": null, 165 | "assignees": [], 166 | "milestone": null, 167 | "comments": 0, 168 | "created_at": "2017-06-23T21:28:20Z", 169 | "updated_at": "2017-06-23T21:44:30Z", 170 | "closed_at": null, 171 | "body": "Test!!" 172 | }, 173 | { 174 | "url": "https://api.github.com/repos/hiimbex/testing-things/issues/3", 175 | "repository_url": "https://api.github.com/repos/hiimbex/testing-things", 176 | "labels_url": "https://api.github.com/repos/hiimbex/testing-things/issues/3/labels{/name}", 177 | "comments_url": "https://api.github.com/repos/hiimbex/testing-things/issues/3/comments", 178 | "events_url": "https://api.github.com/repos/hiimbex/testing-things/issues/3/events", 179 | "html_url": "https://github.com/hiimbex/testing-things/pull/3", 180 | "id": 238242987, 181 | "number": 3, 182 | "title": "Update new-pr-welcome.md", 183 | "user": { 184 | "login": "hiimbex", 185 | "id": 13410355, 186 | "avatar_url": "https://avatars2.githubusercontent.com/u/13410355?v=3", 187 | "gravatar_id": "", 188 | "url": "https://api.github.com/users/hiimbex", 189 | "html_url": "https://github.com/hiimbex", 190 | "followers_url": "https://api.github.com/users/hiimbex/followers", 191 | "following_url": "https://api.github.com/users/hiimbex/following{/other_user}", 192 | "gists_url": "https://api.github.com/users/hiimbex/gists{/gist_id}", 193 | "starred_url": "https://api.github.com/users/hiimbex/starred{/owner}{/repo}", 194 | "subscriptions_url": "https://api.github.com/users/hiimbex/subscriptions", 195 | "organizations_url": "https://api.github.com/users/hiimbex/orgs", 196 | "repos_url": "https://api.github.com/users/hiimbex/repos", 197 | "events_url": "https://api.github.com/users/hiimbex/events{/privacy}", 198 | "received_events_url": "https://api.github.com/users/hiimbex/received_events", 199 | "type": "User", 200 | "site_admin": false 201 | }, 202 | "labels": [], 203 | "state": "closed", 204 | "locked": false, 205 | "assignee": null, 206 | "assignees": [], 207 | "milestone": null, 208 | "comments": 0, 209 | "created_at": "2017-06-23T20:15:50Z", 210 | "updated_at": "2017-06-23T23:11:24Z", 211 | "closed_at": "2017-06-23T23:11:24Z", 212 | "pull_request": { 213 | "url": "https://api.github.com/repos/hiimbex/testing-things/pulls/3", 214 | "html_url": "https://github.com/hiimbex/testing-things/pull/3", 215 | "diff_url": "https://github.com/hiimbex/testing-things/pull/3.diff", 216 | "patch_url": "https://github.com/hiimbex/testing-things/pull/3.patch" 217 | }, 218 | "body": "things" 219 | }, 220 | { 221 | "url": "https://api.github.com/repos/hiimbex/testing-things/issues/2", 222 | "repository_url": "https://api.github.com/repos/hiimbex/testing-things", 223 | "labels_url": "https://api.github.com/repos/hiimbex/testing-things/issues/2/labels{/name}", 224 | "comments_url": "https://api.github.com/repos/hiimbex/testing-things/issues/2/comments", 225 | "events_url": "https://api.github.com/repos/hiimbex/testing-things/issues/2/events", 226 | "html_url": "https://github.com/hiimbex/testing-things/issues/2", 227 | "id": 238000477, 228 | "number": 2, 229 | "title": "qwe", 230 | "user": { 231 | "login": "hiimbex", 232 | "id": 13410355, 233 | "avatar_url": "https://avatars2.githubusercontent.com/u/13410355?v=3", 234 | "gravatar_id": "", 235 | "url": "https://api.github.com/users/hiimbex", 236 | "html_url": "https://github.com/hiimbex", 237 | "followers_url": "https://api.github.com/users/hiimbex/followers", 238 | "following_url": "https://api.github.com/users/hiimbex/following{/other_user}", 239 | "gists_url": "https://api.github.com/users/hiimbex/gists{/gist_id}", 240 | "starred_url": "https://api.github.com/users/hiimbex/starred{/owner}{/repo}", 241 | "subscriptions_url": "https://api.github.com/users/hiimbex/subscriptions", 242 | "organizations_url": "https://api.github.com/users/hiimbex/orgs", 243 | "repos_url": "https://api.github.com/users/hiimbex/repos", 244 | "events_url": "https://api.github.com/users/hiimbex/events{/privacy}", 245 | "received_events_url": "https://api.github.com/users/hiimbex/received_events", 246 | "type": "User", 247 | "site_admin": false 248 | }, 249 | "labels": [], 250 | "state": "open", 251 | "locked": false, 252 | "assignee": null, 253 | "assignees": [], 254 | "milestone": null, 255 | "comments": 0, 256 | "created_at": "2017-06-22T23:22:27Z", 257 | "updated_at": "2017-06-22T23:22:43Z", 258 | "closed_at": null, 259 | "body": "qweqew" 260 | }, 261 | { 262 | "url": "https://api.github.com/repos/hiimbex/testing-things/issues/1", 263 | "repository_url": "https://api.github.com/repos/hiimbex/testing-things", 264 | "labels_url": "https://api.github.com/repos/hiimbex/testing-things/issues/1/labels{/name}", 265 | "comments_url": "https://api.github.com/repos/hiimbex/testing-things/issues/1/comments", 266 | "events_url": "https://api.github.com/repos/hiimbex/testing-things/issues/1/events", 267 | "html_url": "https://github.com/hiimbex/testing-things/pull/1", 268 | "id": 237994104, 269 | "number": 1, 270 | "title": "Update README.md", 271 | "user": { 272 | "login": "hiimbex", 273 | "id": 13410355, 274 | "avatar_url": "https://avatars2.githubusercontent.com/u/13410355?v=3", 275 | "gravatar_id": "", 276 | "url": "https://api.github.com/users/hiimbex", 277 | "html_url": "https://github.com/hiimbex", 278 | "followers_url": "https://api.github.com/users/hiimbex/followers", 279 | "following_url": "https://api.github.com/users/hiimbex/following{/other_user}", 280 | "gists_url": "https://api.github.com/users/hiimbex/gists{/gist_id}", 281 | "starred_url": "https://api.github.com/users/hiimbex/starred{/owner}{/repo}", 282 | "subscriptions_url": "https://api.github.com/users/hiimbex/subscriptions", 283 | "organizations_url": "https://api.github.com/users/hiimbex/orgs", 284 | "repos_url": "https://api.github.com/users/hiimbex/repos", 285 | "events_url": "https://api.github.com/users/hiimbex/events{/privacy}", 286 | "received_events_url": "https://api.github.com/users/hiimbex/received_events", 287 | "type": "User", 288 | "site_admin": false 289 | }, 290 | "labels": [], 291 | "state": "closed", 292 | "locked": false, 293 | "assignee": null, 294 | "assignees": [], 295 | "milestone": null, 296 | "comments": 2, 297 | "created_at": "2017-06-22T22:41:33Z", 298 | "updated_at": "2017-06-23T23:06:06Z", 299 | "closed_at": "2017-06-23T23:06:06Z", 300 | "pull_request": { 301 | "url": "https://api.github.com/repos/hiimbex/testing-things/pulls/1", 302 | "html_url": "https://github.com/hiimbex/testing-things/pull/1", 303 | "diff_url": "https://github.com/hiimbex/testing-things/pull/1.diff", 304 | "patch_url": "https://github.com/hiimbex/testing-things/pull/1.patch" 305 | }, 306 | "body": "making some changes!!" 307 | } 308 | ] 309 | 310 | } 311 | -------------------------------------------------------------------------------- /test/events/succIssueRes.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "url": "https://api.github.com/repos/hiimbex/testing-things/issues/5", 5 | "repository_url": "https://api.github.com/repos/hiimbex/testing-things", 6 | "labels_url": "https://api.github.com/repos/hiimbex/testing-things/issues/5/labels{/name}", 7 | "comments_url": "https://api.github.com/repos/hiimbex/testing-things/issues/5/comments", 8 | "events_url": "https://api.github.com/repos/hiimbex/testing-things/issues/5/events", 9 | "html_url": "https://github.com/hiimbex/testing-things/pull/5", 10 | "id": 238250761, 11 | "number": 5, 12 | "title": "Update README.md", 13 | "user": { 14 | "login": "hiimbex-testing", 15 | "id": 29637752, 16 | "avatar_url": "https://avatars3.githubusercontent.com/u/29637752?v=3", 17 | "gravatar_id": "", 18 | "url": "https://api.github.com/users/hiimbex-testing", 19 | "html_url": "https://github.com/hiimbex-testing", 20 | "followers_url": "https://api.github.com/users/hiimbex-testing/followers", 21 | "following_url": "https://api.github.com/users/hiimbex-testing/following{/other_user}", 22 | "gists_url": "https://api.github.com/users/hiimbex-testing/gists{/gist_id}", 23 | "starred_url": "https://api.github.com/users/hiimbex-testing/starred{/owner}{/repo}", 24 | "subscriptions_url": "https://api.github.com/users/hiimbex-testing/subscriptions", 25 | "organizations_url": "https://api.github.com/users/hiimbex-testing/orgs", 26 | "repos_url": "https://api.github.com/users/hiimbex-testing/repos", 27 | "events_url": "https://api.github.com/users/hiimbex-testing/events{/privacy}", 28 | "received_events_url": "https://api.github.com/users/hiimbex-testing/received_events", 29 | "type": "User", 30 | "site_admin": false 31 | }, 32 | "labels": [], 33 | "state": "open", 34 | "locked": false, 35 | "assignee": null, 36 | "assignees": [], 37 | "milestone": null, 38 | "comments": 1, 39 | "created_at": "2017-06-23T20:51:52Z", 40 | "updated_at": "2017-06-23T20:51:55Z", 41 | "closed_at": null, 42 | "pull_request": { 43 | "url": "https://api.github.com/repos/hiimbex/testing-things/pulls/5", 44 | "html_url": "https://github.com/hiimbex/testing-things/pull/5", 45 | "diff_url": "https://github.com/hiimbex/testing-things/pull/5.diff", 46 | "patch_url": "https://github.com/hiimbex/testing-things/pull/5.patch" 47 | }, 48 | "body": "" 49 | } 50 | ] 51 | } 52 | -------------------------------------------------------------------------------- /test/events/succeedEvent.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pull_request", 3 | "payload": { 4 | "action": "opened", 5 | "number": 5, 6 | "pull_request": { 7 | "url": "https://api.github.com/repos/hiimbex/testing-things/pulls/5", 8 | "id": 127286749, 9 | "html_url": "https://github.com/hiimbex/testing-things/pull/5", 10 | "diff_url": "https://github.com/hiimbex/testing-things/pull/5.diff", 11 | "patch_url": "https://github.com/hiimbex/testing-things/pull/5.patch", 12 | "issue_url": "https://api.github.com/repos/hiimbex/testing-things/issues/5", 13 | "number": 5, 14 | "state": "open", 15 | "locked": false, 16 | "title": "Update README.md", 17 | "user": { 18 | "login": "hiimbex-testing", 19 | "id": 29637752, 20 | "avatar_url": "https://avatars3.githubusercontent.com/u/29637752?v=3", 21 | "gravatar_id": "", 22 | "url": "https://api.github.com/users/hiimbex-testing", 23 | "html_url": "https://github.com/hiimbex-testing", 24 | "followers_url": "https://api.github.com/users/hiimbex-testing/followers", 25 | "following_url": "https://api.github.com/users/hiimbex-testing/following{/other_user}", 26 | "gists_url": "https://api.github.com/users/hiimbex-testing/gists{/gist_id}", 27 | "starred_url": "https://api.github.com/users/hiimbex-testing/starred{/owner}{/repo}", 28 | "subscriptions_url": "https://api.github.com/users/hiimbex-testing/subscriptions", 29 | "organizations_url": "https://api.github.com/users/hiimbex-testing/orgs", 30 | "repos_url": "https://api.github.com/users/hiimbex-testing/repos", 31 | "events_url": "https://api.github.com/users/hiimbex-testing/events{/privacy}", 32 | "received_events_url": "https://api.github.com/users/hiimbex-testing/received_events", 33 | "type": "User", 34 | "site_admin": false 35 | }, 36 | "body": "", 37 | "created_at": "2017-06-23T20:51:52Z", 38 | "updated_at": "2017-06-23T20:51:52Z", 39 | "closed_at": null, 40 | "merged_at": null, 41 | "merge_commit_sha": null, 42 | "assignee": null, 43 | "assignees": [ 44 | 45 | ], 46 | "requested_reviewers": [ 47 | 48 | ], 49 | "milestone": null, 50 | "commits_url": "https://api.github.com/repos/hiimbex/testing-things/pulls/5/commits", 51 | "review_comments_url": "https://api.github.com/repos/hiimbex/testing-things/pulls/5/comments", 52 | "review_comment_url": "https://api.github.com/repos/hiimbex/testing-things/pulls/comments{/number}", 53 | "comments_url": "https://api.github.com/repos/hiimbex/testing-things/issues/5/comments", 54 | "statuses_url": "https://api.github.com/repos/hiimbex/testing-things/statuses/a402b02126bee6cc796985803c91b8f33d57443f", 55 | "head": { 56 | "label": "hiimbex-testing:patch-1", 57 | "ref": "patch-1", 58 | "sha": "a402b02126bee6cc796985803c91b8f33d57443f", 59 | "user": { 60 | "login": "hiimbex-testing", 61 | "id": 29637752, 62 | "avatar_url": "https://avatars3.githubusercontent.com/u/29637752?v=3", 63 | "gravatar_id": "", 64 | "url": "https://api.github.com/users/hiimbex-testing", 65 | "html_url": "https://github.com/hiimbex-testing", 66 | "followers_url": "https://api.github.com/users/hiimbex-testing/followers", 67 | "following_url": "https://api.github.com/users/hiimbex-testing/following{/other_user}", 68 | "gists_url": "https://api.github.com/users/hiimbex-testing/gists{/gist_id}", 69 | "starred_url": "https://api.github.com/users/hiimbex-testing/starred{/owner}{/repo}", 70 | "subscriptions_url": "https://api.github.com/users/hiimbex-testing/subscriptions", 71 | "organizations_url": "https://api.github.com/users/hiimbex-testing/orgs", 72 | "repos_url": "https://api.github.com/users/hiimbex-testing/repos", 73 | "events_url": "https://api.github.com/users/hiimbex-testing/events{/privacy}", 74 | "received_events_url": "https://api.github.com/users/hiimbex-testing/received_events", 75 | "type": "User", 76 | "site_admin": false 77 | }, 78 | "repo": { 79 | "id": 95255407, 80 | "name": "testing-things", 81 | "full_name": "hiimbex-testing/testing-things", 82 | "owner": { 83 | "login": "hiimbex-testing", 84 | "id": 29637752, 85 | "avatar_url": "https://avatars3.githubusercontent.com/u/29637752?v=3", 86 | "gravatar_id": "", 87 | "url": "https://api.github.com/users/hiimbex-testing", 88 | "html_url": "https://github.com/hiimbex-testing", 89 | "followers_url": "https://api.github.com/users/hiimbex-testing/followers", 90 | "following_url": "https://api.github.com/users/hiimbex-testing/following{/other_user}", 91 | "gists_url": "https://api.github.com/users/hiimbex-testing/gists{/gist_id}", 92 | "starred_url": "https://api.github.com/users/hiimbex-testing/starred{/owner}{/repo}", 93 | "subscriptions_url": "https://api.github.com/users/hiimbex-testing/subscriptions", 94 | "organizations_url": "https://api.github.com/users/hiimbex-testing/orgs", 95 | "repos_url": "https://api.github.com/users/hiimbex-testing/repos", 96 | "events_url": "https://api.github.com/users/hiimbex-testing/events{/privacy}", 97 | "received_events_url": "https://api.github.com/users/hiimbex-testing/received_events", 98 | "type": "User", 99 | "site_admin": false 100 | }, 101 | "private": false, 102 | "html_url": "https://github.com/hiimbex-testing/testing-things", 103 | "description": null, 104 | "fork": true, 105 | "url": "https://api.github.com/repos/hiimbex-testing/testing-things", 106 | "forks_url": "https://api.github.com/repos/hiimbex-testing/testing-things/forks", 107 | "keys_url": "https://api.github.com/repos/hiimbex-testing/testing-things/keys{/key_id}", 108 | "collaborators_url": "https://api.github.com/repos/hiimbex-testing/testing-things/collaborators{/collaborator}", 109 | "teams_url": "https://api.github.com/repos/hiimbex-testing/testing-things/teams", 110 | "hooks_url": "https://api.github.com/repos/hiimbex-testing/testing-things/hooks", 111 | "issue_events_url": "https://api.github.com/repos/hiimbex-testing/testing-things/issues/events{/number}", 112 | "events_url": "https://api.github.com/repos/hiimbex-testing/testing-things/events", 113 | "assignees_url": "https://api.github.com/repos/hiimbex-testing/testing-things/assignees{/user}", 114 | "branches_url": "https://api.github.com/repos/hiimbex-testing/testing-things/branches{/branch}", 115 | "tags_url": "https://api.github.com/repos/hiimbex-testing/testing-things/tags", 116 | "blobs_url": "https://api.github.com/repos/hiimbex-testing/testing-things/git/blobs{/sha}", 117 | "git_tags_url": "https://api.github.com/repos/hiimbex-testing/testing-things/git/tags{/sha}", 118 | "git_refs_url": "https://api.github.com/repos/hiimbex-testing/testing-things/git/refs{/sha}", 119 | "trees_url": "https://api.github.com/repos/hiimbex-testing/testing-things/git/trees{/sha}", 120 | "statuses_url": "https://api.github.com/repos/hiimbex-testing/testing-things/statuses/{sha}", 121 | "languages_url": "https://api.github.com/repos/hiimbex-testing/testing-things/languages", 122 | "stargazers_url": "https://api.github.com/repos/hiimbex-testing/testing-things/stargazers", 123 | "contributors_url": "https://api.github.com/repos/hiimbex-testing/testing-things/contributors", 124 | "subscribers_url": "https://api.github.com/repos/hiimbex-testing/testing-things/subscribers", 125 | "subscription_url": "https://api.github.com/repos/hiimbex-testing/testing-things/subscription", 126 | "commits_url": "https://api.github.com/repos/hiimbex-testing/testing-things/commits{/sha}", 127 | "git_commits_url": "https://api.github.com/repos/hiimbex-testing/testing-things/git/commits{/sha}", 128 | "comments_url": "https://api.github.com/repos/hiimbex-testing/testing-things/comments{/number}", 129 | "issue_comment_url": "https://api.github.com/repos/hiimbex-testing/testing-things/issues/comments{/number}", 130 | "contents_url": "https://api.github.com/repos/hiimbex-testing/testing-things/contents/{+path}", 131 | "compare_url": "https://api.github.com/repos/hiimbex-testing/testing-things/compare/{base}...{head}", 132 | "merges_url": "https://api.github.com/repos/hiimbex-testing/testing-things/merges", 133 | "archive_url": "https://api.github.com/repos/hiimbex-testing/testing-things/{archive_format}{/ref}", 134 | "downloads_url": "https://api.github.com/repos/hiimbex-testing/testing-things/downloads", 135 | "issues_url": "https://api.github.com/repos/hiimbex-testing/testing-things/issues{/number}", 136 | "pulls_url": "https://api.github.com/repos/hiimbex-testing/testing-things/pulls{/number}", 137 | "milestones_url": "https://api.github.com/repos/hiimbex-testing/testing-things/milestones{/number}", 138 | "notifications_url": "https://api.github.com/repos/hiimbex-testing/testing-things/notifications{?since,all,participating}", 139 | "labels_url": "https://api.github.com/repos/hiimbex-testing/testing-things/labels{/name}", 140 | "releases_url": "https://api.github.com/repos/hiimbex-testing/testing-things/releases{/id}", 141 | "deployments_url": "https://api.github.com/repos/hiimbex-testing/testing-things/deployments", 142 | "created_at": "2017-06-23T20:48:33Z", 143 | "updated_at": "2017-06-22T22:38:49Z", 144 | "pushed_at": "2017-06-23T20:48:39Z", 145 | "git_url": "git://github.com/hiimbex-testing/testing-things.git", 146 | "ssh_url": "git@github.com:hiimbex-testing/testing-things.git", 147 | "clone_url": "https://github.com/hiimbex-testing/testing-things.git", 148 | "svn_url": "https://github.com/hiimbex-testing/testing-things", 149 | "homepage": null, 150 | "size": 0, 151 | "stargazers_count": 0, 152 | "watchers_count": 0, 153 | "language": null, 154 | "has_issues": false, 155 | "has_projects": true, 156 | "has_downloads": true, 157 | "has_wiki": true, 158 | "has_pages": false, 159 | "forks_count": 0, 160 | "mirror_url": null, 161 | "open_issues_count": 0, 162 | "forks": 0, 163 | "open_issues": 0, 164 | "watchers": 0, 165 | "default_branch": "master" 166 | } 167 | }, 168 | "base": { 169 | "label": "hiimbex:master", 170 | "ref": "master", 171 | "sha": "1006b544799c93cf828eb5ea8d865c3d97f8d155", 172 | "user": { 173 | "login": "hiimbex", 174 | "id": 13410355, 175 | "avatar_url": "https://avatars2.githubusercontent.com/u/13410355?v=3", 176 | "gravatar_id": "", 177 | "url": "https://api.github.com/users/hiimbex", 178 | "html_url": "https://github.com/hiimbex", 179 | "followers_url": "https://api.github.com/users/hiimbex/followers", 180 | "following_url": "https://api.github.com/users/hiimbex/following{/other_user}", 181 | "gists_url": "https://api.github.com/users/hiimbex/gists{/gist_id}", 182 | "starred_url": "https://api.github.com/users/hiimbex/starred{/owner}{/repo}", 183 | "subscriptions_url": "https://api.github.com/users/hiimbex/subscriptions", 184 | "organizations_url": "https://api.github.com/users/hiimbex/orgs", 185 | "repos_url": "https://api.github.com/users/hiimbex/repos", 186 | "events_url": "https://api.github.com/users/hiimbex/events{/privacy}", 187 | "received_events_url": "https://api.github.com/users/hiimbex/received_events", 188 | "type": "User", 189 | "site_admin": false 190 | }, 191 | "repo": { 192 | "id": 95162387, 193 | "name": "testing-things", 194 | "full_name": "hiimbex/testing-things", 195 | "owner": { 196 | "login": "hiimbex", 197 | "id": 13410355, 198 | "avatar_url": "https://avatars2.githubusercontent.com/u/13410355?v=3", 199 | "gravatar_id": "", 200 | "url": "https://api.github.com/users/hiimbex", 201 | "html_url": "https://github.com/hiimbex", 202 | "followers_url": "https://api.github.com/users/hiimbex/followers", 203 | "following_url": "https://api.github.com/users/hiimbex/following{/other_user}", 204 | "gists_url": "https://api.github.com/users/hiimbex/gists{/gist_id}", 205 | "starred_url": "https://api.github.com/users/hiimbex/starred{/owner}{/repo}", 206 | "subscriptions_url": "https://api.github.com/users/hiimbex/subscriptions", 207 | "organizations_url": "https://api.github.com/users/hiimbex/orgs", 208 | "repos_url": "https://api.github.com/users/hiimbex/repos", 209 | "events_url": "https://api.github.com/users/hiimbex/events{/privacy}", 210 | "received_events_url": "https://api.github.com/users/hiimbex/received_events", 211 | "type": "User", 212 | "site_admin": false 213 | }, 214 | "private": false, 215 | "html_url": "https://github.com/hiimbex/testing-things", 216 | "description": null, 217 | "fork": false, 218 | "url": "https://api.github.com/repos/hiimbex/testing-things", 219 | "forks_url": "https://api.github.com/repos/hiimbex/testing-things/forks", 220 | "keys_url": "https://api.github.com/repos/hiimbex/testing-things/keys{/key_id}", 221 | "collaborators_url": "https://api.github.com/repos/hiimbex/testing-things/collaborators{/collaborator}", 222 | "teams_url": "https://api.github.com/repos/hiimbex/testing-things/teams", 223 | "hooks_url": "https://api.github.com/repos/hiimbex/testing-things/hooks", 224 | "issue_events_url": "https://api.github.com/repos/hiimbex/testing-things/issues/events{/number}", 225 | "events_url": "https://api.github.com/repos/hiimbex/testing-things/events", 226 | "assignees_url": "https://api.github.com/repos/hiimbex/testing-things/assignees{/user}", 227 | "branches_url": "https://api.github.com/repos/hiimbex/testing-things/branches{/branch}", 228 | "tags_url": "https://api.github.com/repos/hiimbex/testing-things/tags", 229 | "blobs_url": "https://api.github.com/repos/hiimbex/testing-things/git/blobs{/sha}", 230 | "git_tags_url": "https://api.github.com/repos/hiimbex/testing-things/git/tags{/sha}", 231 | "git_refs_url": "https://api.github.com/repos/hiimbex/testing-things/git/refs{/sha}", 232 | "trees_url": "https://api.github.com/repos/hiimbex/testing-things/git/trees{/sha}", 233 | "statuses_url": "https://api.github.com/repos/hiimbex/testing-things/statuses/{sha}", 234 | "languages_url": "https://api.github.com/repos/hiimbex/testing-things/languages", 235 | "stargazers_url": "https://api.github.com/repos/hiimbex/testing-things/stargazers", 236 | "contributors_url": "https://api.github.com/repos/hiimbex/testing-things/contributors", 237 | "subscribers_url": "https://api.github.com/repos/hiimbex/testing-things/subscribers", 238 | "subscription_url": "https://api.github.com/repos/hiimbex/testing-things/subscription", 239 | "commits_url": "https://api.github.com/repos/hiimbex/testing-things/commits{/sha}", 240 | "git_commits_url": "https://api.github.com/repos/hiimbex/testing-things/git/commits{/sha}", 241 | "comments_url": "https://api.github.com/repos/hiimbex/testing-things/comments{/number}", 242 | "issue_comment_url": "https://api.github.com/repos/hiimbex/testing-things/issues/comments{/number}", 243 | "contents_url": "https://api.github.com/repos/hiimbex/testing-things/contents/{+path}", 244 | "compare_url": "https://api.github.com/repos/hiimbex/testing-things/compare/{base}...{head}", 245 | "merges_url": "https://api.github.com/repos/hiimbex/testing-things/merges", 246 | "archive_url": "https://api.github.com/repos/hiimbex/testing-things/{archive_format}{/ref}", 247 | "downloads_url": "https://api.github.com/repos/hiimbex/testing-things/downloads", 248 | "issues_url": "https://api.github.com/repos/hiimbex/testing-things/issues{/number}", 249 | "pulls_url": "https://api.github.com/repos/hiimbex/testing-things/pulls{/number}", 250 | "milestones_url": "https://api.github.com/repos/hiimbex/testing-things/milestones{/number}", 251 | "notifications_url": "https://api.github.com/repos/hiimbex/testing-things/notifications{?since,all,participating}", 252 | "labels_url": "https://api.github.com/repos/hiimbex/testing-things/labels{/name}", 253 | "releases_url": "https://api.github.com/repos/hiimbex/testing-things/releases{/id}", 254 | "deployments_url": "https://api.github.com/repos/hiimbex/testing-things/deployments", 255 | "created_at": "2017-06-22T22:38:49Z", 256 | "updated_at": "2017-06-22T22:38:49Z", 257 | "pushed_at": "2017-06-23T20:22:46Z", 258 | "git_url": "git://github.com/hiimbex/testing-things.git", 259 | "ssh_url": "git@github.com:hiimbex/testing-things.git", 260 | "clone_url": "https://github.com/hiimbex/testing-things.git", 261 | "svn_url": "https://github.com/hiimbex/testing-things", 262 | "homepage": null, 263 | "size": 0, 264 | "stargazers_count": 0, 265 | "watchers_count": 0, 266 | "language": null, 267 | "has_issues": true, 268 | "has_projects": true, 269 | "has_downloads": true, 270 | "has_wiki": true, 271 | "has_pages": false, 272 | "forks_count": 2, 273 | "mirror_url": null, 274 | "open_issues_count": 5, 275 | "forks": 2, 276 | "open_issues": 5, 277 | "watchers": 0, 278 | "default_branch": "master" 279 | } 280 | }, 281 | "_links": { 282 | "self": { 283 | "href": "https://api.github.com/repos/hiimbex/testing-things/pulls/5" 284 | }, 285 | "html": { 286 | "href": "https://github.com/hiimbex/testing-things/pull/5" 287 | }, 288 | "issue": { 289 | "href": "https://api.github.com/repos/hiimbex/testing-things/issues/5" 290 | }, 291 | "comments": { 292 | "href": "https://api.github.com/repos/hiimbex/testing-things/issues/5/comments" 293 | }, 294 | "review_comments": { 295 | "href": "https://api.github.com/repos/hiimbex/testing-things/pulls/5/comments" 296 | }, 297 | "review_comment": { 298 | "href": "https://api.github.com/repos/hiimbex/testing-things/pulls/comments{/number}" 299 | }, 300 | "commits": { 301 | "href": "https://api.github.com/repos/hiimbex/testing-things/pulls/5/commits" 302 | }, 303 | "statuses": { 304 | "href": "https://api.github.com/repos/hiimbex/testing-things/statuses/a402b02126bee6cc796985803c91b8f33d57443f" 305 | } 306 | }, 307 | "merged": false, 308 | "mergeable": null, 309 | "rebaseable": null, 310 | "mergeable_state": "unknown", 311 | "merged_by": null, 312 | "comments": 0, 313 | "review_comments": 0, 314 | "maintainer_can_modify": true, 315 | "commits": 1, 316 | "additions": 1, 317 | "deletions": 1, 318 | "changed_files": 1 319 | }, 320 | "repository": { 321 | "id": 95162387, 322 | "name": "testing-things", 323 | "full_name": "hiimbex/testing-things", 324 | "owner": { 325 | "login": "hiimbex", 326 | "id": 13410355, 327 | "avatar_url": "https://avatars2.githubusercontent.com/u/13410355?v=3", 328 | "gravatar_id": "", 329 | "url": "https://api.github.com/users/hiimbex", 330 | "html_url": "https://github.com/hiimbex", 331 | "followers_url": "https://api.github.com/users/hiimbex/followers", 332 | "following_url": "https://api.github.com/users/hiimbex/following{/other_user}", 333 | "gists_url": "https://api.github.com/users/hiimbex/gists{/gist_id}", 334 | "starred_url": "https://api.github.com/users/hiimbex/starred{/owner}{/repo}", 335 | "subscriptions_url": "https://api.github.com/users/hiimbex/subscriptions", 336 | "organizations_url": "https://api.github.com/users/hiimbex/orgs", 337 | "repos_url": "https://api.github.com/users/hiimbex/repos", 338 | "events_url": "https://api.github.com/users/hiimbex/events{/privacy}", 339 | "received_events_url": "https://api.github.com/users/hiimbex/received_events", 340 | "type": "User", 341 | "site_admin": false 342 | }, 343 | "private": false, 344 | "html_url": "https://github.com/hiimbex/testing-things", 345 | "description": null, 346 | "fork": false, 347 | "url": "https://api.github.com/repos/hiimbex/testing-things", 348 | "forks_url": "https://api.github.com/repos/hiimbex/testing-things/forks", 349 | "keys_url": "https://api.github.com/repos/hiimbex/testing-things/keys{/key_id}", 350 | "collaborators_url": "https://api.github.com/repos/hiimbex/testing-things/collaborators{/collaborator}", 351 | "teams_url": "https://api.github.com/repos/hiimbex/testing-things/teams", 352 | "hooks_url": "https://api.github.com/repos/hiimbex/testing-things/hooks", 353 | "issue_events_url": "https://api.github.com/repos/hiimbex/testing-things/issues/events{/number}", 354 | "events_url": "https://api.github.com/repos/hiimbex/testing-things/events", 355 | "assignees_url": "https://api.github.com/repos/hiimbex/testing-things/assignees{/user}", 356 | "branches_url": "https://api.github.com/repos/hiimbex/testing-things/branches{/branch}", 357 | "tags_url": "https://api.github.com/repos/hiimbex/testing-things/tags", 358 | "blobs_url": "https://api.github.com/repos/hiimbex/testing-things/git/blobs{/sha}", 359 | "git_tags_url": "https://api.github.com/repos/hiimbex/testing-things/git/tags{/sha}", 360 | "git_refs_url": "https://api.github.com/repos/hiimbex/testing-things/git/refs{/sha}", 361 | "trees_url": "https://api.github.com/repos/hiimbex/testing-things/git/trees{/sha}", 362 | "statuses_url": "https://api.github.com/repos/hiimbex/testing-things/statuses/{sha}", 363 | "languages_url": "https://api.github.com/repos/hiimbex/testing-things/languages", 364 | "stargazers_url": "https://api.github.com/repos/hiimbex/testing-things/stargazers", 365 | "contributors_url": "https://api.github.com/repos/hiimbex/testing-things/contributors", 366 | "subscribers_url": "https://api.github.com/repos/hiimbex/testing-things/subscribers", 367 | "subscription_url": "https://api.github.com/repos/hiimbex/testing-things/subscription", 368 | "commits_url": "https://api.github.com/repos/hiimbex/testing-things/commits{/sha}", 369 | "git_commits_url": "https://api.github.com/repos/hiimbex/testing-things/git/commits{/sha}", 370 | "comments_url": "https://api.github.com/repos/hiimbex/testing-things/comments{/number}", 371 | "issue_comment_url": "https://api.github.com/repos/hiimbex/testing-things/issues/comments{/number}", 372 | "contents_url": "https://api.github.com/repos/hiimbex/testing-things/contents/{+path}", 373 | "compare_url": "https://api.github.com/repos/hiimbex/testing-things/compare/{base}...{head}", 374 | "merges_url": "https://api.github.com/repos/hiimbex/testing-things/merges", 375 | "archive_url": "https://api.github.com/repos/hiimbex/testing-things/{archive_format}{/ref}", 376 | "downloads_url": "https://api.github.com/repos/hiimbex/testing-things/downloads", 377 | "issues_url": "https://api.github.com/repos/hiimbex/testing-things/issues{/number}", 378 | "pulls_url": "https://api.github.com/repos/hiimbex/testing-things/pulls{/number}", 379 | "milestones_url": "https://api.github.com/repos/hiimbex/testing-things/milestones{/number}", 380 | "notifications_url": "https://api.github.com/repos/hiimbex/testing-things/notifications{?since,all,participating}", 381 | "labels_url": "https://api.github.com/repos/hiimbex/testing-things/labels{/name}", 382 | "releases_url": "https://api.github.com/repos/hiimbex/testing-things/releases{/id}", 383 | "deployments_url": "https://api.github.com/repos/hiimbex/testing-things/deployments", 384 | "created_at": "2017-06-22T22:38:49Z", 385 | "updated_at": "2017-06-22T22:38:49Z", 386 | "pushed_at": "2017-06-23T20:22:46Z", 387 | "git_url": "git://github.com/hiimbex/testing-things.git", 388 | "ssh_url": "git@github.com:hiimbex/testing-things.git", 389 | "clone_url": "https://github.com/hiimbex/testing-things.git", 390 | "svn_url": "https://github.com/hiimbex/testing-things", 391 | "homepage": null, 392 | "size": 0, 393 | "stargazers_count": 0, 394 | "watchers_count": 0, 395 | "language": null, 396 | "has_issues": true, 397 | "has_projects": true, 398 | "has_downloads": true, 399 | "has_wiki": true, 400 | "has_pages": false, 401 | "forks_count": 2, 402 | "mirror_url": null, 403 | "open_issues_count": 5, 404 | "forks": 2, 405 | "open_issues": 5, 406 | "watchers": 0, 407 | "default_branch": "master" 408 | }, 409 | "sender": { 410 | "login": "hiimbex-testing", 411 | "id": 29637752, 412 | "avatar_url": "https://avatars3.githubusercontent.com/u/29637752?v=3", 413 | "gravatar_id": "", 414 | "url": "https://api.github.com/users/hiimbex-testing", 415 | "html_url": "https://github.com/hiimbex-testing", 416 | "followers_url": "https://api.github.com/users/hiimbex-testing/followers", 417 | "following_url": "https://api.github.com/users/hiimbex-testing/following{/other_user}", 418 | "gists_url": "https://api.github.com/users/hiimbex-testing/gists{/gist_id}", 419 | "starred_url": "https://api.github.com/users/hiimbex-testing/starred{/owner}{/repo}", 420 | "subscriptions_url": "https://api.github.com/users/hiimbex-testing/subscriptions", 421 | "organizations_url": "https://api.github.com/users/hiimbex-testing/orgs", 422 | "repos_url": "https://api.github.com/users/hiimbex-testing/repos", 423 | "events_url": "https://api.github.com/users/hiimbex-testing/events{/privacy}", 424 | "received_events_url": "https://api.github.com/users/hiimbex-testing/received_events", 425 | "type": "User", 426 | "site_admin": false 427 | }, 428 | "installation": { 429 | "id": 34739 430 | } 431 | } 432 | } 433 | -------------------------------------------------------------------------------- /test/index.js: -------------------------------------------------------------------------------- 1 | const expect = require('expect'); 2 | const {Application} = require('probot'); 3 | const {GitHubAPI} = require('probot/lib/github'); 4 | const succeedEvent = require('./events/succeedEvent'); 5 | const failEvent = require('./events/failEvent'); 6 | const succIssueRes = require('./events/succIssueRes'); 7 | const failIssueRes = require('./events/failIssueRes'); 8 | const plugin = require('..'); 9 | 10 | describe('new-pr-welcome', () => { 11 | let app; 12 | let github; 13 | 14 | beforeEach(() => { 15 | app = new Application(); 16 | plugin(app); 17 | github = new GitHubAPI(); 18 | app.auth = () => Promise.resolve(github); 19 | }); 20 | 21 | function makeResponse(msg) { 22 | return Promise.resolve({data: {content: Buffer.from(msg).toString('base64')}}); 23 | } 24 | 25 | describe('new-pr-welcome', () => { 26 | it('posts a comment because it is a user\'s first PR', async () => { 27 | expect.spyOn(github.repos, 'getContents').andReturn(makeResponse(`newPRWelcomeComment: >\n Hello World!`)); 28 | expect.spyOn(github.issues, 'listForRepo').andReturn(Promise.resolve(succIssueRes)); 29 | expect.spyOn(github.issues, 'createComment'); 30 | 31 | await app.receive(succeedEvent); 32 | 33 | expect(github.issues.listForRepo).toHaveBeenCalledWith({ 34 | owner: 'hiimbex', 35 | repo: 'testing-things', 36 | state: 'all', 37 | creator: 'hiimbex-testing' 38 | }); 39 | expect(github.repos.getContents).toHaveBeenCalledWith({ 40 | owner: 'hiimbex', 41 | repo: 'testing-things', 42 | path: '.github/config.yml' 43 | }); 44 | expect(github.issues.createComment).toHaveBeenCalled(); 45 | }); 46 | }); 47 | 48 | describe('new-pr-welcome fail', () => { 49 | it('does not post a comment because it is not the user\'s first PR', async () => { 50 | expect.spyOn(github.repos, 'getContents').andReturn(makeResponse(`newPRWelcomeComment: >\n Hello World!`)); 51 | expect.spyOn(github.issues, 'listForRepo').andReturn(Promise.resolve(failIssueRes)); 52 | expect.spyOn(github.issues, 'createComment'); 53 | 54 | await app.receive(failEvent); 55 | 56 | expect(github.issues.listForRepo).toHaveBeenCalledWith({ 57 | owner: 'hiimbex', 58 | repo: 'testing-things', 59 | state: 'all', 60 | creator: 'hiimbex' 61 | }); 62 | expect(github.repos.getContents).toNotHaveBeenCalled(); 63 | expect(github.issues.createComment).toNotHaveBeenCalled(); 64 | }); 65 | }); 66 | }); 67 | --------------------------------------------------------------------------------