├── .babelrc ├── .circleci └── config.yml ├── .eslintrc.json ├── .gitignore ├── LICENSE ├── README.md ├── architecture.png ├── config ├── default.json └── test.json ├── demo.png ├── images ├── assign_to_reviewer.gif ├── check_review_comment.gif ├── notify_to_slack.png └── wip.gif ├── package.json ├── pr-notify-bot-on-vpc.yml ├── pr-notify-bot.yml ├── src ├── handler.js ├── index.js ├── pull_request.js ├── slack.js └── utils.js ├── test ├── fixtures │ ├── mention_issue.json │ ├── mention_review.json │ ├── merge.json │ ├── request_review.json │ ├── review_comments_approved.json │ ├── review_comments_changed.json │ └── work_in_progress.json ├── src │ ├── index.spec.js │ ├── pull_request.spec.js │ └── slack.spec.js └── utils │ └── fixtures.js └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["@babel/env", { 4 | "targets": { 5 | "node": "6.10" 6 | } 7 | }] 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | jobs: 3 | build: 4 | working_directory: ~/workspace 5 | docker: 6 | - image: node:6.10.3 7 | steps: 8 | - checkout 9 | - restore_cache: 10 | key: dependency-cache-{{ .Branch }}-{{ checksum "yarn.lock" }} 11 | - run: 12 | name: yarn install 13 | command: yarn install 14 | - save_cache: 15 | key: dependency-cache-{{ .Branch }}-{{ checksum "yarn.lock" }} 16 | paths: 17 | - ~/workspace/.cache/yarn 18 | - ~/workspace/node_modules 19 | - ~/workspace/package.json 20 | - run: 21 | name: test 22 | command: yarn test 23 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["airbnb-base", "plugin:prettier/recommended"], 3 | "plugins": ["import"], 4 | "rules": { 5 | "no-underscore-dangle": 0, 6 | "prettier/prettier": [ 7 | "error", 8 | { 9 | "singleQuote": true, 10 | "trailingComma": "es5" 11 | } 12 | ] 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | coverage/ 3 | dist/ 4 | .sam 5 | .nyc_output 6 | packaged.yml 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Kentaro Matsushita 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 | # lambda-pr-notify-bot 2 | 3 | [![CircleCI](https://img.shields.io/circleci/project/github/kentaro-m/lambda-pr-notify-bot.svg?style=flat-square)](https://circleci.com/gh/kentaro-m/lambda-pr-notify-bot) 4 | [![license](https://img.shields.io/github/license/kentaro-m/lambda-pr-notify-bot.svg?style=flat-square)](https://github.com/kentaro-m/lambda-pr-notify-bot/blob/master/LICENSE) 5 | 6 | :robot: A bot that improve pull request workflow on GitHub. 7 | 8 | ![](./images/notify_to_slack.png) 9 | 10 | ## Features 11 | 12 | * :arrows_clockwise: Add automatically reviewers to pull request 13 | * :bell: Send a direct messages to Slack 14 | * When the pull request is opened 15 | * When the pull request is approved 16 | * When the pull request is added mention comment 17 | * :pushpin: Manege WIP pull request by using a label 18 | 19 | ## Configuration 20 | 21 | ### How to create oauth token for send messages to Slack 22 | 23 | 1. Access to [Your Apps](https://api.slack.com/apps) 24 | 2. Click the Create New App 25 | 3. Input App Name and Development Slack Workspace 26 | 4. Select Permissions in Add features and functionality 27 | 5. Add `chat:write:bot` in Permission Scopes 28 | 6. Create a token 29 | 7. Copy OAuth Access Token 30 | 31 | ### How to create oauth token for request GitHub API. 32 | 33 | 1. Access to [Personal access tokens](https://github.com/settings/tokens) 34 | 2. Click the Generate new token 35 | 3. Input description in Token description 36 | 4. Add `repo` in Select scopes 37 | 5. Create a token 38 | 6. Copy OAuth Access Token 39 | 40 | ### How to run the bot on AWS 41 | 42 | ``` 43 | $ git clone https://github.com/kentaro-m/lambda-pr-notify-bot.git 44 | $ cd lambda-pr-notify-bot 45 | $ npm install 46 | $ npm run package 47 | ``` 48 | 49 | Installing packages and building code. 50 | 51 | ``` 52 | { 53 | "host": "", // Required if using GitHub Enterprise 54 | "pathPrefix": "", // Required if using GitHub Enterprise 55 | "repositories": [ // Repositories that allows bot actions 56 | "unleash-sample" 57 | ], 58 | "reviewers": [ // Pull request reviewers (GitHub username) 59 | "matsushita-kentaro" 60 | ], 61 | "approveComments": [ // Comment on approving pull request 62 | "+1", 63 | "LGTM" 64 | ], 65 | "numApprovers": 1, // Number of people required for pull request approval 66 | "users": [ // Association between Slack user name and Github user name for notifying Slack 67 | { 68 | "github": "matsushita-kentaro", 69 | "slack": "kentaro" 70 | }, 71 | { 72 | "github": "kentaro-m", 73 | "slack": "kentaro" 74 | } 75 | ], 76 | "message": { // Message to notify to Slack 77 | "requestReview": "Please review this pull request.", 78 | "ableToMerge": "Able to merge this pull request.", 79 | "mentionComment": "Please check this review comment." 80 | }, 81 | "labels": { 82 | "wip": { 83 | "name": "wip", // display label name 84 | "color": "efb85f" // label color 85 | } 86 | }, 87 | "workInProgress": true, // Bot manages WIP pull request by using a wip label 88 | "assignReviewers": true, // Bot adds a assignees to the pull request 89 | "requestReview": true, // Bot adds a reviewers to the pull request 90 | "ableToMerge": true, // Notify Slack that pull requests can be merged 91 | "mentionComment": true // Notify mention comment to Slack 92 | } 93 | ``` 94 | 95 | Add reviewers (GitHub username), repositories and Slack username to `config/default.json`. Also, if necessary change other setting items. 96 | 97 | * **GITHUB_API_TOKEN** A token for obtaining information on pull requests (scope: repo) 98 | * **SLACK_API_TOKEN** A token for sending messages to Slack (scope: chat:write:bot) 99 | * **SECRET_TOKEN** A token for securing webhook 100 | 101 | Add environment variables as parameters. (or Add environment variables on the Lambda management console.) 102 | 103 | ``` 104 | $ aws cloudformation package \ 105 | --template-file pr-notify-bot.yml \ 106 | --s3-bucket \ 107 | --output-template packaged.yml 108 | $ aws cloudformation deploy \ 109 | --template-file packaged.yml \ 110 | --stack-name \ 111 | --parameter-overrides GitHubApiToken= SlackApiToken= SecretToken= \ 112 | --capabilities CAPABILITY_IAM 113 | ``` 114 | 115 | Upload the SAM template to S3 and deploy it. 116 | 117 | ### How to set up webhook on GitHub 118 | 119 | * Go to your project (or organization) settings > Webhooks > Add webhook 120 | * **Payload URL** `https://.execute-api..amazonaws.com//webhook` 121 | * **Content type** `application/json` 122 | * **Secret** any value 123 | * **Events** Pull request, Pull request review, Pull request review comment, Issue comment 124 | 125 | ### Options: Execute a Lambda Function on VPC 126 | 127 | Please use it when assigning a static IP to execute a Lambda Function. Also, if necessary, please specify security group and subnet as parameters (An array of literal strings that are separated by commas.). 128 | 129 | * **SecurityGroupIds** The list of Security Group IDs for the HTTPS Access. 130 | * **PrivateSubnetIds** The list of VPC Private Subnet IDs for running the Lambda Function. 131 | 132 | ``` 133 | $ aws cloudformation package \ 134 | --template-file pr-notify-bot-on-vpc.yml \ 135 | --s3-bucket \ 136 | --output-template packaged.yml 137 | $ aws cloudformation deploy \ 138 | --template-file packaged.yml \ 139 | --stack-name \ 140 | --parameter-overrides GitHubApiToken= SlackApiToken= SecretToken= SecurityGroupIds= PrivateSubnetIds= \ 141 | --capabilities CAPABILITY_IAM 142 | ``` 143 | 144 | ## Usage 145 | 146 | ### Add automatically reviewers to pull request 147 | 148 | ![](./images/assign_to_reviewer.gif) 149 | 150 | 1. Pull request is created 151 | 2. Add automatically reviewers to the pull request 152 | 3. Send a direct message to Slack 153 | 154 | ### Manege WIP pull request by using a label 155 | 156 | ![](./images/wip.gif) 157 | 158 | 1. Create a pull request by including WIP in the title 159 | 2. Add automatically wip label to the pull request 160 | 3. Remove wip label, when the pull request is ready for review 161 | 4. Add automatically reviewers to the pull request 162 | 163 | ### Send a direct messages to Slack 164 | 165 | ![](./images/check_review_comment.gif) 166 | 167 | * When the pull request is opened 168 | * When the pull request is added mention comment 169 | * When the pull request is approved 170 | 171 | ## Architecture 172 | 173 | ![](./architecture.png) 174 | 175 | ## License 176 | 177 | MIT 178 | -------------------------------------------------------------------------------- /architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentaro-m/lambda-pr-notify-bot/5cb57d9aecfd9e8b183148409269fc86bf45b388/architecture.png -------------------------------------------------------------------------------- /config/default.json: -------------------------------------------------------------------------------- 1 | { 2 | "host": "", 3 | "pathPrefix": "", 4 | "reviewers": ["matsushita-kentaro"], 5 | "approveComments": ["+1", "LGTM"], 6 | "numApprovers": 1, 7 | "users": [ 8 | { 9 | "github": "matsushita-kentaro", 10 | "slack": "kentaro" 11 | }, 12 | { 13 | "github": "kentaro-m", 14 | "slack": "kentaro" 15 | } 16 | ], 17 | "message": { 18 | "requestReview": "Please review this pull request.", 19 | "ableToMerge": "Able to merge this pull request.", 20 | "mentionComment": "Please check this review comment." 21 | }, 22 | "labels": { 23 | "wip": { 24 | "name": "wip", 25 | "color": "efb85f" 26 | } 27 | }, 28 | "workInProgress": true, 29 | "assignReviewers": true, 30 | "requestReview": true, 31 | "ableToMerge": true, 32 | "mentionComment": true 33 | } 34 | -------------------------------------------------------------------------------- /config/test.json: -------------------------------------------------------------------------------- 1 | { 2 | "host": "", 3 | "pathPrefix": "", 4 | "reviewers": ["matsushita-kentaro"], 5 | "approveComments": ["+1", "LGTM"], 6 | "numApprovers": 1, 7 | "users": [ 8 | { 9 | "github": "matsushita-kentaro", 10 | "slack": "kentaro" 11 | }, 12 | { 13 | "github": "kentaro-m", 14 | "slack": "kentaro" 15 | } 16 | ], 17 | "message": { 18 | "requestReview": "Please review this pull request.", 19 | "ableToMerge": "Able to merge this pull request.", 20 | "mentionComment": "Please check this review comment." 21 | }, 22 | "labels": { 23 | "wip": { 24 | "name": "wip", 25 | "color": "efb85f" 26 | } 27 | }, 28 | "workInProgress": true, 29 | "assignReviewers": true, 30 | "requestReview": true, 31 | "ableToMerge": true, 32 | "mentionComment": true 33 | } 34 | -------------------------------------------------------------------------------- /demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentaro-m/lambda-pr-notify-bot/5cb57d9aecfd9e8b183148409269fc86bf45b388/demo.png -------------------------------------------------------------------------------- /images/assign_to_reviewer.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentaro-m/lambda-pr-notify-bot/5cb57d9aecfd9e8b183148409269fc86bf45b388/images/assign_to_reviewer.gif -------------------------------------------------------------------------------- /images/check_review_comment.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentaro-m/lambda-pr-notify-bot/5cb57d9aecfd9e8b183148409269fc86bf45b388/images/check_review_comment.gif -------------------------------------------------------------------------------- /images/notify_to_slack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentaro-m/lambda-pr-notify-bot/5cb57d9aecfd9e8b183148409269fc86bf45b388/images/notify_to_slack.png -------------------------------------------------------------------------------- /images/wip.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kentaro-m/lambda-pr-notify-bot/5cb57d9aecfd9e8b183148409269fc86bf45b388/images/wip.gif -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lambda-pr-notify-bot", 3 | "version": "0.1.0", 4 | "description": "A slackbot that reminds reviewers to review their pull requests.", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "NODE_ENV=test nyc --reporter=lcov --reporter=text mocha --require @babel/register --reporter spec test/**/*.spec.js", 8 | "package": "babel ./src/ -d ./dist/" 9 | }, 10 | "author": "Kentaro Matsushita", 11 | "license": "MIT", 12 | "dependencies": { 13 | "@octokit/rest": "^14.0.8", 14 | "@slack/client": "^3.10.0", 15 | "bluebird": "^3.5.0", 16 | "config": "^1.26.1", 17 | "crypto": "0.0.3" 18 | }, 19 | "devDependencies": { 20 | "@babel/cli": "^7.0.0-beta.39", 21 | "@babel/core": "^7.0.0-beta.39", 22 | "@babel/preset-env": "^7.0.0-beta.39", 23 | "@babel/register": "^7.0.0-beta.39", 24 | "chai": "^4.1.2", 25 | "eslint": "^4.3.0", 26 | "eslint-config-airbnb-base": "^11.3.1", 27 | "eslint-config-prettier": "^2.9.0", 28 | "eslint-plugin-import": "^2.7.0", 29 | "eslint-plugin-prettier": "^2.6.0", 30 | "mocha": "^4.0.1", 31 | "nyc": "^11.2.1", 32 | "prettier": "^1.10.2", 33 | "require-reload": "^0.2.2", 34 | "rewire": "^3.0.2", 35 | "sinon": "^4.0.1" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /pr-notify-bot-on-vpc.yml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: "2010-09-09" 2 | Transform: AWS::Serverless-2016-10-31 3 | Description: A slackbot that reminds reviewers to review their pull requests on AWS. 4 | Parameters: 5 | SecretToken: 6 | Description: A token for securing webhook. 7 | Type: String 8 | GitHubApiToken: 9 | Description: A token for calling GitHub API. 10 | Type: String 11 | SlackApiToken: 12 | Description: A token for calling Slack API. 13 | Type: String 14 | SecurityGroupIds: 15 | Description: The list of Security Group IDs for the HTTPS Access. 16 | Type: CommaDelimitedList 17 | PrivateSubnetIds: 18 | Description: The list of VPC Private Subnet IDs for running the Lambda Function. 19 | Type: CommaDelimitedList 20 | Resources: 21 | GitHubWebhook: 22 | Type: AWS::Serverless::Api 23 | Properties: 24 | StageName: prod 25 | DefinitionBody: 26 | swagger: 2.0 27 | info: 28 | title: GitHub webhook 29 | description: GitHub webhook 30 | version: 0.1.0 31 | schemes: 32 | - https 33 | basePath: "/" 34 | paths: 35 | /webhook: 36 | post: 37 | consumes: 38 | - "application/json" 39 | produces: 40 | - "application/json" 41 | responses: 42 | "200": 43 | description: "200 response" 44 | schema: 45 | $ref: "#/definitions/Empty" 46 | x-amazon-apigateway-integration: 47 | responses: 48 | default: 49 | statusCode: "200" 50 | requestTemplates: 51 | application/json: | 52 | { 53 | "body" : $input.json('$'), 54 | "headers": { 55 | #foreach($header in $input.params().header.keySet()) 56 | "$header": "$util.escapeJavaScript($input.params().header.get($header))" #if($foreach.hasNext),#end 57 | #end 58 | }, 59 | "method": "$context.httpMethod", 60 | "params": { 61 | #foreach($param in $input.params().path.keySet()) 62 | "$param": "$util.escapeJavaScript($input.params().path.get($param))" #if($foreach.hasNext),#end 63 | #end 64 | }, 65 | "query": { 66 | #foreach($queryParam in $input.params().querystring.keySet()) 67 | "$queryParam": "$util.escapeJavaScript($input.params().querystring.get($queryParam))" #if($foreach.hasNext),#end 68 | #end 69 | } 70 | } 71 | passthroughBehavior: when_no_templates 72 | httpMethod: POST 73 | type: aws 74 | uri: 75 | Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${PrNotifyBot.Arn}/invocations 76 | definitions: 77 | Empty: 78 | type: "object" 79 | title: "Empty Schema" 80 | 81 | PrNotifyBot: 82 | Type: AWS::Serverless::Function 83 | Properties: 84 | Handler: dist/index.handler 85 | Runtime: nodejs6.10 86 | Description: A slackbot that reminds reviewers to review their pull requests on AWS. 87 | MemorySize: 128 88 | Timeout: 10 89 | Policies: AWSLambdaVPCAccessExecutionRole 90 | VpcConfig: 91 | SecurityGroupIds: !Ref SecurityGroupIds 92 | SubnetIds: !Ref PrivateSubnetIds 93 | Environment: 94 | Variables: 95 | SECRET_TOKEN: !Ref SecretToken 96 | GITHUB_API_TOKEN: !Ref GitHubApiToken 97 | SLACK_API_TOKEN: !Ref SlackApiToken 98 | Events: 99 | Webhook: 100 | Type: Api 101 | Properties: 102 | Path: /webhook 103 | Method: post 104 | RestApiId: 105 | Ref: GitHubWebhook 106 | 107 | Outputs: 108 | ApiUrl: 109 | Value: !Sub https://${GitHubWebhook}.execute-api.${AWS::Region}.amazonaws.com/prod/webhook 110 | -------------------------------------------------------------------------------- /pr-notify-bot.yml: -------------------------------------------------------------------------------- 1 | AWSTemplateFormatVersion: "2010-09-09" 2 | Transform: AWS::Serverless-2016-10-31 3 | Description: A slackbot that reminds reviewers to review their pull requests on AWS. 4 | Parameters: 5 | SecretToken: 6 | Description: A token for securing webhook. 7 | Type: String 8 | GitHubApiToken: 9 | Description: A token for calling GitHub API. 10 | Type: String 11 | SlackApiToken: 12 | Description: A token for calling Slack API. 13 | Type: String 14 | Resources: 15 | GitHubWebhook: 16 | Type: AWS::Serverless::Api 17 | Properties: 18 | StageName: prod 19 | DefinitionBody: 20 | swagger: 2.0 21 | info: 22 | title: GitHub webhook 23 | description: GitHub webhook 24 | version: 0.1.0 25 | schemes: 26 | - https 27 | basePath: "/" 28 | paths: 29 | /webhook: 30 | post: 31 | consumes: 32 | - "application/json" 33 | produces: 34 | - "application/json" 35 | responses: 36 | "200": 37 | description: "200 response" 38 | schema: 39 | $ref: "#/definitions/Empty" 40 | x-amazon-apigateway-integration: 41 | responses: 42 | default: 43 | statusCode: "200" 44 | requestTemplates: 45 | application/json: | 46 | { 47 | "body" : $input.json('$'), 48 | "headers": { 49 | #foreach($header in $input.params().header.keySet()) 50 | "$header": "$util.escapeJavaScript($input.params().header.get($header))" #if($foreach.hasNext),#end 51 | #end 52 | }, 53 | "method": "$context.httpMethod", 54 | "params": { 55 | #foreach($param in $input.params().path.keySet()) 56 | "$param": "$util.escapeJavaScript($input.params().path.get($param))" #if($foreach.hasNext),#end 57 | #end 58 | }, 59 | "query": { 60 | #foreach($queryParam in $input.params().querystring.keySet()) 61 | "$queryParam": "$util.escapeJavaScript($input.params().querystring.get($queryParam))" #if($foreach.hasNext),#end 62 | #end 63 | } 64 | } 65 | passthroughBehavior: when_no_templates 66 | httpMethod: POST 67 | type: aws 68 | uri: 69 | Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${PrNotifyBot.Arn}/invocations 70 | definitions: 71 | Empty: 72 | type: "object" 73 | title: "Empty Schema" 74 | 75 | PrNotifyBot: 76 | Type: AWS::Serverless::Function 77 | Properties: 78 | Handler: dist/index.handler 79 | Runtime: nodejs6.10 80 | Description: A slackbot that reminds reviewers to review their pull requests on AWS. 81 | MemorySize: 128 82 | Timeout: 10 83 | Environment: 84 | Variables: 85 | SECRET_TOKEN: !Ref SecretToken 86 | GITHUB_API_TOKEN: !Ref GitHubApiToken 87 | SLACK_API_TOKEN: !Ref SlackApiToken 88 | Events: 89 | Webhook: 90 | Type: Api 91 | Properties: 92 | Path: /webhook 93 | Method: post 94 | RestApiId: 95 | Ref: GitHubWebhook 96 | 97 | Outputs: 98 | ApiUrl: 99 | Value: !Sub https://${GitHubWebhook}.execute-api.${AWS::Region}.amazonaws.com/prod/webhook 100 | -------------------------------------------------------------------------------- /src/handler.js: -------------------------------------------------------------------------------- 1 | import config from 'config'; 2 | import PullRequest from './pull_request'; 3 | import Slack from './slack'; 4 | import getNotifyUserInfo from './utils'; 5 | 6 | const GITHUB_API_TOKEN = process.env.GITHUB_API_TOKEN || ''; 7 | const SLACK_API_TOKEN = process.env.SLACK_API_TOKEN || ''; 8 | 9 | const options = { 10 | debug: true, 11 | protocol: 'https', 12 | port: 443, 13 | host: 'api.github.com', 14 | pathPrefix: '', 15 | headers: { 16 | 'user-agent': 'PR-Bot', 17 | }, 18 | timeout: 10000, 19 | }; 20 | 21 | if (config.host) { 22 | options.host = config.host; 23 | } 24 | 25 | if (config.pathPrefix) { 26 | options.pathPrefix = config.pathPrefix; 27 | } 28 | 29 | export async function handlePullRequestEvent(payload, callback) { 30 | try { 31 | const action = payload.action; 32 | const number = payload.number; 33 | const repo = payload.repository.name; 34 | const owner = payload.repository.owner.login; 35 | const author = payload.pull_request.user.login; 36 | const title = payload.pull_request.title; 37 | 38 | const pr = new PullRequest(options, GITHUB_API_TOKEN); 39 | 40 | if (action === 'opened') { 41 | const isWip = title.toLowerCase().includes('wip'); 42 | 43 | if (isWip && config.workInProgress) { 44 | await pr.addLabel( 45 | owner, 46 | repo, 47 | number, 48 | config.labels.wip.name, 49 | config.labels.wip.color 50 | ); 51 | } else { 52 | const reviewers = config.reviewers.filter( 53 | reviewer => author !== reviewer 54 | ); 55 | 56 | if (config.requestReview) { 57 | await pr.requestReview(owner, repo, number, reviewers); 58 | } 59 | 60 | if (config.assignReviewers) { 61 | await pr.assignReviewers(owner, repo, number, reviewers); 62 | } 63 | 64 | if (config.requestReview === true || config.assignReviewers === true) { 65 | const slack = new Slack(SLACK_API_TOKEN); 66 | reviewers.forEach(async reviewer => { 67 | const message = Slack.buildMessage( 68 | payload, 69 | config.message.requestReview, 70 | 'requestReview' 71 | ); 72 | 73 | const notifyUserInfo = getNotifyUserInfo( 74 | reviewer, 75 | config.users 76 | ); 77 | await slack.postMessage(notifyUserInfo.slack, message); 78 | }); 79 | } 80 | } 81 | } else if (action === 'unlabeled') { 82 | const isWipUnlabeled = payload.label.name === config.labels.wip.name; 83 | 84 | if (isWipUnlabeled && config.workInProgress) { 85 | const reviewers = config.reviewers.filter( 86 | reviewer => author !== reviewer 87 | ); 88 | 89 | if (config.requestReview) { 90 | await pr.requestReview(owner, repo, number, reviewers); 91 | } 92 | 93 | if (config.assignReviewers) { 94 | await pr.assignReviewers(owner, repo, number, reviewers); 95 | } 96 | 97 | if (config.requestReview === true || config.assignReviewers === true) { 98 | const slack = new Slack(SLACK_API_TOKEN); 99 | reviewers.forEach(async reviewer => { 100 | const message = Slack.buildMessage( 101 | payload, 102 | config.message.requestReview, 103 | 'requestReview' 104 | ); 105 | 106 | const notifyUserInfo = getNotifyUserInfo( 107 | reviewer, 108 | config.users 109 | ); 110 | await slack.postMessage(notifyUserInfo.slack, message); 111 | }); 112 | } 113 | } 114 | } 115 | } catch (error) { 116 | callback(new Error(error.message)); 117 | } 118 | 119 | callback(null, { 120 | message: 'Pull request event processing has been completed', 121 | }); 122 | } 123 | 124 | export async function handlePullRequestReviewEvent(payload, callback) { 125 | try { 126 | const number = payload.pull_request.number; 127 | const repo = payload.repository.name; 128 | const owner = payload.repository.owner.login; 129 | const user = payload.pull_request.user.login; 130 | 131 | const slack = new Slack(SLACK_API_TOKEN); 132 | 133 | if (config.ableToMerge) { 134 | const pr = new PullRequest(options, GITHUB_API_TOKEN); 135 | const reviewComments = await pr.getReviewComments(owner, repo, number); 136 | const approveComments = PullRequest.getApproveComments( 137 | reviewComments, 138 | config.approveComments 139 | ); 140 | 141 | if (approveComments.length === config.numApprovers) { 142 | const message = Slack.buildMessage( 143 | payload, 144 | config.message.ableToMerge, 145 | 'ableToMerge' 146 | ); 147 | 148 | const notifyUserInfo = getNotifyUserInfo( 149 | user, 150 | config.users 151 | ); 152 | 153 | await slack.postMessage(notifyUserInfo.slack, message); 154 | } 155 | } 156 | 157 | if (config.mentionComment) { 158 | const comment = PullRequest.parseMentionComment(payload.review.body); 159 | comment.mentionUsers.forEach(async mentionUser => { 160 | const message = Slack.buildMessage( 161 | payload, 162 | config.message.mentionComment, 163 | 'mentionComment' 164 | ); 165 | 166 | const notifyUserInfo = getNotifyUserInfo( 167 | mentionUser, 168 | config.users 169 | ); 170 | 171 | await slack.postMessage(notifyUserInfo.slack, message); 172 | }); 173 | } 174 | } catch (error) { 175 | callback(new Error(error.message)); 176 | } 177 | 178 | callback(null, { 179 | message: 'Pull request review event processing has been completed', 180 | }); 181 | } 182 | 183 | export async function handleIssueEvent(payload, callback) { 184 | try { 185 | const action = payload.action; 186 | const slack = new Slack(SLACK_API_TOKEN); 187 | 188 | if (action === 'created') { 189 | if (config.mentionComment) { 190 | const comment = PullRequest.parseMentionComment(payload.comment.body); 191 | comment.mentionUsers.forEach(async mentionUser => { 192 | const message = Slack.buildMessage( 193 | payload, 194 | config.message.mentionComment, 195 | 'mentionComment' 196 | ); 197 | 198 | const notifyUserInfo = getNotifyUserInfo( 199 | mentionUser, 200 | config.users 201 | ); 202 | 203 | await slack.postMessage(notifyUserInfo.slack, message); 204 | }); 205 | } 206 | } 207 | } catch (error) { 208 | callback(new Error(error.message)); 209 | } 210 | 211 | callback(null, { message: 'Issue event processing has been completed' }); 212 | } 213 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import crypto from 'crypto'; 2 | import { 3 | handlePullRequestEvent, 4 | handlePullRequestReviewEvent, 5 | handleIssueEvent, 6 | } from './handler'; 7 | 8 | const SECRET_TOKEN = process.env.SECRET_TOKEN || ''; 9 | const GITHUB_API_TOKEN = process.env.GITHUB_API_TOKEN || ''; 10 | const SLACK_API_TOKEN = process.env.SLACK_API_TOKEN || ''; 11 | 12 | function calculateSignature(secret, payload) { 13 | return `sha1=${crypto 14 | .createHmac('sha1', secret) 15 | .update(payload, 'utf-8') 16 | .digest('hex')}`; 17 | } 18 | 19 | function validateSignature(githubSignature, calculatedSignature) { 20 | return githubSignature === calculatedSignature; 21 | } 22 | 23 | exports.handler = async (event, context, callback) => { 24 | const githubEvent = event.headers['X-GitHub-Event']; 25 | const signature = event.headers['X-Hub-Signature']; 26 | const payload = event.body; 27 | 28 | if (!SECRET_TOKEN) { 29 | callback(new Error('Secret Token is not found.')); 30 | } 31 | 32 | if (!SLACK_API_TOKEN) { 33 | callback(new Error('Slack API Token is not found.')); 34 | } 35 | 36 | if (!GITHUB_API_TOKEN) { 37 | callback(new Error('GitHub API Token is not found.')); 38 | } 39 | 40 | const calculatedSignature = calculateSignature( 41 | SECRET_TOKEN, 42 | JSON.stringify(payload) 43 | ); 44 | 45 | const isValid = validateSignature(signature, calculatedSignature); 46 | if (!isValid) { 47 | callback( 48 | new Error('X-Hub-Signature and Calculated Signature do not match.') 49 | ); 50 | } 51 | 52 | if (githubEvent === 'pull_request') { 53 | await handlePullRequestEvent(payload, callback); 54 | } else if (githubEvent === 'pull_request_review') { 55 | await handlePullRequestReviewEvent(payload, callback); 56 | } else if (githubEvent === 'issue_comment') { 57 | await handleIssueEvent(payload, callback); 58 | } 59 | 60 | callback(null, { message: `event of type ${githubEvent} was ignored.` }); 61 | }; 62 | -------------------------------------------------------------------------------- /src/pull_request.js: -------------------------------------------------------------------------------- 1 | 'use struct'; 2 | 3 | import GitHubApi from '@octokit/rest'; 4 | 5 | export default class PullRequest { 6 | constructor(options, token) { 7 | this.github = new GitHubApi(options); 8 | this.github.authenticate({ 9 | type: 'token', 10 | token, 11 | }); 12 | } 13 | 14 | async requestReview(owner, repo, number, reviewers) { 15 | try { 16 | await this.github.pullRequests.createReviewRequest({ 17 | owner, 18 | repo, 19 | number, 20 | reviewers, 21 | }); 22 | } catch (error) { 23 | throw new Error(error.message); 24 | } 25 | } 26 | 27 | async assignReviewers(owner, repo, number, assignees) { 28 | try { 29 | await this.github.issues.edit({ 30 | owner, 31 | repo, 32 | number, 33 | assignees, 34 | }); 35 | } catch (error) { 36 | throw new Error(error.message); 37 | } 38 | } 39 | 40 | async getReviewComments(owner, repo, number) { 41 | try { 42 | const comments = await this.github.pullRequests.getReviews({ 43 | owner, 44 | repo, 45 | number, 46 | }); 47 | 48 | return comments; 49 | } catch (error) { 50 | throw new Error(error.message); 51 | } 52 | } 53 | 54 | static getApproveComments(reviewComments, approveComments) { 55 | const results = []; 56 | const reviewCommentIDs = []; 57 | 58 | reviewComments.data.map(reviewComment => { 59 | approveComments.forEach(approveComment => { 60 | if (!reviewCommentIDs.includes(reviewComment.id)) { 61 | if ( 62 | reviewComment.body === approveComment || 63 | reviewComment.state === 'APPROVED' 64 | ) 65 | results.push(reviewComment); 66 | reviewCommentIDs.push(reviewComment.id); 67 | } 68 | }); 69 | }); 70 | 71 | return results; 72 | } 73 | 74 | static parseMentionComment(body) { 75 | const matches = body.match(/@([a-zA-Z0-9_-]+)/g); 76 | 77 | if (matches === null) { 78 | return { 79 | mentionUsers: [], 80 | }; 81 | } 82 | 83 | const mentionUsers = matches.map(match => match.slice(1)); 84 | 85 | const results = { 86 | mentionUsers: mentionUsers || [], 87 | }; 88 | 89 | return results; 90 | } 91 | 92 | async addLabel(owner, repo, number, labelName, labelColor) { 93 | try { 94 | const labels = await this.github.issues.getLabels({ owner, repo }); 95 | const filteredLabels = labels.data.filter(label => 96 | label.name.includes(labelName) 97 | ); 98 | const labelExists = filteredLabels.length > 0; 99 | 100 | if (!labelExists) { 101 | await this.github.issues.createLabel({ 102 | owner, 103 | repo, 104 | name: labelName, 105 | color: labelColor, 106 | }); 107 | } 108 | 109 | await this.github.issues.addLabels({ 110 | owner, 111 | repo, 112 | number, 113 | labels: [labelName], 114 | }); 115 | } catch (error) { 116 | throw new Error(error.message); 117 | } 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /src/slack.js: -------------------------------------------------------------------------------- 1 | 'use struct'; 2 | 3 | import { WebClient } from '@slack/client'; 4 | 5 | export default class Slack { 6 | constructor(token) { 7 | this.web = new WebClient(token); 8 | } 9 | 10 | async postMessage(user, attachments) { 11 | try { 12 | const channel = `@${user}`; 13 | this.web.chat.postMessage(channel, '', { attachments }); 14 | } catch (error) { 15 | throw new Error(error.message); 16 | } 17 | } 18 | 19 | static buildMessage(payload, message, type = '') { 20 | const eventType = Object.prototype.hasOwnProperty.call(payload, 'issue') 21 | ? 'issue' 22 | : 'pull_request'; 23 | const user = payload[`${eventType}`].user; 24 | const title = payload[`${eventType}`].title; 25 | const titleLink = payload[`${eventType}`].html_url; 26 | 27 | const attachments = [ 28 | { 29 | color: '#36a64f', 30 | author_name: `${user.login} (${payload.repository.name})`, 31 | author_icon: user.avatar_url, 32 | title, 33 | title_link: titleLink, 34 | text: message, 35 | }, 36 | ]; 37 | 38 | if (type === 'assignReviewers' || type === 'requestReview') { 39 | attachments[0].color = 'warning'; 40 | attachments[0].text = `:eyes: ${message}`; 41 | } 42 | 43 | if (type === 'ableToMerge') { 44 | attachments[0].text = `:white_check_mark: ${message}`; 45 | } 46 | 47 | if (type === 'mentionComment') { 48 | attachments[0].color = 'warning'; 49 | attachments[0].text = `:eyes: ${message}`; 50 | 51 | const commentType = Object.prototype.hasOwnProperty.call(payload, 'issue') 52 | ? 'comment' 53 | : 'review'; 54 | attachments[0].title_link = payload[`${commentType}`].html_url; 55 | attachments[0].fields = [ 56 | { 57 | title: 'Comment', 58 | value: payload[`${commentType}`].body, 59 | short: true, 60 | }, 61 | ]; 62 | } 63 | 64 | return attachments; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/utils.js: -------------------------------------------------------------------------------- 1 | export default function getNotifyUserInfo(githubUser, users) { 2 | for (const user of users) { 3 | if (githubUser === user.github) { 4 | return user; 5 | } 6 | } 7 | return {}; 8 | } 9 | -------------------------------------------------------------------------------- /test/fixtures/mention_issue.json: -------------------------------------------------------------------------------- 1 | { 2 | "body": { 3 | "action": "created", 4 | "issue": { 5 | "url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/4", 6 | "repository_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test", 7 | "labels_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/4/labels{/name}", 8 | "comments_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/4/comments", 9 | "events_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/4/events", 10 | "html_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test/pull/4", 11 | "id": 280520340, 12 | "number": 4, 13 | "title": "Add a function for calculate a sum", 14 | "user": { 15 | "login": "kentaro-m", 16 | "id": 7448569, 17 | "avatar_url": "https://avatars0.githubusercontent.com/u/7448569?v=4", 18 | "gravatar_id": "", 19 | "url": "https://api.github.com/users/kentaro-m", 20 | "html_url": "https://github.com/kentaro-m", 21 | "followers_url": "https://api.github.com/users/kentaro-m/followers", 22 | "following_url": "https://api.github.com/users/kentaro-m/following{/other_user}", 23 | "gists_url": "https://api.github.com/users/kentaro-m/gists{/gist_id}", 24 | "starred_url": "https://api.github.com/users/kentaro-m/starred{/owner}{/repo}", 25 | "subscriptions_url": "https://api.github.com/users/kentaro-m/subscriptions", 26 | "organizations_url": "https://api.github.com/users/kentaro-m/orgs", 27 | "repos_url": "https://api.github.com/users/kentaro-m/repos", 28 | "events_url": "https://api.github.com/users/kentaro-m/events{/privacy}", 29 | "received_events_url": "https://api.github.com/users/kentaro-m/received_events", 30 | "type": "User", 31 | "site_admin": false 32 | }, 33 | "labels": [], 34 | "state": "open", 35 | "locked": false, 36 | "assignee": { 37 | "login": "matsushita-kentaro", 38 | "id": 21993807, 39 | "avatar_url": "https://avatars2.githubusercontent.com/u/21993807?v=4", 40 | "gravatar_id": "", 41 | "url": "https://api.github.com/users/matsushita-kentaro", 42 | "html_url": "https://github.com/matsushita-kentaro", 43 | "followers_url": "https://api.github.com/users/matsushita-kentaro/followers", 44 | "following_url": "https://api.github.com/users/matsushita-kentaro/following{/other_user}", 45 | "gists_url": "https://api.github.com/users/matsushita-kentaro/gists{/gist_id}", 46 | "starred_url": "https://api.github.com/users/matsushita-kentaro/starred{/owner}{/repo}", 47 | "subscriptions_url": "https://api.github.com/users/matsushita-kentaro/subscriptions", 48 | "organizations_url": "https://api.github.com/users/matsushita-kentaro/orgs", 49 | "repos_url": "https://api.github.com/users/matsushita-kentaro/repos", 50 | "events_url": "https://api.github.com/users/matsushita-kentaro/events{/privacy}", 51 | "received_events_url": "https://api.github.com/users/matsushita-kentaro/received_events", 52 | "type": "User", 53 | "site_admin": false 54 | }, 55 | "assignees": [ 56 | { 57 | "login": "matsushita-kentaro", 58 | "id": 21993807, 59 | "avatar_url": "https://avatars2.githubusercontent.com/u/21993807?v=4", 60 | "gravatar_id": "", 61 | "url": "https://api.github.com/users/matsushita-kentaro", 62 | "html_url": "https://github.com/matsushita-kentaro", 63 | "followers_url": "https://api.github.com/users/matsushita-kentaro/followers", 64 | "following_url": "https://api.github.com/users/matsushita-kentaro/following{/other_user}", 65 | "gists_url": "https://api.github.com/users/matsushita-kentaro/gists{/gist_id}", 66 | "starred_url": "https://api.github.com/users/matsushita-kentaro/starred{/owner}{/repo}", 67 | "subscriptions_url": "https://api.github.com/users/matsushita-kentaro/subscriptions", 68 | "organizations_url": "https://api.github.com/users/matsushita-kentaro/orgs", 69 | "repos_url": "https://api.github.com/users/matsushita-kentaro/repos", 70 | "events_url": "https://api.github.com/users/matsushita-kentaro/events{/privacy}", 71 | "received_events_url": "https://api.github.com/users/matsushita-kentaro/received_events", 72 | "type": "User", 73 | "site_admin": false 74 | } 75 | ], 76 | "milestone": null, 77 | "comments": 3, 78 | "created_at": "2017-12-08T15:14:56Z", 79 | "updated_at": "2017-12-08T18:09:26Z", 80 | "closed_at": null, 81 | "author_association": "OWNER", 82 | "pull_request": { 83 | "url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/4", 84 | "html_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test/pull/4", 85 | "diff_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test/pull/4.diff", 86 | "patch_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test/pull/4.patch" 87 | }, 88 | "body": "Add a function for calculate a sum" 89 | }, 90 | "comment": { 91 | "url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/comments/350332222", 92 | "html_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test/pull/4#issuecomment-350332222", 93 | "issue_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/4", 94 | "id": 350332222, 95 | "user": { 96 | "login": "matsushita-kentaro", 97 | "id": 21993807, 98 | "avatar_url": "https://avatars2.githubusercontent.com/u/21993807?v=4", 99 | "gravatar_id": "", 100 | "url": "https://api.github.com/users/matsushita-kentaro", 101 | "html_url": "https://github.com/matsushita-kentaro", 102 | "followers_url": "https://api.github.com/users/matsushita-kentaro/followers", 103 | "following_url": "https://api.github.com/users/matsushita-kentaro/following{/other_user}", 104 | "gists_url": "https://api.github.com/users/matsushita-kentaro/gists{/gist_id}", 105 | "starred_url": "https://api.github.com/users/matsushita-kentaro/starred{/owner}{/repo}", 106 | "subscriptions_url": "https://api.github.com/users/matsushita-kentaro/subscriptions", 107 | "organizations_url": "https://api.github.com/users/matsushita-kentaro/orgs", 108 | "repos_url": "https://api.github.com/users/matsushita-kentaro/repos", 109 | "events_url": "https://api.github.com/users/matsushita-kentaro/events{/privacy}", 110 | "received_events_url": "https://api.github.com/users/matsushita-kentaro/received_events", 111 | "type": "User", 112 | "site_admin": false 113 | }, 114 | "created_at": "2017-12-08T18:09:26Z", 115 | "updated_at": "2017-12-08T18:09:26Z", 116 | "author_association": "COLLABORATOR", 117 | "body": "@kentaro-m \r\nIssue Comment" 118 | }, 119 | "repository": { 120 | "id": 113575327, 121 | "name": "lambda-pr-notify-bot-test", 122 | "full_name": "kentaro-m/lambda-pr-notify-bot-test", 123 | "owner": { 124 | "login": "kentaro-m", 125 | "id": 7448569, 126 | "avatar_url": "https://avatars0.githubusercontent.com/u/7448569?v=4", 127 | "gravatar_id": "", 128 | "url": "https://api.github.com/users/kentaro-m", 129 | "html_url": "https://github.com/kentaro-m", 130 | "followers_url": "https://api.github.com/users/kentaro-m/followers", 131 | "following_url": "https://api.github.com/users/kentaro-m/following{/other_user}", 132 | "gists_url": "https://api.github.com/users/kentaro-m/gists{/gist_id}", 133 | "starred_url": "https://api.github.com/users/kentaro-m/starred{/owner}{/repo}", 134 | "subscriptions_url": "https://api.github.com/users/kentaro-m/subscriptions", 135 | "organizations_url": "https://api.github.com/users/kentaro-m/orgs", 136 | "repos_url": "https://api.github.com/users/kentaro-m/repos", 137 | "events_url": "https://api.github.com/users/kentaro-m/events{/privacy}", 138 | "received_events_url": "https://api.github.com/users/kentaro-m/received_events", 139 | "type": "User", 140 | "site_admin": false 141 | }, 142 | "private": false, 143 | "html_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test", 144 | "description": null, 145 | "fork": false, 146 | "url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test", 147 | "forks_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/forks", 148 | "keys_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/keys{/key_id}", 149 | "collaborators_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/collaborators{/collaborator}", 150 | "teams_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/teams", 151 | "hooks_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/hooks", 152 | "issue_events_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/events{/number}", 153 | "events_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/events", 154 | "assignees_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/assignees{/user}", 155 | "branches_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/branches{/branch}", 156 | "tags_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/tags", 157 | "blobs_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/blobs{/sha}", 158 | "git_tags_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/tags{/sha}", 159 | "git_refs_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/refs{/sha}", 160 | "trees_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/trees{/sha}", 161 | "statuses_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/statuses/{sha}", 162 | "languages_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/languages", 163 | "stargazers_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/stargazers", 164 | "contributors_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/contributors", 165 | "subscribers_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/subscribers", 166 | "subscription_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/subscription", 167 | "commits_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/commits{/sha}", 168 | "git_commits_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/commits{/sha}", 169 | "comments_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/comments{/number}", 170 | "issue_comment_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/comments{/number}", 171 | "contents_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/contents/{+path}", 172 | "compare_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/compare/{base}...{head}", 173 | "merges_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/merges", 174 | "archive_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/{archive_format}{/ref}", 175 | "downloads_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/downloads", 176 | "issues_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues{/number}", 177 | "pulls_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls{/number}", 178 | "milestones_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/milestones{/number}", 179 | "notifications_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/notifications{?since,all,participating}", 180 | "labels_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/labels{/name}", 181 | "releases_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/releases{/id}", 182 | "deployments_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/deployments", 183 | "created_at": "2017-12-08T13:06:20Z", 184 | "updated_at": "2017-12-08T13:06:20Z", 185 | "pushed_at": "2017-12-08T15:14:57Z", 186 | "git_url": "git://github.com/kentaro-m/lambda-pr-notify-bot-test.git", 187 | "ssh_url": "git@github.com:kentaro-m/lambda-pr-notify-bot-test.git", 188 | "clone_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test.git", 189 | "svn_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test", 190 | "homepage": null, 191 | "size": 1, 192 | "stargazers_count": 0, 193 | "watchers_count": 0, 194 | "language": null, 195 | "has_issues": true, 196 | "has_projects": true, 197 | "has_downloads": true, 198 | "has_wiki": true, 199 | "has_pages": false, 200 | "forks_count": 0, 201 | "mirror_url": null, 202 | "archived": false, 203 | "open_issues_count": 2, 204 | "license": null, 205 | "forks": 0, 206 | "open_issues": 2, 207 | "watchers": 0, 208 | "default_branch": "master" 209 | }, 210 | "sender": { 211 | "login": "matsushita-kentaro", 212 | "id": 21993807, 213 | "avatar_url": "https://avatars2.githubusercontent.com/u/21993807?v=4", 214 | "gravatar_id": "", 215 | "url": "https://api.github.com/users/matsushita-kentaro", 216 | "html_url": "https://github.com/matsushita-kentaro", 217 | "followers_url": "https://api.github.com/users/matsushita-kentaro/followers", 218 | "following_url": "https://api.github.com/users/matsushita-kentaro/following{/other_user}", 219 | "gists_url": "https://api.github.com/users/matsushita-kentaro/gists{/gist_id}", 220 | "starred_url": "https://api.github.com/users/matsushita-kentaro/starred{/owner}{/repo}", 221 | "subscriptions_url": "https://api.github.com/users/matsushita-kentaro/subscriptions", 222 | "organizations_url": "https://api.github.com/users/matsushita-kentaro/orgs", 223 | "repos_url": "https://api.github.com/users/matsushita-kentaro/repos", 224 | "events_url": "https://api.github.com/users/matsushita-kentaro/events{/privacy}", 225 | "received_events_url": "https://api.github.com/users/matsushita-kentaro/received_events", 226 | "type": "User", 227 | "site_admin": false 228 | } 229 | }, 230 | "headers": { 231 | "X-GitHub-Event": "issue_comment", 232 | "X-Hub-Signature": "sha1=39d2afe3e1d3341cac746a555915d3cfcdfeccab" 233 | }, 234 | "method": "POST", 235 | "params": {}, 236 | "query": {} 237 | } 238 | -------------------------------------------------------------------------------- /test/fixtures/mention_review.json: -------------------------------------------------------------------------------- 1 | { 2 | "body": { 3 | "action": "submitted", 4 | "review": { 5 | "id": 53072104, 6 | "user": { 7 | "login": "matsushita-kentaro", 8 | "id": 21993807, 9 | "avatar_url": "https://avatars2.githubusercontent.com/u/21993807?v=4", 10 | "gravatar_id": "", 11 | "url": "https://api.github.com/users/matsushita-kentaro", 12 | "html_url": "https://github.com/matsushita-kentaro", 13 | "followers_url": "https://api.github.com/users/matsushita-kentaro/followers", 14 | "following_url": "https://api.github.com/users/matsushita-kentaro/following{/other_user}", 15 | "gists_url": "https://api.github.com/users/matsushita-kentaro/gists{/gist_id}", 16 | "starred_url": "https://api.github.com/users/matsushita-kentaro/starred{/owner}{/repo}", 17 | "subscriptions_url": "https://api.github.com/users/matsushita-kentaro/subscriptions", 18 | "organizations_url": "https://api.github.com/users/matsushita-kentaro/orgs", 19 | "repos_url": "https://api.github.com/users/matsushita-kentaro/repos", 20 | "events_url": "https://api.github.com/users/matsushita-kentaro/events{/privacy}", 21 | "received_events_url": "https://api.github.com/users/matsushita-kentaro/received_events", 22 | "type": "User", 23 | "site_admin": false 24 | }, 25 | "body": "@kentaro-m \r\nReview Comment", 26 | "commit_id": "c79910b4916d754c6d6879ec5c49d453c5c30ac9", 27 | "submitted_at": "2017-07-29T08:08:57Z", 28 | "state": "commented", 29 | "html_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test/pull/18#pullrequestreview-53072104", 30 | "pull_request_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/18", 31 | "_links": { 32 | "html": { 33 | "href": "https://github.com/kentaro-m/lambda-pr-notify-bot-test/pull/18#pullrequestreview-53072104" 34 | }, 35 | "pull_request": { 36 | "href": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/18" 37 | } 38 | } 39 | }, 40 | "pull_request": { 41 | "url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/18", 42 | "id": 133079144, 43 | "html_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test/pull/18", 44 | "diff_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test/pull/18.diff", 45 | "patch_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test/pull/18.patch", 46 | "issue_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/18", 47 | "number": 18, 48 | "state": "open", 49 | "locked": false, 50 | "title": "bot test 3", 51 | "user": { 52 | "login": "kentaro-m", 53 | "id": 7448569, 54 | "avatar_url": "https://avatars0.githubusercontent.com/u/7448569?v=4", 55 | "gravatar_id": "", 56 | "url": "https://api.github.com/users/kentaro-m", 57 | "html_url": "https://github.com/kentaro-m", 58 | "followers_url": "https://api.github.com/users/kentaro-m/followers", 59 | "following_url": "https://api.github.com/users/kentaro-m/following{/other_user}", 60 | "gists_url": "https://api.github.com/users/kentaro-m/gists{/gist_id}", 61 | "starred_url": "https://api.github.com/users/kentaro-m/starred{/owner}{/repo}", 62 | "subscriptions_url": "https://api.github.com/users/kentaro-m/subscriptions", 63 | "organizations_url": "https://api.github.com/users/kentaro-m/orgs", 64 | "repos_url": "https://api.github.com/users/kentaro-m/repos", 65 | "events_url": "https://api.github.com/users/kentaro-m/events{/privacy}", 66 | "received_events_url": "https://api.github.com/users/kentaro-m/received_events", 67 | "type": "User", 68 | "site_admin": false 69 | }, 70 | "body": "", 71 | "created_at": "2017-07-29T04:00:21Z", 72 | "updated_at": "2017-07-29T08:08:57Z", 73 | "closed_at": null, 74 | "merged_at": null, 75 | "merge_commit_sha": "49894de6dc0b941b5f5b029de37e013f2a1c1264", 76 | "assignee": { 77 | "login": "matsushita-kentaro", 78 | "id": 21993807, 79 | "avatar_url": "https://avatars2.githubusercontent.com/u/21993807?v=4", 80 | "gravatar_id": "", 81 | "url": "https://api.github.com/users/matsushita-kentaro", 82 | "html_url": "https://github.com/matsushita-kentaro", 83 | "followers_url": "https://api.github.com/users/matsushita-kentaro/followers", 84 | "following_url": "https://api.github.com/users/matsushita-kentaro/following{/other_user}", 85 | "gists_url": "https://api.github.com/users/matsushita-kentaro/gists{/gist_id}", 86 | "starred_url": "https://api.github.com/users/matsushita-kentaro/starred{/owner}{/repo}", 87 | "subscriptions_url": "https://api.github.com/users/matsushita-kentaro/subscriptions", 88 | "organizations_url": "https://api.github.com/users/matsushita-kentaro/orgs", 89 | "repos_url": "https://api.github.com/users/matsushita-kentaro/repos", 90 | "events_url": "https://api.github.com/users/matsushita-kentaro/events{/privacy}", 91 | "received_events_url": "https://api.github.com/users/matsushita-kentaro/received_events", 92 | "type": "User", 93 | "site_admin": false 94 | }, 95 | "assignees": [ 96 | { 97 | "login": "matsushita-kentaro", 98 | "id": 21993807, 99 | "avatar_url": "https://avatars2.githubusercontent.com/u/21993807?v=4", 100 | "gravatar_id": "", 101 | "url": "https://api.github.com/users/matsushita-kentaro", 102 | "html_url": "https://github.com/matsushita-kentaro", 103 | "followers_url": "https://api.github.com/users/matsushita-kentaro/followers", 104 | "following_url": "https://api.github.com/users/matsushita-kentaro/following{/other_user}", 105 | "gists_url": "https://api.github.com/users/matsushita-kentaro/gists{/gist_id}", 106 | "starred_url": "https://api.github.com/users/matsushita-kentaro/starred{/owner}{/repo}", 107 | "subscriptions_url": "https://api.github.com/users/matsushita-kentaro/subscriptions", 108 | "organizations_url": "https://api.github.com/users/matsushita-kentaro/orgs", 109 | "repos_url": "https://api.github.com/users/matsushita-kentaro/repos", 110 | "events_url": "https://api.github.com/users/matsushita-kentaro/events{/privacy}", 111 | "received_events_url": "https://api.github.com/users/matsushita-kentaro/received_events", 112 | "type": "User", 113 | "site_admin": false 114 | } 115 | ], 116 | "requested_reviewers": [], 117 | "milestone": null, 118 | "commits_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/18/commits", 119 | "review_comments_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/18/comments", 120 | "review_comment_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/comments{/number}", 121 | "comments_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/18/comments", 122 | "statuses_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/statuses/c79910b4916d754c6d6879ec5c49d453c5c30ac9", 123 | "head": { 124 | "label": "kentaro-m:test", 125 | "ref": "test", 126 | "sha": "c79910b4916d754c6d6879ec5c49d453c5c30ac9", 127 | "user": { 128 | "login": "kentaro-m", 129 | "id": 7448569, 130 | "avatar_url": "https://avatars0.githubusercontent.com/u/7448569?v=4", 131 | "gravatar_id": "", 132 | "url": "https://api.github.com/users/kentaro-m", 133 | "html_url": "https://github.com/kentaro-m", 134 | "followers_url": "https://api.github.com/users/kentaro-m/followers", 135 | "following_url": "https://api.github.com/users/kentaro-m/following{/other_user}", 136 | "gists_url": "https://api.github.com/users/kentaro-m/gists{/gist_id}", 137 | "starred_url": "https://api.github.com/users/kentaro-m/starred{/owner}{/repo}", 138 | "subscriptions_url": "https://api.github.com/users/kentaro-m/subscriptions", 139 | "organizations_url": "https://api.github.com/users/kentaro-m/orgs", 140 | "repos_url": "https://api.github.com/users/kentaro-m/repos", 141 | "events_url": "https://api.github.com/users/kentaro-m/events{/privacy}", 142 | "received_events_url": "https://api.github.com/users/kentaro-m/received_events", 143 | "type": "User", 144 | "site_admin": false 145 | }, 146 | "repo": { 147 | "id": 96185263, 148 | "name": "lambda-pr-notify-bot-test", 149 | "full_name": "kentaro-m/lambda-pr-notify-bot-test", 150 | "owner": { 151 | "login": "kentaro-m", 152 | "id": 7448569, 153 | "avatar_url": "https://avatars0.githubusercontent.com/u/7448569?v=4", 154 | "gravatar_id": "", 155 | "url": "https://api.github.com/users/kentaro-m", 156 | "html_url": "https://github.com/kentaro-m", 157 | "followers_url": "https://api.github.com/users/kentaro-m/followers", 158 | "following_url": "https://api.github.com/users/kentaro-m/following{/other_user}", 159 | "gists_url": "https://api.github.com/users/kentaro-m/gists{/gist_id}", 160 | "starred_url": "https://api.github.com/users/kentaro-m/starred{/owner}{/repo}", 161 | "subscriptions_url": "https://api.github.com/users/kentaro-m/subscriptions", 162 | "organizations_url": "https://api.github.com/users/kentaro-m/orgs", 163 | "repos_url": "https://api.github.com/users/kentaro-m/repos", 164 | "events_url": "https://api.github.com/users/kentaro-m/events{/privacy}", 165 | "received_events_url": "https://api.github.com/users/kentaro-m/received_events", 166 | "type": "User", 167 | "site_admin": false 168 | }, 169 | "private": false, 170 | "html_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test", 171 | "description": null, 172 | "fork": false, 173 | "url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test", 174 | "forks_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/forks", 175 | "keys_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/keys{/key_id}", 176 | "collaborators_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/collaborators{/collaborator}", 177 | "teams_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/teams", 178 | "hooks_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/hooks", 179 | "issue_events_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/events{/number}", 180 | "events_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/events", 181 | "assignees_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/assignees{/user}", 182 | "branches_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/branches{/branch}", 183 | "tags_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/tags", 184 | "blobs_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/blobs{/sha}", 185 | "git_tags_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/tags{/sha}", 186 | "git_refs_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/refs{/sha}", 187 | "trees_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/trees{/sha}", 188 | "statuses_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/statuses/{sha}", 189 | "languages_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/languages", 190 | "stargazers_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/stargazers", 191 | "contributors_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/contributors", 192 | "subscribers_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/subscribers", 193 | "subscription_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/subscription", 194 | "commits_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/commits{/sha}", 195 | "git_commits_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/commits{/sha}", 196 | "comments_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/comments{/number}", 197 | "issue_comment_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/comments{/number}", 198 | "contents_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/contents/{+path}", 199 | "compare_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/compare/{base}...{head}", 200 | "merges_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/merges", 201 | "archive_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/{archive_format}{/ref}", 202 | "downloads_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/downloads", 203 | "issues_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues{/number}", 204 | "pulls_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls{/number}", 205 | "milestones_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/milestones{/number}", 206 | "notifications_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/notifications{?since,all,participating}", 207 | "labels_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/labels{/name}", 208 | "releases_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/releases{/id}", 209 | "deployments_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/deployments", 210 | "created_at": "2017-07-04T06:53:38Z", 211 | "updated_at": "2017-07-04T08:36:02Z", 212 | "pushed_at": "2017-07-29T04:00:21Z", 213 | "git_url": "git://github.com/kentaro-m/lambda-pr-notify-bot-test.git", 214 | "ssh_url": "git@github.com:kentaro-m/lambda-pr-notify-bot-test.git", 215 | "clone_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test.git", 216 | "svn_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test", 217 | "homepage": null, 218 | "size": 14, 219 | "stargazers_count": 0, 220 | "watchers_count": 0, 221 | "language": "Shell", 222 | "has_issues": true, 223 | "has_projects": true, 224 | "has_downloads": true, 225 | "has_wiki": true, 226 | "has_pages": false, 227 | "forks_count": 0, 228 | "mirror_url": null, 229 | "open_issues_count": 1, 230 | "forks": 0, 231 | "open_issues": 1, 232 | "watchers": 0, 233 | "default_branch": "master" 234 | } 235 | }, 236 | "base": { 237 | "label": "kentaro-m:master", 238 | "ref": "master", 239 | "sha": "4d8c17a8904bd65156437e784fded8336d5c0f92", 240 | "user": { 241 | "login": "kentaro-m", 242 | "id": 7448569, 243 | "avatar_url": "https://avatars0.githubusercontent.com/u/7448569?v=4", 244 | "gravatar_id": "", 245 | "url": "https://api.github.com/users/kentaro-m", 246 | "html_url": "https://github.com/kentaro-m", 247 | "followers_url": "https://api.github.com/users/kentaro-m/followers", 248 | "following_url": "https://api.github.com/users/kentaro-m/following{/other_user}", 249 | "gists_url": "https://api.github.com/users/kentaro-m/gists{/gist_id}", 250 | "starred_url": "https://api.github.com/users/kentaro-m/starred{/owner}{/repo}", 251 | "subscriptions_url": "https://api.github.com/users/kentaro-m/subscriptions", 252 | "organizations_url": "https://api.github.com/users/kentaro-m/orgs", 253 | "repos_url": "https://api.github.com/users/kentaro-m/repos", 254 | "events_url": "https://api.github.com/users/kentaro-m/events{/privacy}", 255 | "received_events_url": "https://api.github.com/users/kentaro-m/received_events", 256 | "type": "User", 257 | "site_admin": false 258 | }, 259 | "repo": { 260 | "id": 96185263, 261 | "name": "lambda-pr-notify-bot-test", 262 | "full_name": "kentaro-m/lambda-pr-notify-bot-test", 263 | "owner": { 264 | "login": "kentaro-m", 265 | "id": 7448569, 266 | "avatar_url": "https://avatars0.githubusercontent.com/u/7448569?v=4", 267 | "gravatar_id": "", 268 | "url": "https://api.github.com/users/kentaro-m", 269 | "html_url": "https://github.com/kentaro-m", 270 | "followers_url": "https://api.github.com/users/kentaro-m/followers", 271 | "following_url": "https://api.github.com/users/kentaro-m/following{/other_user}", 272 | "gists_url": "https://api.github.com/users/kentaro-m/gists{/gist_id}", 273 | "starred_url": "https://api.github.com/users/kentaro-m/starred{/owner}{/repo}", 274 | "subscriptions_url": "https://api.github.com/users/kentaro-m/subscriptions", 275 | "organizations_url": "https://api.github.com/users/kentaro-m/orgs", 276 | "repos_url": "https://api.github.com/users/kentaro-m/repos", 277 | "events_url": "https://api.github.com/users/kentaro-m/events{/privacy}", 278 | "received_events_url": "https://api.github.com/users/kentaro-m/received_events", 279 | "type": "User", 280 | "site_admin": false 281 | }, 282 | "private": false, 283 | "html_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test", 284 | "description": null, 285 | "fork": false, 286 | "url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test", 287 | "forks_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/forks", 288 | "keys_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/keys{/key_id}", 289 | "collaborators_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/collaborators{/collaborator}", 290 | "teams_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/teams", 291 | "hooks_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/hooks", 292 | "issue_events_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/events{/number}", 293 | "events_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/events", 294 | "assignees_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/assignees{/user}", 295 | "branches_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/branches{/branch}", 296 | "tags_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/tags", 297 | "blobs_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/blobs{/sha}", 298 | "git_tags_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/tags{/sha}", 299 | "git_refs_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/refs{/sha}", 300 | "trees_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/trees{/sha}", 301 | "statuses_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/statuses/{sha}", 302 | "languages_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/languages", 303 | "stargazers_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/stargazers", 304 | "contributors_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/contributors", 305 | "subscribers_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/subscribers", 306 | "subscription_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/subscription", 307 | "commits_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/commits{/sha}", 308 | "git_commits_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/commits{/sha}", 309 | "comments_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/comments{/number}", 310 | "issue_comment_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/comments{/number}", 311 | "contents_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/contents/{+path}", 312 | "compare_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/compare/{base}...{head}", 313 | "merges_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/merges", 314 | "archive_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/{archive_format}{/ref}", 315 | "downloads_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/downloads", 316 | "issues_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues{/number}", 317 | "pulls_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls{/number}", 318 | "milestones_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/milestones{/number}", 319 | "notifications_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/notifications{?since,all,participating}", 320 | "labels_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/labels{/name}", 321 | "releases_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/releases{/id}", 322 | "deployments_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/deployments", 323 | "created_at": "2017-07-04T06:53:38Z", 324 | "updated_at": "2017-07-04T08:36:02Z", 325 | "pushed_at": "2017-07-29T04:00:21Z", 326 | "git_url": "git://github.com/kentaro-m/lambda-pr-notify-bot-test.git", 327 | "ssh_url": "git@github.com:kentaro-m/lambda-pr-notify-bot-test.git", 328 | "clone_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test.git", 329 | "svn_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test", 330 | "homepage": null, 331 | "size": 14, 332 | "stargazers_count": 0, 333 | "watchers_count": 0, 334 | "language": "Shell", 335 | "has_issues": true, 336 | "has_projects": true, 337 | "has_downloads": true, 338 | "has_wiki": true, 339 | "has_pages": false, 340 | "forks_count": 0, 341 | "mirror_url": null, 342 | "open_issues_count": 1, 343 | "forks": 0, 344 | "open_issues": 1, 345 | "watchers": 0, 346 | "default_branch": "master" 347 | } 348 | }, 349 | "_links": { 350 | "self": { 351 | "href": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/18" 352 | }, 353 | "html": { 354 | "href": "https://github.com/kentaro-m/lambda-pr-notify-bot-test/pull/18" 355 | }, 356 | "issue": { 357 | "href": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/18" 358 | }, 359 | "comments": { 360 | "href": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/18/comments" 361 | }, 362 | "review_comments": { 363 | "href": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/18/comments" 364 | }, 365 | "review_comment": { 366 | "href": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/comments{/number}" 367 | }, 368 | "commits": { 369 | "href": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/18/commits" 370 | }, 371 | "statuses": { 372 | "href": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/statuses/c79910b4916d754c6d6879ec5c49d453c5c30ac9" 373 | } 374 | } 375 | }, 376 | "repository": { 377 | "id": 96185263, 378 | "name": "lambda-pr-notify-bot-test", 379 | "full_name": "kentaro-m/lambda-pr-notify-bot-test", 380 | "owner": { 381 | "login": "kentaro-m", 382 | "id": 7448569, 383 | "avatar_url": "https://avatars0.githubusercontent.com/u/7448569?v=4", 384 | "gravatar_id": "", 385 | "url": "https://api.github.com/users/kentaro-m", 386 | "html_url": "https://github.com/kentaro-m", 387 | "followers_url": "https://api.github.com/users/kentaro-m/followers", 388 | "following_url": "https://api.github.com/users/kentaro-m/following{/other_user}", 389 | "gists_url": "https://api.github.com/users/kentaro-m/gists{/gist_id}", 390 | "starred_url": "https://api.github.com/users/kentaro-m/starred{/owner}{/repo}", 391 | "subscriptions_url": "https://api.github.com/users/kentaro-m/subscriptions", 392 | "organizations_url": "https://api.github.com/users/kentaro-m/orgs", 393 | "repos_url": "https://api.github.com/users/kentaro-m/repos", 394 | "events_url": "https://api.github.com/users/kentaro-m/events{/privacy}", 395 | "received_events_url": "https://api.github.com/users/kentaro-m/received_events", 396 | "type": "User", 397 | "site_admin": false 398 | }, 399 | "private": false, 400 | "html_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test", 401 | "description": null, 402 | "fork": false, 403 | "url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test", 404 | "forks_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/forks", 405 | "keys_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/keys{/key_id}", 406 | "collaborators_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/collaborators{/collaborator}", 407 | "teams_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/teams", 408 | "hooks_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/hooks", 409 | "issue_events_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/events{/number}", 410 | "events_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/events", 411 | "assignees_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/assignees{/user}", 412 | "branches_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/branches{/branch}", 413 | "tags_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/tags", 414 | "blobs_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/blobs{/sha}", 415 | "git_tags_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/tags{/sha}", 416 | "git_refs_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/refs{/sha}", 417 | "trees_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/trees{/sha}", 418 | "statuses_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/statuses/{sha}", 419 | "languages_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/languages", 420 | "stargazers_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/stargazers", 421 | "contributors_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/contributors", 422 | "subscribers_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/subscribers", 423 | "subscription_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/subscription", 424 | "commits_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/commits{/sha}", 425 | "git_commits_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/commits{/sha}", 426 | "comments_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/comments{/number}", 427 | "issue_comment_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/comments{/number}", 428 | "contents_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/contents/{+path}", 429 | "compare_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/compare/{base}...{head}", 430 | "merges_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/merges", 431 | "archive_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/{archive_format}{/ref}", 432 | "downloads_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/downloads", 433 | "issues_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues{/number}", 434 | "pulls_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls{/number}", 435 | "milestones_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/milestones{/number}", 436 | "notifications_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/notifications{?since,all,participating}", 437 | "labels_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/labels{/name}", 438 | "releases_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/releases{/id}", 439 | "deployments_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/deployments", 440 | "created_at": "2017-07-04T06:53:38Z", 441 | "updated_at": "2017-07-04T08:36:02Z", 442 | "pushed_at": "2017-07-29T04:00:21Z", 443 | "git_url": "git://github.com/kentaro-m/lambda-pr-notify-bot-test.git", 444 | "ssh_url": "git@github.com:kentaro-m/lambda-pr-notify-bot-test.git", 445 | "clone_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test.git", 446 | "svn_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test", 447 | "homepage": null, 448 | "size": 14, 449 | "stargazers_count": 0, 450 | "watchers_count": 0, 451 | "language": "Shell", 452 | "has_issues": true, 453 | "has_projects": true, 454 | "has_downloads": true, 455 | "has_wiki": true, 456 | "has_pages": false, 457 | "forks_count": 0, 458 | "mirror_url": null, 459 | "open_issues_count": 1, 460 | "forks": 0, 461 | "open_issues": 1, 462 | "watchers": 0, 463 | "default_branch": "master" 464 | }, 465 | "sender": { 466 | "login": "matsushita-kentaro", 467 | "id": 21993807, 468 | "avatar_url": "https://avatars2.githubusercontent.com/u/21993807?v=4", 469 | "gravatar_id": "", 470 | "url": "https://api.github.com/users/matsushita-kentaro", 471 | "html_url": "https://github.com/matsushita-kentaro", 472 | "followers_url": "https://api.github.com/users/matsushita-kentaro/followers", 473 | "following_url": "https://api.github.com/users/matsushita-kentaro/following{/other_user}", 474 | "gists_url": "https://api.github.com/users/matsushita-kentaro/gists{/gist_id}", 475 | "starred_url": "https://api.github.com/users/matsushita-kentaro/starred{/owner}{/repo}", 476 | "subscriptions_url": "https://api.github.com/users/matsushita-kentaro/subscriptions", 477 | "organizations_url": "https://api.github.com/users/matsushita-kentaro/orgs", 478 | "repos_url": "https://api.github.com/users/matsushita-kentaro/repos", 479 | "events_url": "https://api.github.com/users/matsushita-kentaro/events{/privacy}", 480 | "received_events_url": "https://api.github.com/users/matsushita-kentaro/received_events", 481 | "type": "User", 482 | "site_admin": false 483 | } 484 | }, 485 | "headers": { 486 | "X-GitHub-Event": "pull_request_review", 487 | "X-Hub-Signature": "sha1=12990cdbdca73aa25c62bb29fc04247c896dd044" 488 | }, 489 | "method": "POST", 490 | "params": {}, 491 | "query": {} 492 | } 493 | -------------------------------------------------------------------------------- /test/fixtures/merge.json: -------------------------------------------------------------------------------- 1 | { 2 | "body": { 3 | "action": "submitted", 4 | "review": { 5 | "id": 53074631, 6 | "user": { 7 | "login": "matsushita-kentaro", 8 | "id": 21993807, 9 | "avatar_url": "https://avatars2.githubusercontent.com/u/21993807?v=4", 10 | "gravatar_id": "", 11 | "url": "https://api.github.com/users/matsushita-kentaro", 12 | "html_url": "https://github.com/matsushita-kentaro", 13 | "followers_url": "https://api.github.com/users/matsushita-kentaro/followers", 14 | "following_url": "https://api.github.com/users/matsushita-kentaro/following{/other_user}", 15 | "gists_url": "https://api.github.com/users/matsushita-kentaro/gists{/gist_id}", 16 | "starred_url": "https://api.github.com/users/matsushita-kentaro/starred{/owner}{/repo}", 17 | "subscriptions_url": "https://api.github.com/users/matsushita-kentaro/subscriptions", 18 | "organizations_url": "https://api.github.com/users/matsushita-kentaro/orgs", 19 | "repos_url": "https://api.github.com/users/matsushita-kentaro/repos", 20 | "events_url": "https://api.github.com/users/matsushita-kentaro/events{/privacy}", 21 | "received_events_url": "https://api.github.com/users/matsushita-kentaro/received_events", 22 | "type": "User", 23 | "site_admin": false 24 | }, 25 | "body": "+1", 26 | "commit_id": "c79910b4916d754c6d6879ec5c49d453c5c30ac9", 27 | "submitted_at": "2017-07-29T11:20:19Z", 28 | "state": "approved", 29 | "html_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test/pull/18#pullrequestreview-53074631", 30 | "pull_request_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/18", 31 | "_links": { 32 | "html": { 33 | "href": "https://github.com/kentaro-m/lambda-pr-notify-bot-test/pull/18#pullrequestreview-53074631" 34 | }, 35 | "pull_request": { 36 | "href": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/18" 37 | } 38 | } 39 | }, 40 | "pull_request": { 41 | "url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/18", 42 | "id": 133079144, 43 | "html_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test/pull/18", 44 | "diff_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test/pull/18.diff", 45 | "patch_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test/pull/18.patch", 46 | "issue_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/18", 47 | "number": 18, 48 | "state": "open", 49 | "locked": false, 50 | "title": "bot test 3", 51 | "user": { 52 | "login": "kentaro-m", 53 | "id": 7448569, 54 | "avatar_url": "https://avatars0.githubusercontent.com/u/7448569?v=4", 55 | "gravatar_id": "", 56 | "url": "https://api.github.com/users/kentaro-m", 57 | "html_url": "https://github.com/kentaro-m", 58 | "followers_url": "https://api.github.com/users/kentaro-m/followers", 59 | "following_url": "https://api.github.com/users/kentaro-m/following{/other_user}", 60 | "gists_url": "https://api.github.com/users/kentaro-m/gists{/gist_id}", 61 | "starred_url": "https://api.github.com/users/kentaro-m/starred{/owner}{/repo}", 62 | "subscriptions_url": "https://api.github.com/users/kentaro-m/subscriptions", 63 | "organizations_url": "https://api.github.com/users/kentaro-m/orgs", 64 | "repos_url": "https://api.github.com/users/kentaro-m/repos", 65 | "events_url": "https://api.github.com/users/kentaro-m/events{/privacy}", 66 | "received_events_url": "https://api.github.com/users/kentaro-m/received_events", 67 | "type": "User", 68 | "site_admin": false 69 | }, 70 | "body": "", 71 | "created_at": "2017-07-29T04:00:21Z", 72 | "updated_at": "2017-07-29T11:20:19Z", 73 | "closed_at": null, 74 | "merged_at": null, 75 | "merge_commit_sha": "49894de6dc0b941b5f5b029de37e013f2a1c1264", 76 | "assignee": { 77 | "login": "matsushita-kentaro", 78 | "id": 21993807, 79 | "avatar_url": "https://avatars2.githubusercontent.com/u/21993807?v=4", 80 | "gravatar_id": "", 81 | "url": "https://api.github.com/users/matsushita-kentaro", 82 | "html_url": "https://github.com/matsushita-kentaro", 83 | "followers_url": "https://api.github.com/users/matsushita-kentaro/followers", 84 | "following_url": "https://api.github.com/users/matsushita-kentaro/following{/other_user}", 85 | "gists_url": "https://api.github.com/users/matsushita-kentaro/gists{/gist_id}", 86 | "starred_url": "https://api.github.com/users/matsushita-kentaro/starred{/owner}{/repo}", 87 | "subscriptions_url": "https://api.github.com/users/matsushita-kentaro/subscriptions", 88 | "organizations_url": "https://api.github.com/users/matsushita-kentaro/orgs", 89 | "repos_url": "https://api.github.com/users/matsushita-kentaro/repos", 90 | "events_url": "https://api.github.com/users/matsushita-kentaro/events{/privacy}", 91 | "received_events_url": "https://api.github.com/users/matsushita-kentaro/received_events", 92 | "type": "User", 93 | "site_admin": false 94 | }, 95 | "assignees": [ 96 | { 97 | "login": "matsushita-kentaro", 98 | "id": 21993807, 99 | "avatar_url": "https://avatars2.githubusercontent.com/u/21993807?v=4", 100 | "gravatar_id": "", 101 | "url": "https://api.github.com/users/matsushita-kentaro", 102 | "html_url": "https://github.com/matsushita-kentaro", 103 | "followers_url": "https://api.github.com/users/matsushita-kentaro/followers", 104 | "following_url": "https://api.github.com/users/matsushita-kentaro/following{/other_user}", 105 | "gists_url": "https://api.github.com/users/matsushita-kentaro/gists{/gist_id}", 106 | "starred_url": "https://api.github.com/users/matsushita-kentaro/starred{/owner}{/repo}", 107 | "subscriptions_url": "https://api.github.com/users/matsushita-kentaro/subscriptions", 108 | "organizations_url": "https://api.github.com/users/matsushita-kentaro/orgs", 109 | "repos_url": "https://api.github.com/users/matsushita-kentaro/repos", 110 | "events_url": "https://api.github.com/users/matsushita-kentaro/events{/privacy}", 111 | "received_events_url": "https://api.github.com/users/matsushita-kentaro/received_events", 112 | "type": "User", 113 | "site_admin": false 114 | } 115 | ], 116 | "requested_reviewers": [], 117 | "milestone": null, 118 | "commits_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/18/commits", 119 | "review_comments_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/18/comments", 120 | "review_comment_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/comments{/number}", 121 | "comments_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/18/comments", 122 | "statuses_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/statuses/c79910b4916d754c6d6879ec5c49d453c5c30ac9", 123 | "head": { 124 | "label": "kentaro-m:test", 125 | "ref": "test", 126 | "sha": "c79910b4916d754c6d6879ec5c49d453c5c30ac9", 127 | "user": { 128 | "login": "kentaro-m", 129 | "id": 7448569, 130 | "avatar_url": "https://avatars0.githubusercontent.com/u/7448569?v=4", 131 | "gravatar_id": "", 132 | "url": "https://api.github.com/users/kentaro-m", 133 | "html_url": "https://github.com/kentaro-m", 134 | "followers_url": "https://api.github.com/users/kentaro-m/followers", 135 | "following_url": "https://api.github.com/users/kentaro-m/following{/other_user}", 136 | "gists_url": "https://api.github.com/users/kentaro-m/gists{/gist_id}", 137 | "starred_url": "https://api.github.com/users/kentaro-m/starred{/owner}{/repo}", 138 | "subscriptions_url": "https://api.github.com/users/kentaro-m/subscriptions", 139 | "organizations_url": "https://api.github.com/users/kentaro-m/orgs", 140 | "repos_url": "https://api.github.com/users/kentaro-m/repos", 141 | "events_url": "https://api.github.com/users/kentaro-m/events{/privacy}", 142 | "received_events_url": "https://api.github.com/users/kentaro-m/received_events", 143 | "type": "User", 144 | "site_admin": false 145 | }, 146 | "repo": { 147 | "id": 96185263, 148 | "name": "lambda-pr-notify-bot-test", 149 | "full_name": "kentaro-m/lambda-pr-notify-bot-test", 150 | "owner": { 151 | "login": "kentaro-m", 152 | "id": 7448569, 153 | "avatar_url": "https://avatars0.githubusercontent.com/u/7448569?v=4", 154 | "gravatar_id": "", 155 | "url": "https://api.github.com/users/kentaro-m", 156 | "html_url": "https://github.com/kentaro-m", 157 | "followers_url": "https://api.github.com/users/kentaro-m/followers", 158 | "following_url": "https://api.github.com/users/kentaro-m/following{/other_user}", 159 | "gists_url": "https://api.github.com/users/kentaro-m/gists{/gist_id}", 160 | "starred_url": "https://api.github.com/users/kentaro-m/starred{/owner}{/repo}", 161 | "subscriptions_url": "https://api.github.com/users/kentaro-m/subscriptions", 162 | "organizations_url": "https://api.github.com/users/kentaro-m/orgs", 163 | "repos_url": "https://api.github.com/users/kentaro-m/repos", 164 | "events_url": "https://api.github.com/users/kentaro-m/events{/privacy}", 165 | "received_events_url": "https://api.github.com/users/kentaro-m/received_events", 166 | "type": "User", 167 | "site_admin": false 168 | }, 169 | "private": false, 170 | "html_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test", 171 | "description": null, 172 | "fork": false, 173 | "url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test", 174 | "forks_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/forks", 175 | "keys_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/keys{/key_id}", 176 | "collaborators_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/collaborators{/collaborator}", 177 | "teams_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/teams", 178 | "hooks_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/hooks", 179 | "issue_events_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/events{/number}", 180 | "events_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/events", 181 | "assignees_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/assignees{/user}", 182 | "branches_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/branches{/branch}", 183 | "tags_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/tags", 184 | "blobs_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/blobs{/sha}", 185 | "git_tags_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/tags{/sha}", 186 | "git_refs_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/refs{/sha}", 187 | "trees_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/trees{/sha}", 188 | "statuses_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/statuses/{sha}", 189 | "languages_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/languages", 190 | "stargazers_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/stargazers", 191 | "contributors_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/contributors", 192 | "subscribers_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/subscribers", 193 | "subscription_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/subscription", 194 | "commits_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/commits{/sha}", 195 | "git_commits_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/commits{/sha}", 196 | "comments_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/comments{/number}", 197 | "issue_comment_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/comments{/number}", 198 | "contents_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/contents/{+path}", 199 | "compare_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/compare/{base}...{head}", 200 | "merges_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/merges", 201 | "archive_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/{archive_format}{/ref}", 202 | "downloads_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/downloads", 203 | "issues_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues{/number}", 204 | "pulls_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls{/number}", 205 | "milestones_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/milestones{/number}", 206 | "notifications_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/notifications{?since,all,participating}", 207 | "labels_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/labels{/name}", 208 | "releases_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/releases{/id}", 209 | "deployments_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/deployments", 210 | "created_at": "2017-07-04T06:53:38Z", 211 | "updated_at": "2017-07-04T08:36:02Z", 212 | "pushed_at": "2017-07-29T04:00:21Z", 213 | "git_url": "git://github.com/kentaro-m/lambda-pr-notify-bot-test.git", 214 | "ssh_url": "git@github.com:kentaro-m/lambda-pr-notify-bot-test.git", 215 | "clone_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test.git", 216 | "svn_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test", 217 | "homepage": null, 218 | "size": 14, 219 | "stargazers_count": 0, 220 | "watchers_count": 0, 221 | "language": "Shell", 222 | "has_issues": true, 223 | "has_projects": true, 224 | "has_downloads": true, 225 | "has_wiki": true, 226 | "has_pages": false, 227 | "forks_count": 0, 228 | "mirror_url": null, 229 | "open_issues_count": 1, 230 | "forks": 0, 231 | "open_issues": 1, 232 | "watchers": 0, 233 | "default_branch": "master" 234 | } 235 | }, 236 | "base": { 237 | "label": "kentaro-m:master", 238 | "ref": "master", 239 | "sha": "4d8c17a8904bd65156437e784fded8336d5c0f92", 240 | "user": { 241 | "login": "kentaro-m", 242 | "id": 7448569, 243 | "avatar_url": "https://avatars0.githubusercontent.com/u/7448569?v=4", 244 | "gravatar_id": "", 245 | "url": "https://api.github.com/users/kentaro-m", 246 | "html_url": "https://github.com/kentaro-m", 247 | "followers_url": "https://api.github.com/users/kentaro-m/followers", 248 | "following_url": "https://api.github.com/users/kentaro-m/following{/other_user}", 249 | "gists_url": "https://api.github.com/users/kentaro-m/gists{/gist_id}", 250 | "starred_url": "https://api.github.com/users/kentaro-m/starred{/owner}{/repo}", 251 | "subscriptions_url": "https://api.github.com/users/kentaro-m/subscriptions", 252 | "organizations_url": "https://api.github.com/users/kentaro-m/orgs", 253 | "repos_url": "https://api.github.com/users/kentaro-m/repos", 254 | "events_url": "https://api.github.com/users/kentaro-m/events{/privacy}", 255 | "received_events_url": "https://api.github.com/users/kentaro-m/received_events", 256 | "type": "User", 257 | "site_admin": false 258 | }, 259 | "repo": { 260 | "id": 96185263, 261 | "name": "lambda-pr-notify-bot-test", 262 | "full_name": "kentaro-m/lambda-pr-notify-bot-test", 263 | "owner": { 264 | "login": "kentaro-m", 265 | "id": 7448569, 266 | "avatar_url": "https://avatars0.githubusercontent.com/u/7448569?v=4", 267 | "gravatar_id": "", 268 | "url": "https://api.github.com/users/kentaro-m", 269 | "html_url": "https://github.com/kentaro-m", 270 | "followers_url": "https://api.github.com/users/kentaro-m/followers", 271 | "following_url": "https://api.github.com/users/kentaro-m/following{/other_user}", 272 | "gists_url": "https://api.github.com/users/kentaro-m/gists{/gist_id}", 273 | "starred_url": "https://api.github.com/users/kentaro-m/starred{/owner}{/repo}", 274 | "subscriptions_url": "https://api.github.com/users/kentaro-m/subscriptions", 275 | "organizations_url": "https://api.github.com/users/kentaro-m/orgs", 276 | "repos_url": "https://api.github.com/users/kentaro-m/repos", 277 | "events_url": "https://api.github.com/users/kentaro-m/events{/privacy}", 278 | "received_events_url": "https://api.github.com/users/kentaro-m/received_events", 279 | "type": "User", 280 | "site_admin": false 281 | }, 282 | "private": false, 283 | "html_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test", 284 | "description": null, 285 | "fork": false, 286 | "url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test", 287 | "forks_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/forks", 288 | "keys_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/keys{/key_id}", 289 | "collaborators_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/collaborators{/collaborator}", 290 | "teams_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/teams", 291 | "hooks_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/hooks", 292 | "issue_events_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/events{/number}", 293 | "events_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/events", 294 | "assignees_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/assignees{/user}", 295 | "branches_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/branches{/branch}", 296 | "tags_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/tags", 297 | "blobs_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/blobs{/sha}", 298 | "git_tags_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/tags{/sha}", 299 | "git_refs_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/refs{/sha}", 300 | "trees_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/trees{/sha}", 301 | "statuses_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/statuses/{sha}", 302 | "languages_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/languages", 303 | "stargazers_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/stargazers", 304 | "contributors_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/contributors", 305 | "subscribers_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/subscribers", 306 | "subscription_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/subscription", 307 | "commits_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/commits{/sha}", 308 | "git_commits_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/commits{/sha}", 309 | "comments_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/comments{/number}", 310 | "issue_comment_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/comments{/number}", 311 | "contents_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/contents/{+path}", 312 | "compare_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/compare/{base}...{head}", 313 | "merges_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/merges", 314 | "archive_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/{archive_format}{/ref}", 315 | "downloads_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/downloads", 316 | "issues_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues{/number}", 317 | "pulls_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls{/number}", 318 | "milestones_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/milestones{/number}", 319 | "notifications_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/notifications{?since,all,participating}", 320 | "labels_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/labels{/name}", 321 | "releases_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/releases{/id}", 322 | "deployments_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/deployments", 323 | "created_at": "2017-07-04T06:53:38Z", 324 | "updated_at": "2017-07-04T08:36:02Z", 325 | "pushed_at": "2017-07-29T04:00:21Z", 326 | "git_url": "git://github.com/kentaro-m/lambda-pr-notify-bot-test.git", 327 | "ssh_url": "git@github.com:kentaro-m/lambda-pr-notify-bot-test.git", 328 | "clone_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test.git", 329 | "svn_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test", 330 | "homepage": null, 331 | "size": 14, 332 | "stargazers_count": 0, 333 | "watchers_count": 0, 334 | "language": "Shell", 335 | "has_issues": true, 336 | "has_projects": true, 337 | "has_downloads": true, 338 | "has_wiki": true, 339 | "has_pages": false, 340 | "forks_count": 0, 341 | "mirror_url": null, 342 | "open_issues_count": 1, 343 | "forks": 0, 344 | "open_issues": 1, 345 | "watchers": 0, 346 | "default_branch": "master" 347 | } 348 | }, 349 | "_links": { 350 | "self": { 351 | "href": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/18" 352 | }, 353 | "html": { 354 | "href": "https://github.com/kentaro-m/lambda-pr-notify-bot-test/pull/18" 355 | }, 356 | "issue": { 357 | "href": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/18" 358 | }, 359 | "comments": { 360 | "href": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/18/comments" 361 | }, 362 | "review_comments": { 363 | "href": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/18/comments" 364 | }, 365 | "review_comment": { 366 | "href": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/comments{/number}" 367 | }, 368 | "commits": { 369 | "href": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/18/commits" 370 | }, 371 | "statuses": { 372 | "href": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/statuses/c79910b4916d754c6d6879ec5c49d453c5c30ac9" 373 | } 374 | } 375 | }, 376 | "repository": { 377 | "id": 96185263, 378 | "name": "lambda-pr-notify-bot-test", 379 | "full_name": "kentaro-m/lambda-pr-notify-bot-test", 380 | "owner": { 381 | "login": "kentaro-m", 382 | "id": 7448569, 383 | "avatar_url": "https://avatars0.githubusercontent.com/u/7448569?v=4", 384 | "gravatar_id": "", 385 | "url": "https://api.github.com/users/kentaro-m", 386 | "html_url": "https://github.com/kentaro-m", 387 | "followers_url": "https://api.github.com/users/kentaro-m/followers", 388 | "following_url": "https://api.github.com/users/kentaro-m/following{/other_user}", 389 | "gists_url": "https://api.github.com/users/kentaro-m/gists{/gist_id}", 390 | "starred_url": "https://api.github.com/users/kentaro-m/starred{/owner}{/repo}", 391 | "subscriptions_url": "https://api.github.com/users/kentaro-m/subscriptions", 392 | "organizations_url": "https://api.github.com/users/kentaro-m/orgs", 393 | "repos_url": "https://api.github.com/users/kentaro-m/repos", 394 | "events_url": "https://api.github.com/users/kentaro-m/events{/privacy}", 395 | "received_events_url": "https://api.github.com/users/kentaro-m/received_events", 396 | "type": "User", 397 | "site_admin": false 398 | }, 399 | "private": false, 400 | "html_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test", 401 | "description": null, 402 | "fork": false, 403 | "url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test", 404 | "forks_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/forks", 405 | "keys_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/keys{/key_id}", 406 | "collaborators_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/collaborators{/collaborator}", 407 | "teams_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/teams", 408 | "hooks_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/hooks", 409 | "issue_events_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/events{/number}", 410 | "events_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/events", 411 | "assignees_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/assignees{/user}", 412 | "branches_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/branches{/branch}", 413 | "tags_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/tags", 414 | "blobs_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/blobs{/sha}", 415 | "git_tags_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/tags{/sha}", 416 | "git_refs_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/refs{/sha}", 417 | "trees_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/trees{/sha}", 418 | "statuses_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/statuses/{sha}", 419 | "languages_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/languages", 420 | "stargazers_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/stargazers", 421 | "contributors_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/contributors", 422 | "subscribers_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/subscribers", 423 | "subscription_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/subscription", 424 | "commits_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/commits{/sha}", 425 | "git_commits_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/commits{/sha}", 426 | "comments_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/comments{/number}", 427 | "issue_comment_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/comments{/number}", 428 | "contents_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/contents/{+path}", 429 | "compare_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/compare/{base}...{head}", 430 | "merges_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/merges", 431 | "archive_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/{archive_format}{/ref}", 432 | "downloads_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/downloads", 433 | "issues_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues{/number}", 434 | "pulls_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls{/number}", 435 | "milestones_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/milestones{/number}", 436 | "notifications_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/notifications{?since,all,participating}", 437 | "labels_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/labels{/name}", 438 | "releases_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/releases{/id}", 439 | "deployments_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/deployments", 440 | "created_at": "2017-07-04T06:53:38Z", 441 | "updated_at": "2017-07-04T08:36:02Z", 442 | "pushed_at": "2017-07-29T04:00:21Z", 443 | "git_url": "git://github.com/kentaro-m/lambda-pr-notify-bot-test.git", 444 | "ssh_url": "git@github.com:kentaro-m/lambda-pr-notify-bot-test.git", 445 | "clone_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test.git", 446 | "svn_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test", 447 | "homepage": null, 448 | "size": 14, 449 | "stargazers_count": 0, 450 | "watchers_count": 0, 451 | "language": "Shell", 452 | "has_issues": true, 453 | "has_projects": true, 454 | "has_downloads": true, 455 | "has_wiki": true, 456 | "has_pages": false, 457 | "forks_count": 0, 458 | "mirror_url": null, 459 | "open_issues_count": 1, 460 | "forks": 0, 461 | "open_issues": 1, 462 | "watchers": 0, 463 | "default_branch": "master" 464 | }, 465 | "sender": { 466 | "login": "matsushita-kentaro", 467 | "id": 21993807, 468 | "avatar_url": "https://avatars2.githubusercontent.com/u/21993807?v=4", 469 | "gravatar_id": "", 470 | "url": "https://api.github.com/users/matsushita-kentaro", 471 | "html_url": "https://github.com/matsushita-kentaro", 472 | "followers_url": "https://api.github.com/users/matsushita-kentaro/followers", 473 | "following_url": "https://api.github.com/users/matsushita-kentaro/following{/other_user}", 474 | "gists_url": "https://api.github.com/users/matsushita-kentaro/gists{/gist_id}", 475 | "starred_url": "https://api.github.com/users/matsushita-kentaro/starred{/owner}{/repo}", 476 | "subscriptions_url": "https://api.github.com/users/matsushita-kentaro/subscriptions", 477 | "organizations_url": "https://api.github.com/users/matsushita-kentaro/orgs", 478 | "repos_url": "https://api.github.com/users/matsushita-kentaro/repos", 479 | "events_url": "https://api.github.com/users/matsushita-kentaro/events{/privacy}", 480 | "received_events_url": "https://api.github.com/users/matsushita-kentaro/received_events", 481 | "type": "User", 482 | "site_admin": false 483 | } 484 | }, 485 | "headers": { 486 | "X-GitHub-Event": "pull_request_review", 487 | "X-Hub-Signature": "sha1=0acdb3b56779297f93abd7273959587a1ef35415" 488 | }, 489 | "method": "POST", 490 | "params": {}, 491 | "query": {} 492 | } 493 | -------------------------------------------------------------------------------- /test/fixtures/request_review.json: -------------------------------------------------------------------------------- 1 | { 2 | "body": { 3 | "action": "opened", 4 | "number": 19, 5 | "pull_request": { 6 | "url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/19", 7 | "id": 134319874, 8 | "html_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test/pull/19", 9 | "diff_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test/pull/19.diff", 10 | "patch_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test/pull/19.patch", 11 | "issue_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/19", 12 | "number": 19, 13 | "state": "open", 14 | "locked": false, 15 | "title": "bot test 4", 16 | "user": { 17 | "login": "kentaro-m", 18 | "id": 7448569, 19 | "avatar_url": "https://avatars0.githubusercontent.com/u/7448569?v=4", 20 | "gravatar_id": "", 21 | "url": "https://api.github.com/users/kentaro-m", 22 | "html_url": "https://github.com/kentaro-m", 23 | "followers_url": "https://api.github.com/users/kentaro-m/followers", 24 | "following_url": "https://api.github.com/users/kentaro-m/following{/other_user}", 25 | "gists_url": "https://api.github.com/users/kentaro-m/gists{/gist_id}", 26 | "starred_url": "https://api.github.com/users/kentaro-m/starred{/owner}{/repo}", 27 | "subscriptions_url": "https://api.github.com/users/kentaro-m/subscriptions", 28 | "organizations_url": "https://api.github.com/users/kentaro-m/orgs", 29 | "repos_url": "https://api.github.com/users/kentaro-m/repos", 30 | "events_url": "https://api.github.com/users/kentaro-m/events{/privacy}", 31 | "received_events_url": "https://api.github.com/users/kentaro-m/received_events", 32 | "type": "User", 33 | "site_admin": false 34 | }, 35 | "body": "dddd", 36 | "created_at": "2017-08-06T09:15:17Z", 37 | "updated_at": "2017-08-06T09:15:17Z", 38 | "closed_at": null, 39 | "merged_at": null, 40 | "merge_commit_sha": null, 41 | "assignee": null, 42 | "assignees": [], 43 | "requested_reviewers": [], 44 | "milestone": null, 45 | "commits_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/19/commits", 46 | "review_comments_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/19/comments", 47 | "review_comment_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/comments{/number}", 48 | "comments_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/19/comments", 49 | "statuses_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/statuses/c79910b4916d754c6d6879ec5c49d453c5c30ac9", 50 | "head": { 51 | "label": "kentaro-m:test", 52 | "ref": "test", 53 | "sha": "c79910b4916d754c6d6879ec5c49d453c5c30ac9", 54 | "user": { 55 | "login": "kentaro-m", 56 | "id": 7448569, 57 | "avatar_url": "https://avatars0.githubusercontent.com/u/7448569?v=4", 58 | "gravatar_id": "", 59 | "url": "https://api.github.com/users/kentaro-m", 60 | "html_url": "https://github.com/kentaro-m", 61 | "followers_url": "https://api.github.com/users/kentaro-m/followers", 62 | "following_url": "https://api.github.com/users/kentaro-m/following{/other_user}", 63 | "gists_url": "https://api.github.com/users/kentaro-m/gists{/gist_id}", 64 | "starred_url": "https://api.github.com/users/kentaro-m/starred{/owner}{/repo}", 65 | "subscriptions_url": "https://api.github.com/users/kentaro-m/subscriptions", 66 | "organizations_url": "https://api.github.com/users/kentaro-m/orgs", 67 | "repos_url": "https://api.github.com/users/kentaro-m/repos", 68 | "events_url": "https://api.github.com/users/kentaro-m/events{/privacy}", 69 | "received_events_url": "https://api.github.com/users/kentaro-m/received_events", 70 | "type": "User", 71 | "site_admin": false 72 | }, 73 | "repo": { 74 | "id": 96185263, 75 | "name": "lambda-pr-notify-bot-test", 76 | "full_name": "kentaro-m/lambda-pr-notify-bot-test", 77 | "owner": { 78 | "login": "kentaro-m", 79 | "id": 7448569, 80 | "avatar_url": "https://avatars0.githubusercontent.com/u/7448569?v=4", 81 | "gravatar_id": "", 82 | "url": "https://api.github.com/users/kentaro-m", 83 | "html_url": "https://github.com/kentaro-m", 84 | "followers_url": "https://api.github.com/users/kentaro-m/followers", 85 | "following_url": "https://api.github.com/users/kentaro-m/following{/other_user}", 86 | "gists_url": "https://api.github.com/users/kentaro-m/gists{/gist_id}", 87 | "starred_url": "https://api.github.com/users/kentaro-m/starred{/owner}{/repo}", 88 | "subscriptions_url": "https://api.github.com/users/kentaro-m/subscriptions", 89 | "organizations_url": "https://api.github.com/users/kentaro-m/orgs", 90 | "repos_url": "https://api.github.com/users/kentaro-m/repos", 91 | "events_url": "https://api.github.com/users/kentaro-m/events{/privacy}", 92 | "received_events_url": "https://api.github.com/users/kentaro-m/received_events", 93 | "type": "User", 94 | "site_admin": false 95 | }, 96 | "private": false, 97 | "html_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test", 98 | "description": null, 99 | "fork": false, 100 | "url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test", 101 | "forks_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/forks", 102 | "keys_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/keys{/key_id}", 103 | "collaborators_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/collaborators{/collaborator}", 104 | "teams_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/teams", 105 | "hooks_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/hooks", 106 | "issue_events_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/events{/number}", 107 | "events_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/events", 108 | "assignees_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/assignees{/user}", 109 | "branches_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/branches{/branch}", 110 | "tags_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/tags", 111 | "blobs_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/blobs{/sha}", 112 | "git_tags_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/tags{/sha}", 113 | "git_refs_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/refs{/sha}", 114 | "trees_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/trees{/sha}", 115 | "statuses_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/statuses/{sha}", 116 | "languages_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/languages", 117 | "stargazers_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/stargazers", 118 | "contributors_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/contributors", 119 | "subscribers_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/subscribers", 120 | "subscription_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/subscription", 121 | "commits_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/commits{/sha}", 122 | "git_commits_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/commits{/sha}", 123 | "comments_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/comments{/number}", 124 | "issue_comment_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/comments{/number}", 125 | "contents_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/contents/{+path}", 126 | "compare_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/compare/{base}...{head}", 127 | "merges_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/merges", 128 | "archive_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/{archive_format}{/ref}", 129 | "downloads_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/downloads", 130 | "issues_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues{/number}", 131 | "pulls_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls{/number}", 132 | "milestones_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/milestones{/number}", 133 | "notifications_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/notifications{?since,all,participating}", 134 | "labels_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/labels{/name}", 135 | "releases_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/releases{/id}", 136 | "deployments_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/deployments", 137 | "created_at": "2017-07-04T06:53:38Z", 138 | "updated_at": "2017-07-04T08:36:02Z", 139 | "pushed_at": "2017-07-29T04:00:21Z", 140 | "git_url": "git://github.com/kentaro-m/lambda-pr-notify-bot-test.git", 141 | "ssh_url": "git@github.com:kentaro-m/lambda-pr-notify-bot-test.git", 142 | "clone_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test.git", 143 | "svn_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test", 144 | "homepage": null, 145 | "size": 14, 146 | "stargazers_count": 0, 147 | "watchers_count": 0, 148 | "language": "Shell", 149 | "has_issues": true, 150 | "has_projects": true, 151 | "has_downloads": true, 152 | "has_wiki": true, 153 | "has_pages": false, 154 | "forks_count": 0, 155 | "mirror_url": null, 156 | "open_issues_count": 1, 157 | "forks": 0, 158 | "open_issues": 1, 159 | "watchers": 0, 160 | "default_branch": "master" 161 | } 162 | }, 163 | "base": { 164 | "label": "kentaro-m:master", 165 | "ref": "master", 166 | "sha": "4d8c17a8904bd65156437e784fded8336d5c0f92", 167 | "user": { 168 | "login": "kentaro-m", 169 | "id": 7448569, 170 | "avatar_url": "https://avatars0.githubusercontent.com/u/7448569?v=4", 171 | "gravatar_id": "", 172 | "url": "https://api.github.com/users/kentaro-m", 173 | "html_url": "https://github.com/kentaro-m", 174 | "followers_url": "https://api.github.com/users/kentaro-m/followers", 175 | "following_url": "https://api.github.com/users/kentaro-m/following{/other_user}", 176 | "gists_url": "https://api.github.com/users/kentaro-m/gists{/gist_id}", 177 | "starred_url": "https://api.github.com/users/kentaro-m/starred{/owner}{/repo}", 178 | "subscriptions_url": "https://api.github.com/users/kentaro-m/subscriptions", 179 | "organizations_url": "https://api.github.com/users/kentaro-m/orgs", 180 | "repos_url": "https://api.github.com/users/kentaro-m/repos", 181 | "events_url": "https://api.github.com/users/kentaro-m/events{/privacy}", 182 | "received_events_url": "https://api.github.com/users/kentaro-m/received_events", 183 | "type": "User", 184 | "site_admin": false 185 | }, 186 | "repo": { 187 | "id": 96185263, 188 | "name": "lambda-pr-notify-bot-test", 189 | "full_name": "kentaro-m/lambda-pr-notify-bot-test", 190 | "owner": { 191 | "login": "kentaro-m", 192 | "id": 7448569, 193 | "avatar_url": "https://avatars0.githubusercontent.com/u/7448569?v=4", 194 | "gravatar_id": "", 195 | "url": "https://api.github.com/users/kentaro-m", 196 | "html_url": "https://github.com/kentaro-m", 197 | "followers_url": "https://api.github.com/users/kentaro-m/followers", 198 | "following_url": "https://api.github.com/users/kentaro-m/following{/other_user}", 199 | "gists_url": "https://api.github.com/users/kentaro-m/gists{/gist_id}", 200 | "starred_url": "https://api.github.com/users/kentaro-m/starred{/owner}{/repo}", 201 | "subscriptions_url": "https://api.github.com/users/kentaro-m/subscriptions", 202 | "organizations_url": "https://api.github.com/users/kentaro-m/orgs", 203 | "repos_url": "https://api.github.com/users/kentaro-m/repos", 204 | "events_url": "https://api.github.com/users/kentaro-m/events{/privacy}", 205 | "received_events_url": "https://api.github.com/users/kentaro-m/received_events", 206 | "type": "User", 207 | "site_admin": false 208 | }, 209 | "private": false, 210 | "html_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test", 211 | "description": null, 212 | "fork": false, 213 | "url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test", 214 | "forks_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/forks", 215 | "keys_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/keys{/key_id}", 216 | "collaborators_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/collaborators{/collaborator}", 217 | "teams_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/teams", 218 | "hooks_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/hooks", 219 | "issue_events_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/events{/number}", 220 | "events_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/events", 221 | "assignees_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/assignees{/user}", 222 | "branches_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/branches{/branch}", 223 | "tags_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/tags", 224 | "blobs_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/blobs{/sha}", 225 | "git_tags_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/tags{/sha}", 226 | "git_refs_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/refs{/sha}", 227 | "trees_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/trees{/sha}", 228 | "statuses_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/statuses/{sha}", 229 | "languages_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/languages", 230 | "stargazers_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/stargazers", 231 | "contributors_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/contributors", 232 | "subscribers_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/subscribers", 233 | "subscription_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/subscription", 234 | "commits_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/commits{/sha}", 235 | "git_commits_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/commits{/sha}", 236 | "comments_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/comments{/number}", 237 | "issue_comment_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/comments{/number}", 238 | "contents_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/contents/{+path}", 239 | "compare_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/compare/{base}...{head}", 240 | "merges_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/merges", 241 | "archive_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/{archive_format}{/ref}", 242 | "downloads_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/downloads", 243 | "issues_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues{/number}", 244 | "pulls_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls{/number}", 245 | "milestones_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/milestones{/number}", 246 | "notifications_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/notifications{?since,all,participating}", 247 | "labels_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/labels{/name}", 248 | "releases_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/releases{/id}", 249 | "deployments_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/deployments", 250 | "created_at": "2017-07-04T06:53:38Z", 251 | "updated_at": "2017-07-04T08:36:02Z", 252 | "pushed_at": "2017-07-29T04:00:21Z", 253 | "git_url": "git://github.com/kentaro-m/lambda-pr-notify-bot-test.git", 254 | "ssh_url": "git@github.com:kentaro-m/lambda-pr-notify-bot-test.git", 255 | "clone_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test.git", 256 | "svn_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test", 257 | "homepage": null, 258 | "size": 14, 259 | "stargazers_count": 0, 260 | "watchers_count": 0, 261 | "language": "Shell", 262 | "has_issues": true, 263 | "has_projects": true, 264 | "has_downloads": true, 265 | "has_wiki": true, 266 | "has_pages": false, 267 | "forks_count": 0, 268 | "mirror_url": null, 269 | "open_issues_count": 1, 270 | "forks": 0, 271 | "open_issues": 1, 272 | "watchers": 0, 273 | "default_branch": "master" 274 | } 275 | }, 276 | "_links": { 277 | "self": { 278 | "href": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/19" 279 | }, 280 | "html": { 281 | "href": "https://github.com/kentaro-m/lambda-pr-notify-bot-test/pull/19" 282 | }, 283 | "issue": { 284 | "href": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/19" 285 | }, 286 | "comments": { 287 | "href": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/19/comments" 288 | }, 289 | "review_comments": { 290 | "href": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/19/comments" 291 | }, 292 | "review_comment": { 293 | "href": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/comments{/number}" 294 | }, 295 | "commits": { 296 | "href": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/19/commits" 297 | }, 298 | "statuses": { 299 | "href": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/statuses/c79910b4916d754c6d6879ec5c49d453c5c30ac9" 300 | } 301 | }, 302 | "merged": false, 303 | "mergeable": null, 304 | "rebaseable": null, 305 | "mergeable_state": "unknown", 306 | "merged_by": null, 307 | "comments": 0, 308 | "review_comments": 0, 309 | "maintainer_can_modify": false, 310 | "commits": 1, 311 | "additions": 0, 312 | "deletions": 0, 313 | "changed_files": 0 314 | }, 315 | "repository": { 316 | "id": 96185263, 317 | "name": "lambda-pr-notify-bot-test", 318 | "full_name": "kentaro-m/lambda-pr-notify-bot-test", 319 | "owner": { 320 | "login": "kentaro-m", 321 | "id": 7448569, 322 | "avatar_url": "https://avatars0.githubusercontent.com/u/7448569?v=4", 323 | "gravatar_id": "", 324 | "url": "https://api.github.com/users/kentaro-m", 325 | "html_url": "https://github.com/kentaro-m", 326 | "followers_url": "https://api.github.com/users/kentaro-m/followers", 327 | "following_url": "https://api.github.com/users/kentaro-m/following{/other_user}", 328 | "gists_url": "https://api.github.com/users/kentaro-m/gists{/gist_id}", 329 | "starred_url": "https://api.github.com/users/kentaro-m/starred{/owner}{/repo}", 330 | "subscriptions_url": "https://api.github.com/users/kentaro-m/subscriptions", 331 | "organizations_url": "https://api.github.com/users/kentaro-m/orgs", 332 | "repos_url": "https://api.github.com/users/kentaro-m/repos", 333 | "events_url": "https://api.github.com/users/kentaro-m/events{/privacy}", 334 | "received_events_url": "https://api.github.com/users/kentaro-m/received_events", 335 | "type": "User", 336 | "site_admin": false 337 | }, 338 | "private": false, 339 | "html_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test", 340 | "description": null, 341 | "fork": false, 342 | "url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test", 343 | "forks_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/forks", 344 | "keys_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/keys{/key_id}", 345 | "collaborators_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/collaborators{/collaborator}", 346 | "teams_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/teams", 347 | "hooks_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/hooks", 348 | "issue_events_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/events{/number}", 349 | "events_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/events", 350 | "assignees_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/assignees{/user}", 351 | "branches_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/branches{/branch}", 352 | "tags_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/tags", 353 | "blobs_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/blobs{/sha}", 354 | "git_tags_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/tags{/sha}", 355 | "git_refs_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/refs{/sha}", 356 | "trees_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/trees{/sha}", 357 | "statuses_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/statuses/{sha}", 358 | "languages_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/languages", 359 | "stargazers_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/stargazers", 360 | "contributors_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/contributors", 361 | "subscribers_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/subscribers", 362 | "subscription_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/subscription", 363 | "commits_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/commits{/sha}", 364 | "git_commits_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/commits{/sha}", 365 | "comments_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/comments{/number}", 366 | "issue_comment_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/comments{/number}", 367 | "contents_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/contents/{+path}", 368 | "compare_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/compare/{base}...{head}", 369 | "merges_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/merges", 370 | "archive_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/{archive_format}{/ref}", 371 | "downloads_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/downloads", 372 | "issues_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues{/number}", 373 | "pulls_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls{/number}", 374 | "milestones_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/milestones{/number}", 375 | "notifications_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/notifications{?since,all,participating}", 376 | "labels_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/labels{/name}", 377 | "releases_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/releases{/id}", 378 | "deployments_url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/deployments", 379 | "created_at": "2017-07-04T06:53:38Z", 380 | "updated_at": "2017-07-04T08:36:02Z", 381 | "pushed_at": "2017-07-29T04:00:21Z", 382 | "git_url": "git://github.com/kentaro-m/lambda-pr-notify-bot-test.git", 383 | "ssh_url": "git@github.com:kentaro-m/lambda-pr-notify-bot-test.git", 384 | "clone_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test.git", 385 | "svn_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test", 386 | "homepage": null, 387 | "size": 14, 388 | "stargazers_count": 0, 389 | "watchers_count": 0, 390 | "language": "Shell", 391 | "has_issues": true, 392 | "has_projects": true, 393 | "has_downloads": true, 394 | "has_wiki": true, 395 | "has_pages": false, 396 | "forks_count": 0, 397 | "mirror_url": null, 398 | "open_issues_count": 1, 399 | "forks": 0, 400 | "open_issues": 1, 401 | "watchers": 0, 402 | "default_branch": "master" 403 | }, 404 | "sender": { 405 | "login": "kentaro-m", 406 | "id": 7448569, 407 | "avatar_url": "https://avatars0.githubusercontent.com/u/7448569?v=4", 408 | "gravatar_id": "", 409 | "url": "https://api.github.com/users/kentaro-m", 410 | "html_url": "https://github.com/kentaro-m", 411 | "followers_url": "https://api.github.com/users/kentaro-m/followers", 412 | "following_url": "https://api.github.com/users/kentaro-m/following{/other_user}", 413 | "gists_url": "https://api.github.com/users/kentaro-m/gists{/gist_id}", 414 | "starred_url": "https://api.github.com/users/kentaro-m/starred{/owner}{/repo}", 415 | "subscriptions_url": "https://api.github.com/users/kentaro-m/subscriptions", 416 | "organizations_url": "https://api.github.com/users/kentaro-m/orgs", 417 | "repos_url": "https://api.github.com/users/kentaro-m/repos", 418 | "events_url": "https://api.github.com/users/kentaro-m/events{/privacy}", 419 | "received_events_url": "https://api.github.com/users/kentaro-m/received_events", 420 | "type": "User", 421 | "site_admin": false 422 | } 423 | }, 424 | "headers": { 425 | "X-GitHub-Event": "pull_request", 426 | "X-Hub-Signature": "sha1=c21df5ab531a2eb76ff22e817d520f746f74ed6d" 427 | }, 428 | "method": "POST", 429 | "params": {}, 430 | "query": {} 431 | 432 | } 433 | -------------------------------------------------------------------------------- /test/fixtures/review_comments_approved.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "id": 53072104, 5 | "user": { 6 | "login": "matsushita-kentaro", 7 | "id": 21993807, 8 | "avatar_url": "https://avatars2.githubusercontent.com/u/21993807?v=4", 9 | "gravatar_id": "", 10 | "url": "https://api.github.com/users/matsushita-kentaro", 11 | "html_url": "https://github.com/matsushita-kentaro", 12 | "followers_url": "https://api.github.com/users/matsushita-kentaro/followers", 13 | "following_url": "https://api.github.com/users/matsushita-kentaro/following{/other_user}", 14 | "gists_url": "https://api.github.com/users/matsushita-kentaro/gists{/gist_id}", 15 | "starred_url": "https://api.github.com/users/matsushita-kentaro/starred{/owner}{/repo}", 16 | "subscriptions_url": "https://api.github.com/users/matsushita-kentaro/subscriptions", 17 | "organizations_url": "https://api.github.com/users/matsushita-kentaro/orgs", 18 | "repos_url": "https://api.github.com/users/matsushita-kentaro/repos", 19 | "events_url": "https://api.github.com/users/matsushita-kentaro/events{/privacy}", 20 | "received_events_url": "https://api.github.com/users/matsushita-kentaro/received_events", 21 | "type": "User", 22 | "site_admin": false 23 | }, 24 | "body": "@kentaro-m \r\nReview Comment", 25 | "state": "COMMENTED", 26 | "html_url": "https://github.com/kentaro-m/unleash-sample/pull/18#pullrequestreview-53072104", 27 | "pull_request_url": "https://api.github.com/repos/kentaro-m/unleash-sample/pulls/18", 28 | "author_association": "COLLABORATOR", 29 | "_links": { 30 | "html": { 31 | "href": "https://github.com/kentaro-m/unleash-sample/pull/18#pullrequestreview-53072104" 32 | }, 33 | "pull_request": { 34 | "href": "https://api.github.com/repos/kentaro-m/unleash-sample/pulls/18" 35 | } 36 | }, 37 | "submitted_at": "2017-07-29T08:08:57Z", 38 | "commit_id": "c79910b4916d754c6d6879ec5c49d453c5c30ac9" 39 | }, 40 | { 41 | "id": 53074631, 42 | "user": { 43 | "login": "matsushita-kentaro", 44 | "id": 21993807, 45 | "avatar_url": "https://avatars2.githubusercontent.com/u/21993807?v=4", 46 | "gravatar_id": "", 47 | "url": "https://api.github.com/users/matsushita-kentaro", 48 | "html_url": "https://github.com/matsushita-kentaro", 49 | "followers_url": "https://api.github.com/users/matsushita-kentaro/followers", 50 | "following_url": "https://api.github.com/users/matsushita-kentaro/following{/other_user}", 51 | "gists_url": "https://api.github.com/users/matsushita-kentaro/gists{/gist_id}", 52 | "starred_url": "https://api.github.com/users/matsushita-kentaro/starred{/owner}{/repo}", 53 | "subscriptions_url": "https://api.github.com/users/matsushita-kentaro/subscriptions", 54 | "organizations_url": "https://api.github.com/users/matsushita-kentaro/orgs", 55 | "repos_url": "https://api.github.com/users/matsushita-kentaro/repos", 56 | "events_url": "https://api.github.com/users/matsushita-kentaro/events{/privacy}", 57 | "received_events_url": "https://api.github.com/users/matsushita-kentaro/received_events", 58 | "type": "User", 59 | "site_admin": false 60 | }, 61 | "body": "+1", 62 | "state": "APPROVED", 63 | "html_url": "https://github.com/kentaro-m/unleash-sample/pull/18#pullrequestreview-53074631", 64 | "pull_request_url": "https://api.github.com/repos/kentaro-m/unleash-sample/pulls/18", 65 | "author_association": "COLLABORATOR", 66 | "_links": { 67 | "html": { 68 | "href": "https://github.com/kentaro-m/unleash-sample/pull/18#pullrequestreview-53074631" 69 | }, 70 | "pull_request": { 71 | "href": "https://api.github.com/repos/kentaro-m/unleash-sample/pulls/18" 72 | } 73 | }, 74 | "submitted_at": "2017-07-29T11:20:19Z", 75 | "commit_id": "c79910b4916d754c6d6879ec5c49d453c5c30ac9" 76 | }, 77 | { 78 | "id": 54117272, 79 | "user": { 80 | "login": "matsushita-kentaro", 81 | "id": 21993807, 82 | "avatar_url": "https://avatars2.githubusercontent.com/u/21993807?v=4", 83 | "gravatar_id": "", 84 | "url": "https://api.github.com/users/matsushita-kentaro", 85 | "html_url": "https://github.com/matsushita-kentaro", 86 | "followers_url": "https://api.github.com/users/matsushita-kentaro/followers", 87 | "following_url": "https://api.github.com/users/matsushita-kentaro/following{/other_user}", 88 | "gists_url": "https://api.github.com/users/matsushita-kentaro/gists{/gist_id}", 89 | "starred_url": "https://api.github.com/users/matsushita-kentaro/starred{/owner}{/repo}", 90 | "subscriptions_url": "https://api.github.com/users/matsushita-kentaro/subscriptions", 91 | "organizations_url": "https://api.github.com/users/matsushita-kentaro/orgs", 92 | "repos_url": "https://api.github.com/users/matsushita-kentaro/repos", 93 | "events_url": "https://api.github.com/users/matsushita-kentaro/events{/privacy}", 94 | "received_events_url": "https://api.github.com/users/matsushita-kentaro/received_events", 95 | "type": "User", 96 | "site_admin": false 97 | }, 98 | "body": "foo", 99 | "state": "COMMENTED", 100 | "html_url": "https://github.com/kentaro-m/unleash-sample/pull/18#pullrequestreview-54117272", 101 | "pull_request_url": "https://api.github.com/repos/kentaro-m/unleash-sample/pulls/18", 102 | "author_association": "COLLABORATOR", 103 | "_links": { 104 | "html": { 105 | "href": "https://github.com/kentaro-m/unleash-sample/pull/18#pullrequestreview-54117272" 106 | }, 107 | "pull_request": { 108 | "href": "https://api.github.com/repos/kentaro-m/unleash-sample/pulls/18" 109 | } 110 | }, 111 | "submitted_at": "2017-08-03T14:47:12Z", 112 | "commit_id": "c79910b4916d754c6d6879ec5c49d453c5c30ac9" 113 | } 114 | ], 115 | "meta": { 116 | "x-ratelimit-limit": "5000", 117 | "x-ratelimit-remaining": "4997", 118 | "x-ratelimit-reset": "1507998148", 119 | "x-oauth-scopes": "repo", 120 | "x-github-request-id": "B6C2:3D1D:C646EA9:10DAD207:59E22D95", 121 | "x-github-media-type": "github.v3; format=json", 122 | "etag": "\"9bbc47fca5a54a62a5702644ba315c87\"", 123 | "status": "200 OK" 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /test/fixtures/review_comments_changed.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "id": 53072104, 5 | "user": { 6 | "login": "matsushita-kentaro", 7 | "id": 21993807, 8 | "avatar_url": "https://avatars2.githubusercontent.com/u/21993807?v=4", 9 | "gravatar_id": "", 10 | "url": "https://api.github.com/users/matsushita-kentaro", 11 | "html_url": "https://github.com/matsushita-kentaro", 12 | "followers_url": "https://api.github.com/users/matsushita-kentaro/followers", 13 | "following_url": "https://api.github.com/users/matsushita-kentaro/following{/other_user}", 14 | "gists_url": "https://api.github.com/users/matsushita-kentaro/gists{/gist_id}", 15 | "starred_url": "https://api.github.com/users/matsushita-kentaro/starred{/owner}{/repo}", 16 | "subscriptions_url": "https://api.github.com/users/matsushita-kentaro/subscriptions", 17 | "organizations_url": "https://api.github.com/users/matsushita-kentaro/orgs", 18 | "repos_url": "https://api.github.com/users/matsushita-kentaro/repos", 19 | "events_url": "https://api.github.com/users/matsushita-kentaro/events{/privacy}", 20 | "received_events_url": "https://api.github.com/users/matsushita-kentaro/received_events", 21 | "type": "User", 22 | "site_admin": false 23 | }, 24 | "body": "@kentaro-m \r\nReview Comment", 25 | "state": "COMMENTED", 26 | "html_url": "https://github.com/kentaro-m/unleash-sample/pull/18#pullrequestreview-53072104", 27 | "pull_request_url": "https://api.github.com/repos/kentaro-m/unleash-sample/pulls/18", 28 | "author_association": "COLLABORATOR", 29 | "_links": { 30 | "html": { 31 | "href": "https://github.com/kentaro-m/unleash-sample/pull/18#pullrequestreview-53072104" 32 | }, 33 | "pull_request": { 34 | "href": "https://api.github.com/repos/kentaro-m/unleash-sample/pulls/18" 35 | } 36 | }, 37 | "submitted_at": "2017-07-29T08:08:57Z", 38 | "commit_id": "c79910b4916d754c6d6879ec5c49d453c5c30ac9" 39 | }, 40 | { 41 | "id": 53074631, 42 | "user": { 43 | "login": "matsushita-kentaro", 44 | "id": 21993807, 45 | "avatar_url": "https://avatars2.githubusercontent.com/u/21993807?v=4", 46 | "gravatar_id": "", 47 | "url": "https://api.github.com/users/matsushita-kentaro", 48 | "html_url": "https://github.com/matsushita-kentaro", 49 | "followers_url": "https://api.github.com/users/matsushita-kentaro/followers", 50 | "following_url": "https://api.github.com/users/matsushita-kentaro/following{/other_user}", 51 | "gists_url": "https://api.github.com/users/matsushita-kentaro/gists{/gist_id}", 52 | "starred_url": "https://api.github.com/users/matsushita-kentaro/starred{/owner}{/repo}", 53 | "subscriptions_url": "https://api.github.com/users/matsushita-kentaro/subscriptions", 54 | "organizations_url": "https://api.github.com/users/matsushita-kentaro/orgs", 55 | "repos_url": "https://api.github.com/users/matsushita-kentaro/repos", 56 | "events_url": "https://api.github.com/users/matsushita-kentaro/events{/privacy}", 57 | "received_events_url": "https://api.github.com/users/matsushita-kentaro/received_events", 58 | "type": "User", 59 | "site_admin": false 60 | }, 61 | "body": "request changed", 62 | "state": "REQUEST_CHANGED", 63 | "html_url": "https://github.com/kentaro-m/unleash-sample/pull/18#pullrequestreview-53074631", 64 | "pull_request_url": "https://api.github.com/repos/kentaro-m/unleash-sample/pulls/18", 65 | "author_association": "COLLABORATOR", 66 | "_links": { 67 | "html": { 68 | "href": "https://github.com/kentaro-m/unleash-sample/pull/18#pullrequestreview-53074631" 69 | }, 70 | "pull_request": { 71 | "href": "https://api.github.com/repos/kentaro-m/unleash-sample/pulls/18" 72 | } 73 | }, 74 | "submitted_at": "2017-07-29T11:20:19Z", 75 | "commit_id": "c79910b4916d754c6d6879ec5c49d453c5c30ac9" 76 | }, 77 | { 78 | "id": 54117272, 79 | "user": { 80 | "login": "matsushita-kentaro", 81 | "id": 21993807, 82 | "avatar_url": "https://avatars2.githubusercontent.com/u/21993807?v=4", 83 | "gravatar_id": "", 84 | "url": "https://api.github.com/users/matsushita-kentaro", 85 | "html_url": "https://github.com/matsushita-kentaro", 86 | "followers_url": "https://api.github.com/users/matsushita-kentaro/followers", 87 | "following_url": "https://api.github.com/users/matsushita-kentaro/following{/other_user}", 88 | "gists_url": "https://api.github.com/users/matsushita-kentaro/gists{/gist_id}", 89 | "starred_url": "https://api.github.com/users/matsushita-kentaro/starred{/owner}{/repo}", 90 | "subscriptions_url": "https://api.github.com/users/matsushita-kentaro/subscriptions", 91 | "organizations_url": "https://api.github.com/users/matsushita-kentaro/orgs", 92 | "repos_url": "https://api.github.com/users/matsushita-kentaro/repos", 93 | "events_url": "https://api.github.com/users/matsushita-kentaro/events{/privacy}", 94 | "received_events_url": "https://api.github.com/users/matsushita-kentaro/received_events", 95 | "type": "User", 96 | "site_admin": false 97 | }, 98 | "body": "foo", 99 | "state": "COMMENTED", 100 | "html_url": "https://github.com/kentaro-m/unleash-sample/pull/18#pullrequestreview-54117272", 101 | "pull_request_url": "https://api.github.com/repos/kentaro-m/unleash-sample/pulls/18", 102 | "author_association": "COLLABORATOR", 103 | "_links": { 104 | "html": { 105 | "href": "https://github.com/kentaro-m/unleash-sample/pull/18#pullrequestreview-54117272" 106 | }, 107 | "pull_request": { 108 | "href": "https://api.github.com/repos/kentaro-m/unleash-sample/pulls/18" 109 | } 110 | }, 111 | "submitted_at": "2017-08-03T14:47:12Z", 112 | "commit_id": "c79910b4916d754c6d6879ec5c49d453c5c30ac9" 113 | } 114 | ], 115 | "meta": { 116 | "x-ratelimit-limit": "5000", 117 | "x-ratelimit-remaining": "4997", 118 | "x-ratelimit-reset": "1507998148", 119 | "x-oauth-scopes": "repo", 120 | "x-github-request-id": "B6C2:3D1D:C646EA9:10DAD207:59E22D95", 121 | "x-github-media-type": "github.v3; format=json", 122 | "etag": "\"9bbc47fca5a54a62a5702644ba315c87\"", 123 | "status": "200 OK" 124 | } 125 | } 126 | -------------------------------------------------------------------------------- /test/fixtures/work_in_progress.json: -------------------------------------------------------------------------------- 1 | { 2 | "body": { 3 | "action": "unlabeled", 4 | "number": 5, 5 | "pull_request": { 6 | "url": 7 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/5", 8 | "id": 171178219, 9 | "html_url": 10 | "https://github.com/kentaro-m/lambda-pr-notify-bot-test/pull/5", 11 | "diff_url": 12 | "https://github.com/kentaro-m/lambda-pr-notify-bot-test/pull/5.diff", 13 | "patch_url": 14 | "https://github.com/kentaro-m/lambda-pr-notify-bot-test/pull/5.patch", 15 | "issue_url": 16 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/5", 17 | "number": 5, 18 | "state": "open", 19 | "locked": false, 20 | "title": "Create test.md", 21 | "user": { 22 | "login": "kentaro-m", 23 | "id": 7448569, 24 | "avatar_url": "https://avatars0.githubusercontent.com/u/7448569?v=4", 25 | "gravatar_id": "", 26 | "url": "https://api.github.com/users/kentaro-m", 27 | "html_url": "https://github.com/kentaro-m", 28 | "followers_url": "https://api.github.com/users/kentaro-m/followers", 29 | "following_url": 30 | "https://api.github.com/users/kentaro-m/following{/other_user}", 31 | "gists_url": "https://api.github.com/users/kentaro-m/gists{/gist_id}", 32 | "starred_url": 33 | "https://api.github.com/users/kentaro-m/starred{/owner}{/repo}", 34 | "subscriptions_url": 35 | "https://api.github.com/users/kentaro-m/subscriptions", 36 | "organizations_url": "https://api.github.com/users/kentaro-m/orgs", 37 | "repos_url": "https://api.github.com/users/kentaro-m/repos", 38 | "events_url": "https://api.github.com/users/kentaro-m/events{/privacy}", 39 | "received_events_url": 40 | "https://api.github.com/users/kentaro-m/received_events", 41 | "type": "User", 42 | "site_admin": false 43 | }, 44 | "body": "wip test", 45 | "created_at": "2018-02-24T13:13:35Z", 46 | "updated_at": "2018-02-24T14:10:58Z", 47 | "closed_at": null, 48 | "merged_at": null, 49 | "merge_commit_sha": "a768a388285474795025769d02961c6c197e2a77", 50 | "assignee": { 51 | "login": "matsushita-kentaro", 52 | "id": 21993807, 53 | "avatar_url": "https://avatars2.githubusercontent.com/u/21993807?v=4", 54 | "gravatar_id": "", 55 | "url": "https://api.github.com/users/matsushita-kentaro", 56 | "html_url": "https://github.com/matsushita-kentaro", 57 | "followers_url": 58 | "https://api.github.com/users/matsushita-kentaro/followers", 59 | "following_url": 60 | "https://api.github.com/users/matsushita-kentaro/following{/other_user}", 61 | "gists_url": 62 | "https://api.github.com/users/matsushita-kentaro/gists{/gist_id}", 63 | "starred_url": 64 | "https://api.github.com/users/matsushita-kentaro/starred{/owner}{/repo}", 65 | "subscriptions_url": 66 | "https://api.github.com/users/matsushita-kentaro/subscriptions", 67 | "organizations_url": 68 | "https://api.github.com/users/matsushita-kentaro/orgs", 69 | "repos_url": "https://api.github.com/users/matsushita-kentaro/repos", 70 | "events_url": 71 | "https://api.github.com/users/matsushita-kentaro/events{/privacy}", 72 | "received_events_url": 73 | "https://api.github.com/users/matsushita-kentaro/received_events", 74 | "type": "User", 75 | "site_admin": false 76 | }, 77 | "assignees": [ 78 | { 79 | "login": "matsushita-kentaro", 80 | "id": 21993807, 81 | "avatar_url": "https://avatars2.githubusercontent.com/u/21993807?v=4", 82 | "gravatar_id": "", 83 | "url": "https://api.github.com/users/matsushita-kentaro", 84 | "html_url": "https://github.com/matsushita-kentaro", 85 | "followers_url": 86 | "https://api.github.com/users/matsushita-kentaro/followers", 87 | "following_url": 88 | "https://api.github.com/users/matsushita-kentaro/following{/other_user}", 89 | "gists_url": 90 | "https://api.github.com/users/matsushita-kentaro/gists{/gist_id}", 91 | "starred_url": 92 | "https://api.github.com/users/matsushita-kentaro/starred{/owner}{/repo}", 93 | "subscriptions_url": 94 | "https://api.github.com/users/matsushita-kentaro/subscriptions", 95 | "organizations_url": 96 | "https://api.github.com/users/matsushita-kentaro/orgs", 97 | "repos_url": "https://api.github.com/users/matsushita-kentaro/repos", 98 | "events_url": 99 | "https://api.github.com/users/matsushita-kentaro/events{/privacy}", 100 | "received_events_url": 101 | "https://api.github.com/users/matsushita-kentaro/received_events", 102 | "type": "User", 103 | "site_admin": false 104 | } 105 | ], 106 | "requested_reviewers": [ 107 | { 108 | "login": "matsushita-kentaro", 109 | "id": 21993807, 110 | "avatar_url": "https://avatars2.githubusercontent.com/u/21993807?v=4", 111 | "gravatar_id": "", 112 | "url": "https://api.github.com/users/matsushita-kentaro", 113 | "html_url": "https://github.com/matsushita-kentaro", 114 | "followers_url": 115 | "https://api.github.com/users/matsushita-kentaro/followers", 116 | "following_url": 117 | "https://api.github.com/users/matsushita-kentaro/following{/other_user}", 118 | "gists_url": 119 | "https://api.github.com/users/matsushita-kentaro/gists{/gist_id}", 120 | "starred_url": 121 | "https://api.github.com/users/matsushita-kentaro/starred{/owner}{/repo}", 122 | "subscriptions_url": 123 | "https://api.github.com/users/matsushita-kentaro/subscriptions", 124 | "organizations_url": 125 | "https://api.github.com/users/matsushita-kentaro/orgs", 126 | "repos_url": "https://api.github.com/users/matsushita-kentaro/repos", 127 | "events_url": 128 | "https://api.github.com/users/matsushita-kentaro/events{/privacy}", 129 | "received_events_url": 130 | "https://api.github.com/users/matsushita-kentaro/received_events", 131 | "type": "User", 132 | "site_admin": false 133 | } 134 | ], 135 | "requested_teams": [], 136 | "labels": [], 137 | "milestone": null, 138 | "commits_url": 139 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/5/commits", 140 | "review_comments_url": 141 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/5/comments", 142 | "review_comment_url": 143 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/comments{/number}", 144 | "comments_url": 145 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/5/comments", 146 | "statuses_url": 147 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/statuses/4c86c42d90d1506bfe20d771ecef0301556cc0c3", 148 | "head": { 149 | "label": "kentaro-m:kentaro-m-patch-1", 150 | "ref": "kentaro-m-patch-1", 151 | "sha": "4c86c42d90d15h78fe20d771ecef0301556cc0c3", 152 | "user": { 153 | "login": "kentaro-m", 154 | "id": 7448569, 155 | "avatar_url": "https://avatars0.githubusercontent.com/u/7448569?v=4", 156 | "gravatar_id": "", 157 | "url": "https://api.github.com/users/kentaro-m", 158 | "html_url": "https://github.com/kentaro-m", 159 | "followers_url": "https://api.github.com/users/kentaro-m/followers", 160 | "following_url": 161 | "https://api.github.com/users/kentaro-m/following{/other_user}", 162 | "gists_url": "https://api.github.com/users/kentaro-m/gists{/gist_id}", 163 | "starred_url": 164 | "https://api.github.com/users/kentaro-m/starred{/owner}{/repo}", 165 | "subscriptions_url": 166 | "https://api.github.com/users/kentaro-m/subscriptions", 167 | "organizations_url": "https://api.github.com/users/kentaro-m/orgs", 168 | "repos_url": "https://api.github.com/users/kentaro-m/repos", 169 | "events_url": 170 | "https://api.github.com/users/kentaro-m/events{/privacy}", 171 | "received_events_url": 172 | "https://api.github.com/users/kentaro-m/received_events", 173 | "type": "User", 174 | "site_admin": false 175 | }, 176 | "repo": { 177 | "id": 113575327, 178 | "name": "lambda-pr-notify-bot-test", 179 | "full_name": "kentaro-m/lambda-pr-notify-bot-test", 180 | "owner": { 181 | "login": "kentaro-m", 182 | "id": 7448569, 183 | "avatar_url": 184 | "https://avatars0.githubusercontent.com/u/7448569?v=4", 185 | "gravatar_id": "", 186 | "url": "https://api.github.com/users/kentaro-m", 187 | "html_url": "https://github.com/kentaro-m", 188 | "followers_url": "https://api.github.com/users/kentaro-m/followers", 189 | "following_url": 190 | "https://api.github.com/users/kentaro-m/following{/other_user}", 191 | "gists_url": 192 | "https://api.github.com/users/kentaro-m/gists{/gist_id}", 193 | "starred_url": 194 | "https://api.github.com/users/kentaro-m/starred{/owner}{/repo}", 195 | "subscriptions_url": 196 | "https://api.github.com/users/kentaro-m/subscriptions", 197 | "organizations_url": "https://api.github.com/users/kentaro-m/orgs", 198 | "repos_url": "https://api.github.com/users/kentaro-m/repos", 199 | "events_url": 200 | "https://api.github.com/users/kentaro-m/events{/privacy}", 201 | "received_events_url": 202 | "https://api.github.com/users/kentaro-m/received_events", 203 | "type": "User", 204 | "site_admin": false 205 | }, 206 | "private": false, 207 | "html_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test", 208 | "description": null, 209 | "fork": false, 210 | "url": 211 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test", 212 | "forks_url": 213 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/forks", 214 | "keys_url": 215 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/keys{/key_id}", 216 | "collaborators_url": 217 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/collaborators{/collaborator}", 218 | "teams_url": 219 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/teams", 220 | "hooks_url": 221 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/hooks", 222 | "issue_events_url": 223 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/events{/number}", 224 | "events_url": 225 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/events", 226 | "assignees_url": 227 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/assignees{/user}", 228 | "branches_url": 229 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/branches{/branch}", 230 | "tags_url": 231 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/tags", 232 | "blobs_url": 233 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/blobs{/sha}", 234 | "git_tags_url": 235 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/tags{/sha}", 236 | "git_refs_url": 237 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/refs{/sha}", 238 | "trees_url": 239 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/trees{/sha}", 240 | "statuses_url": 241 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/statuses/{sha}", 242 | "languages_url": 243 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/languages", 244 | "stargazers_url": 245 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/stargazers", 246 | "contributors_url": 247 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/contributors", 248 | "subscribers_url": 249 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/subscribers", 250 | "subscription_url": 251 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/subscription", 252 | "commits_url": 253 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/commits{/sha}", 254 | "git_commits_url": 255 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/commits{/sha}", 256 | "comments_url": 257 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/comments{/number}", 258 | "issue_comment_url": 259 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/comments{/number}", 260 | "contents_url": 261 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/contents/{+path}", 262 | "compare_url": 263 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/compare/{base}...{head}", 264 | "merges_url": 265 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/merges", 266 | "archive_url": 267 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/{archive_format}{/ref}", 268 | "downloads_url": 269 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/downloads", 270 | "issues_url": 271 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues{/number}", 272 | "pulls_url": 273 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls{/number}", 274 | "milestones_url": 275 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/milestones{/number}", 276 | "notifications_url": 277 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/notifications{?since,all,participating}", 278 | "labels_url": 279 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/labels{/name}", 280 | "releases_url": 281 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/releases{/id}", 282 | "deployments_url": 283 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/deployments", 284 | "created_at": "2017-12-08T13:06:20Z", 285 | "updated_at": "2017-12-08T13:06:20Z", 286 | "pushed_at": "2018-02-24T13:13:36Z", 287 | "git_url": "git://github.com/kentaro-m/lambda-pr-notify-bot-test.git", 288 | "ssh_url": "git@github.com:kentaro-m/lambda-pr-notify-bot-test.git", 289 | "clone_url": 290 | "https://github.com/kentaro-m/lambda-pr-notify-bot-test.git", 291 | "svn_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test", 292 | "homepage": null, 293 | "size": 1, 294 | "stargazers_count": 0, 295 | "watchers_count": 0, 296 | "language": null, 297 | "has_issues": true, 298 | "has_projects": true, 299 | "has_downloads": true, 300 | "has_wiki": true, 301 | "has_pages": false, 302 | "forks_count": 0, 303 | "mirror_url": null, 304 | "archived": false, 305 | "open_issues_count": 3, 306 | "license": null, 307 | "forks": 0, 308 | "open_issues": 3, 309 | "watchers": 0, 310 | "default_branch": "master" 311 | } 312 | }, 313 | "base": { 314 | "label": "kentaro-m:master", 315 | "ref": "master", 316 | "sha": "b4326e31d67b38ff399e47888008cde5fc10e799", 317 | "user": { 318 | "login": "kentaro-m", 319 | "id": 7448569, 320 | "avatar_url": "https://avatars0.githubusercontent.com/u/7448569?v=4", 321 | "gravatar_id": "", 322 | "url": "https://api.github.com/users/kentaro-m", 323 | "html_url": "https://github.com/kentaro-m", 324 | "followers_url": "https://api.github.com/users/kentaro-m/followers", 325 | "following_url": 326 | "https://api.github.com/users/kentaro-m/following{/other_user}", 327 | "gists_url": "https://api.github.com/users/kentaro-m/gists{/gist_id}", 328 | "starred_url": 329 | "https://api.github.com/users/kentaro-m/starred{/owner}{/repo}", 330 | "subscriptions_url": 331 | "https://api.github.com/users/kentaro-m/subscriptions", 332 | "organizations_url": "https://api.github.com/users/kentaro-m/orgs", 333 | "repos_url": "https://api.github.com/users/kentaro-m/repos", 334 | "events_url": 335 | "https://api.github.com/users/kentaro-m/events{/privacy}", 336 | "received_events_url": 337 | "https://api.github.com/users/kentaro-m/received_events", 338 | "type": "User", 339 | "site_admin": false 340 | }, 341 | "repo": { 342 | "id": 113575327, 343 | "name": "lambda-pr-notify-bot-test", 344 | "full_name": "kentaro-m/lambda-pr-notify-bot-test", 345 | "owner": { 346 | "login": "kentaro-m", 347 | "id": 7448569, 348 | "avatar_url": 349 | "https://avatars0.githubusercontent.com/u/7448569?v=4", 350 | "gravatar_id": "", 351 | "url": "https://api.github.com/users/kentaro-m", 352 | "html_url": "https://github.com/kentaro-m", 353 | "followers_url": "https://api.github.com/users/kentaro-m/followers", 354 | "following_url": 355 | "https://api.github.com/users/kentaro-m/following{/other_user}", 356 | "gists_url": 357 | "https://api.github.com/users/kentaro-m/gists{/gist_id}", 358 | "starred_url": 359 | "https://api.github.com/users/kentaro-m/starred{/owner}{/repo}", 360 | "subscriptions_url": 361 | "https://api.github.com/users/kentaro-m/subscriptions", 362 | "organizations_url": "https://api.github.com/users/kentaro-m/orgs", 363 | "repos_url": "https://api.github.com/users/kentaro-m/repos", 364 | "events_url": 365 | "https://api.github.com/users/kentaro-m/events{/privacy}", 366 | "received_events_url": 367 | "https://api.github.com/users/kentaro-m/received_events", 368 | "type": "User", 369 | "site_admin": false 370 | }, 371 | "private": false, 372 | "html_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test", 373 | "description": null, 374 | "fork": false, 375 | "url": 376 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test", 377 | "forks_url": 378 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/forks", 379 | "keys_url": 380 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/keys{/key_id}", 381 | "collaborators_url": 382 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/collaborators{/collaborator}", 383 | "teams_url": 384 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/teams", 385 | "hooks_url": 386 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/hooks", 387 | "issue_events_url": 388 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/events{/number}", 389 | "events_url": 390 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/events", 391 | "assignees_url": 392 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/assignees{/user}", 393 | "branches_url": 394 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/branches{/branch}", 395 | "tags_url": 396 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/tags", 397 | "blobs_url": 398 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/blobs{/sha}", 399 | "git_tags_url": 400 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/tags{/sha}", 401 | "git_refs_url": 402 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/refs{/sha}", 403 | "trees_url": 404 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/trees{/sha}", 405 | "statuses_url": 406 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/statuses/{sha}", 407 | "languages_url": 408 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/languages", 409 | "stargazers_url": 410 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/stargazers", 411 | "contributors_url": 412 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/contributors", 413 | "subscribers_url": 414 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/subscribers", 415 | "subscription_url": 416 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/subscription", 417 | "commits_url": 418 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/commits{/sha}", 419 | "git_commits_url": 420 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/commits{/sha}", 421 | "comments_url": 422 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/comments{/number}", 423 | "issue_comment_url": 424 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/comments{/number}", 425 | "contents_url": 426 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/contents/{+path}", 427 | "compare_url": 428 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/compare/{base}...{head}", 429 | "merges_url": 430 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/merges", 431 | "archive_url": 432 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/{archive_format}{/ref}", 433 | "downloads_url": 434 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/downloads", 435 | "issues_url": 436 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues{/number}", 437 | "pulls_url": 438 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls{/number}", 439 | "milestones_url": 440 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/milestones{/number}", 441 | "notifications_url": 442 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/notifications{?since,all,participating}", 443 | "labels_url": 444 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/labels{/name}", 445 | "releases_url": 446 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/releases{/id}", 447 | "deployments_url": 448 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/deployments", 449 | "created_at": "2017-12-08T13:06:20Z", 450 | "updated_at": "2017-12-08T13:06:20Z", 451 | "pushed_at": "2018-02-24T13:13:36Z", 452 | "git_url": "git://github.com/kentaro-m/lambda-pr-notify-bot-test.git", 453 | "ssh_url": "git@github.com:kentaro-m/lambda-pr-notify-bot-test.git", 454 | "clone_url": 455 | "https://github.com/kentaro-m/lambda-pr-notify-bot-test.git", 456 | "svn_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test", 457 | "homepage": null, 458 | "size": 1, 459 | "stargazers_count": 0, 460 | "watchers_count": 0, 461 | "language": null, 462 | "has_issues": true, 463 | "has_projects": true, 464 | "has_downloads": true, 465 | "has_wiki": true, 466 | "has_pages": false, 467 | "forks_count": 0, 468 | "mirror_url": null, 469 | "archived": false, 470 | "open_issues_count": 3, 471 | "license": null, 472 | "forks": 0, 473 | "open_issues": 3, 474 | "watchers": 0, 475 | "default_branch": "master" 476 | } 477 | }, 478 | "_links": { 479 | "self": { 480 | "href": 481 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/5" 482 | }, 483 | "html": { 484 | "href": 485 | "https://github.com/kentaro-m/lambda-pr-notify-bot-test/pull/5" 486 | }, 487 | "issue": { 488 | "href": 489 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/5" 490 | }, 491 | "comments": { 492 | "href": 493 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/5/comments" 494 | }, 495 | "review_comments": { 496 | "href": 497 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/5/comments" 498 | }, 499 | "review_comment": { 500 | "href": 501 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/comments{/number}" 502 | }, 503 | "commits": { 504 | "href": 505 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls/5/commits" 506 | }, 507 | "statuses": { 508 | "href": 509 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/statuses/4c86c42d90d1506bfe20d771ecef0301556cc0c3" 510 | } 511 | }, 512 | "author_association": "OWNER", 513 | "merged": false, 514 | "mergeable": true, 515 | "rebaseable": true, 516 | "mergeable_state": "clean", 517 | "merged_by": null, 518 | "comments": 0, 519 | "review_comments": 0, 520 | "maintainer_can_modify": false, 521 | "commits": 1, 522 | "additions": 1, 523 | "deletions": 0, 524 | "changed_files": 1 525 | }, 526 | "label": { 527 | "id": 847111253, 528 | "url": 529 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/labels/wip", 530 | "name": "wip", 531 | "color": "efb85f", 532 | "default": false 533 | }, 534 | "repository": { 535 | "id": 113575327, 536 | "name": "lambda-pr-notify-bot-test", 537 | "full_name": "kentaro-m/lambda-pr-notify-bot-test", 538 | "owner": { 539 | "login": "kentaro-m", 540 | "id": 7448569, 541 | "avatar_url": "https://avatars0.githubusercontent.com/u/7448569?v=4", 542 | "gravatar_id": "", 543 | "url": "https://api.github.com/users/kentaro-m", 544 | "html_url": "https://github.com/kentaro-m", 545 | "followers_url": "https://api.github.com/users/kentaro-m/followers", 546 | "following_url": 547 | "https://api.github.com/users/kentaro-m/following{/other_user}", 548 | "gists_url": "https://api.github.com/users/kentaro-m/gists{/gist_id}", 549 | "starred_url": 550 | "https://api.github.com/users/kentaro-m/starred{/owner}{/repo}", 551 | "subscriptions_url": 552 | "https://api.github.com/users/kentaro-m/subscriptions", 553 | "organizations_url": "https://api.github.com/users/kentaro-m/orgs", 554 | "repos_url": "https://api.github.com/users/kentaro-m/repos", 555 | "events_url": "https://api.github.com/users/kentaro-m/events{/privacy}", 556 | "received_events_url": 557 | "https://api.github.com/users/kentaro-m/received_events", 558 | "type": "User", 559 | "site_admin": false 560 | }, 561 | "private": false, 562 | "html_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test", 563 | "description": null, 564 | "fork": false, 565 | "url": "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test", 566 | "forks_url": 567 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/forks", 568 | "keys_url": 569 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/keys{/key_id}", 570 | "collaborators_url": 571 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/collaborators{/collaborator}", 572 | "teams_url": 573 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/teams", 574 | "hooks_url": 575 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/hooks", 576 | "issue_events_url": 577 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/events{/number}", 578 | "events_url": 579 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/events", 580 | "assignees_url": 581 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/assignees{/user}", 582 | "branches_url": 583 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/branches{/branch}", 584 | "tags_url": 585 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/tags", 586 | "blobs_url": 587 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/blobs{/sha}", 588 | "git_tags_url": 589 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/tags{/sha}", 590 | "git_refs_url": 591 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/refs{/sha}", 592 | "trees_url": 593 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/trees{/sha}", 594 | "statuses_url": 595 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/statuses/{sha}", 596 | "languages_url": 597 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/languages", 598 | "stargazers_url": 599 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/stargazers", 600 | "contributors_url": 601 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/contributors", 602 | "subscribers_url": 603 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/subscribers", 604 | "subscription_url": 605 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/subscription", 606 | "commits_url": 607 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/commits{/sha}", 608 | "git_commits_url": 609 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/git/commits{/sha}", 610 | "comments_url": 611 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/comments{/number}", 612 | "issue_comment_url": 613 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues/comments{/number}", 614 | "contents_url": 615 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/contents/{+path}", 616 | "compare_url": 617 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/compare/{base}...{head}", 618 | "merges_url": 619 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/merges", 620 | "archive_url": 621 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/{archive_format}{/ref}", 622 | "downloads_url": 623 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/downloads", 624 | "issues_url": 625 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/issues{/number}", 626 | "pulls_url": 627 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/pulls{/number}", 628 | "milestones_url": 629 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/milestones{/number}", 630 | "notifications_url": 631 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/notifications{?since,all,participating}", 632 | "labels_url": 633 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/labels{/name}", 634 | "releases_url": 635 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/releases{/id}", 636 | "deployments_url": 637 | "https://api.github.com/repos/kentaro-m/lambda-pr-notify-bot-test/deployments", 638 | "created_at": "2017-12-08T13:06:20Z", 639 | "updated_at": "2017-12-08T13:06:20Z", 640 | "pushed_at": "2018-02-24T13:13:36Z", 641 | "git_url": "git://github.com/kentaro-m/lambda-pr-notify-bot-test.git", 642 | "ssh_url": "git@github.com:kentaro-m/lambda-pr-notify-bot-test.git", 643 | "clone_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test.git", 644 | "svn_url": "https://github.com/kentaro-m/lambda-pr-notify-bot-test", 645 | "homepage": null, 646 | "size": 1, 647 | "stargazers_count": 0, 648 | "watchers_count": 0, 649 | "language": null, 650 | "has_issues": true, 651 | "has_projects": true, 652 | "has_downloads": true, 653 | "has_wiki": true, 654 | "has_pages": false, 655 | "forks_count": 0, 656 | "mirror_url": null, 657 | "archived": false, 658 | "open_issues_count": 3, 659 | "license": null, 660 | "forks": 0, 661 | "open_issues": 3, 662 | "watchers": 0, 663 | "default_branch": "master" 664 | }, 665 | "sender": { 666 | "login": "kentaro-m", 667 | "id": 7448569, 668 | "avatar_url": "https://avatars0.githubusercontent.com/u/7448569?v=4", 669 | "gravatar_id": "", 670 | "url": "https://api.github.com/users/kentaro-m", 671 | "html_url": "https://github.com/kentaro-m", 672 | "followers_url": "https://api.github.com/users/kentaro-m/followers", 673 | "following_url": 674 | "https://api.github.com/users/kentaro-m/following{/other_user}", 675 | "gists_url": "https://api.github.com/users/kentaro-m/gists{/gist_id}", 676 | "starred_url": 677 | "https://api.github.com/users/kentaro-m/starred{/owner}{/repo}", 678 | "subscriptions_url": 679 | "https://api.github.com/users/kentaro-m/subscriptions", 680 | "organizations_url": "https://api.github.com/users/kentaro-m/orgs", 681 | "repos_url": "https://api.github.com/users/kentaro-m/repos", 682 | "events_url": "https://api.github.com/users/kentaro-m/events{/privacy}", 683 | "received_events_url": 684 | "https://api.github.com/users/kentaro-m/received_events", 685 | "type": "User", 686 | "site_admin": false 687 | } 688 | }, 689 | "headers": { 690 | "X-GitHub-Event": "pull_request", 691 | "X-Hub-Signature": "sha1=0acdb3b56779297f93abd7273959587a1ef35415" 692 | }, 693 | "method": "POST", 694 | "params": {}, 695 | "query": {} 696 | } 697 | -------------------------------------------------------------------------------- /test/src/index.spec.js: -------------------------------------------------------------------------------- 1 | import sinon from 'sinon'; 2 | import { assert } from 'chai'; 3 | import rewire from 'rewire'; 4 | import requireReload from 'require-reload'; 5 | import readFixtures from '../../test/utils/fixtures'; 6 | import PullRequest from '../../src/pull_request'; 7 | import Slack from '../../src/slack'; 8 | 9 | /* global describe, it, beforeEach, afterEach */ 10 | 11 | describe('Index', () => { 12 | describe('Environment variable', () => { 13 | let callback; 14 | let event; 15 | let context; 16 | let env; 17 | 18 | beforeEach(() => { 19 | callback = sinon.spy(); 20 | event = { 21 | headers: { 22 | 'X-GitHub-Event': 'pull_request', 23 | 'X-Hub-Signature': 'sha1=36e4d168d0d6c6bd92f639f830420ccd840d6214', 24 | }, 25 | body: {}, 26 | }; 27 | context = {}; 28 | env = Object.assign({}, process.env); 29 | }); 30 | 31 | afterEach(() => { 32 | process.env = env; 33 | }); 34 | 35 | it('can throw a secret token no set error', async () => { 36 | const reload = requireReload(require); 37 | const index = reload('../../src/index.js'); 38 | await index.handler(event, context, callback); 39 | assert.match(callback.args[0], /Secret Token is not found./); 40 | }); 41 | 42 | it('can throw a slack api token no set error', async () => { 43 | process.env.SECRET_TOKEN = 'secret token'; 44 | const reload = requireReload(require); 45 | const index = reload('../../src/index.js'); 46 | await index.handler(event, context, callback); 47 | assert.match(callback.args[0], /Slack API Token is not found./); 48 | }); 49 | 50 | it('can throw a github api token no set error', async () => { 51 | process.env.SECRET_TOKEN = 'secret token'; 52 | process.env.SLACK_API_TOKEN = 'slack api token'; 53 | const reload = requireReload(require); 54 | const index = reload('../../src/index.js'); 55 | await index.handler(event, context, callback); 56 | assert.match(callback.args[0], /GitHub API Token is not found./); 57 | }); 58 | }); 59 | 60 | describe('calculateSignature', () => { 61 | let callback; 62 | let event; 63 | let context; 64 | let env; 65 | 66 | beforeEach(() => { 67 | callback = sinon.spy(); 68 | event = { 69 | headers: { 70 | 'X-GitHub-Event': 'pull_request', 71 | 'X-Hub-Signature': 'sha1=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 72 | }, 73 | body: {}, 74 | }; 75 | context = {}; 76 | env = Object.assign({}, process.env); 77 | }); 78 | 79 | afterEach(() => { 80 | process.env = env; 81 | }); 82 | 83 | it('can throw a secret token no set error', async () => { 84 | process.env.SECRET_TOKEN = 'secret token'; 85 | process.env.SLACK_API_TOKEN = 'slack api token'; 86 | process.env.GITHUB_API_TOKEN = 'github api token'; 87 | const reload = requireReload(require); 88 | const index = reload('../../src/index.js'); 89 | await index.handler(event, context, callback); 90 | assert.match( 91 | callback.args[0], 92 | /X-Hub-Signature and Calculated Signature do not match./ 93 | ); 94 | }); 95 | 96 | it('can throw a secret token no match error', async () => { 97 | process.env.SECRET_TOKEN = 'secret token'; 98 | process.env.SLACK_API_TOKEN = 'slack api token'; 99 | process.env.GITHUB_API_TOKEN = 'github api token'; 100 | process.env.SECRET_TOKEN = 'secret token'; 101 | const reload = requireReload(require); 102 | const index = reload('../../src/index.js'); 103 | await index.handler(event, context, callback); 104 | assert.match( 105 | callback.args[0], 106 | /X-Hub-Signature and Calculated Signature do not match./ 107 | ); 108 | }); 109 | }); 110 | 111 | describe('Pull Request Event', () => { 112 | let callback; 113 | let event; 114 | let context; 115 | let env; 116 | let sandbox; 117 | 118 | beforeEach(() => { 119 | callback = sinon.spy(); 120 | context = {}; 121 | process.env.SECRET_TOKEN = 'secret token'; 122 | process.env.SLACK_API_TOKEN = 'slack api token'; 123 | process.env.GITHUB_API_TOKEN = 'github api token'; 124 | process.env.SECRET_TOKEN = 'secret token'; 125 | env = Object.assign({}, process.env); 126 | sandbox = sinon.createSandbox(); 127 | sandbox.stub(Slack.prototype, 'postMessage').returns(Promise.resolve({})); 128 | const reload = requireReload(require); 129 | reload('../../src/handler'); 130 | }); 131 | 132 | afterEach(() => { 133 | process.env = env; 134 | sandbox.restore(); 135 | }); 136 | 137 | describe('handle a pull request event', () => { 138 | it('can send a review request message to reviewers using Slack', async () => { 139 | sandbox 140 | .stub(PullRequest.prototype, 'requestReview') 141 | .returns(Promise.resolve({})); 142 | sandbox 143 | .stub(PullRequest.prototype, 'assignReviewers') 144 | .returns(Promise.resolve({})); 145 | event = readFixtures('test/fixtures/request_review.json'); 146 | const index = rewire('../../src/index.js'); 147 | index.__set__('validateSignature', () => true); 148 | await index.handler(event, context, callback); 149 | assert.equal( 150 | callback.args[0][1].message, 151 | 'Pull request event processing has been completed' 152 | ); 153 | }); 154 | 155 | it('can send a review request message, when a wip label is removed from wip pull request.', async () => { 156 | sandbox 157 | .stub(PullRequest.prototype, 'requestReview') 158 | .returns(Promise.resolve({})); 159 | sandbox 160 | .stub(PullRequest.prototype, 'assignReviewers') 161 | .returns(Promise.resolve({})); 162 | event = readFixtures('test/fixtures/work_in_progress.json'); 163 | const index = rewire('../../src/index.js'); 164 | index.__set__('validateSignature', () => true); 165 | await index.handler(event, context, callback); 166 | assert.equal( 167 | callback.args[0][1].message, 168 | 'Pull request event processing has been completed' 169 | ); 170 | }); 171 | }); 172 | 173 | describe('handle a pull request review event', () => { 174 | it('can send a able merge message to the author using Slack', async () => { 175 | const reviewComments = readFixtures( 176 | 'test/fixtures/review_comments_approved.json' 177 | ); 178 | sandbox 179 | .stub(PullRequest.prototype, 'getReviewComments') 180 | .returns(Promise.resolve(reviewComments)); 181 | event = readFixtures('test/fixtures/merge.json'); 182 | const index = rewire('../../src/index.js'); 183 | index.__set__('validateSignature', () => true); 184 | await index.handler(event, context, callback); 185 | assert.equal( 186 | callback.args[0][1].message, 187 | 'Pull request review event processing has been completed' 188 | ); 189 | }); 190 | 191 | it('can send a mention message to a member using Slack', async () => { 192 | const reviewComments = readFixtures( 193 | 'test/fixtures/review_comments_changed.json' 194 | ); 195 | sandbox 196 | .stub(PullRequest.prototype, 'getReviewComments') 197 | .returns(Promise.resolve(reviewComments)); 198 | event = readFixtures('test/fixtures/mention_review.json'); 199 | const index = rewire('../../src/index.js'); 200 | index.__set__('validateSignature', () => true); 201 | await index.handler(event, context, callback); 202 | assert.equal( 203 | callback.args[0][1].message, 204 | 'Pull request review event processing has been completed' 205 | ); 206 | }); 207 | }); 208 | 209 | describe('handle a issue event', () => { 210 | it('can send a mention message to a member using Slack', async () => { 211 | event = readFixtures('test/fixtures/mention_issue.json'); 212 | const index = rewire('../../src/index.js'); 213 | index.__set__('validateSignature', () => true); 214 | await index.handler(event, context, callback); 215 | assert.equal( 216 | callback.args[0][1].message, 217 | 'Issue event processing has been completed' 218 | ); 219 | }); 220 | }); 221 | }); 222 | }); 223 | -------------------------------------------------------------------------------- /test/src/pull_request.spec.js: -------------------------------------------------------------------------------- 1 | import { assert } from 'chai'; 2 | import config from 'config'; 3 | 4 | import PullRequest from '../../src/pull_request'; 5 | import readFixtures from '../../test/utils/fixtures'; 6 | 7 | /* global describe, it */ 8 | 9 | describe('PullRequest', () => { 10 | const options = { 11 | debug: true, 12 | protocol: 'https', 13 | port: 443, 14 | host: 'api.github.com', 15 | pathPrefix: '', 16 | headers: { 17 | 'user-agent': 'PR-Bot', 18 | }, 19 | timeout: 10000, 20 | }; 21 | 22 | describe('constructor', () => { 23 | it('should initialize', () => { 24 | const pr = new PullRequest(options, 'dummy token'); 25 | assert.instanceOf(pr, PullRequest); 26 | }); 27 | }); 28 | 29 | describe('getApproveComments', () => { 30 | it('can create an array of approved comments', () => { 31 | const reviewComments = readFixtures( 32 | 'test/fixtures/review_comments_approved.json' 33 | ); 34 | const approveComments = PullRequest.getApproveComments( 35 | reviewComments, 36 | config.approveComments 37 | ); 38 | assert.equal(approveComments.length, 1); 39 | }); 40 | }); 41 | 42 | describe('parseMentionComment', () => { 43 | describe('including a user name in a comment', () => { 44 | it('can perse a mention comment', () => { 45 | const comment = '@taro request change'; 46 | const results = PullRequest.parseMentionComment(comment); 47 | 48 | const expected = { 49 | mentionUsers: ['taro'], 50 | }; 51 | 52 | assert.deepEqual(results, expected); 53 | }); 54 | }); 55 | 56 | describe('including multiple user names in a comment', () => { 57 | it('can perse a mention comment', () => { 58 | const comment = '@taro @ken request change'; 59 | const results = PullRequest.parseMentionComment(comment); 60 | 61 | const expected = { 62 | mentionUsers: ['taro', 'ken'], 63 | }; 64 | 65 | assert.deepEqual(results, expected); 66 | }); 67 | }); 68 | 69 | describe('not including a user name in a comment', () => { 70 | it('can perse a mention comment', () => { 71 | const comment = 'request change'; 72 | const results = PullRequest.parseMentionComment(comment); 73 | 74 | assert.deepEqual(results, { 75 | mentionUsers: [], 76 | }); 77 | }); 78 | }); 79 | }); 80 | }); 81 | -------------------------------------------------------------------------------- /test/src/slack.spec.js: -------------------------------------------------------------------------------- 1 | import { assert } from 'chai'; 2 | import config from 'config'; 3 | 4 | import Slack from '../../src/slack'; 5 | import readFixtures from '../../test/utils/fixtures'; 6 | 7 | /* global describe, it */ 8 | 9 | describe('Slack', () => { 10 | describe('constructor', () => { 11 | it('should initialize', () => { 12 | const slack = new Slack('dummy token'); 13 | assert.instanceOf(slack, Slack); 14 | }); 15 | }); 16 | 17 | describe('buildMessage', () => { 18 | it('can create a default message', () => { 19 | const expected = [ 20 | { 21 | color: '#36a64f', 22 | author_name: 'kentaro-m (lambda-pr-notify-bot-test)', 23 | author_icon: 'https://avatars0.githubusercontent.com/u/7448569?v=4', 24 | title: 'bot test 4', 25 | title_link: 26 | 'https://github.com/kentaro-m/lambda-pr-notify-bot-test/pull/19', 27 | text: 'Please review this pull request.', 28 | }, 29 | ]; 30 | 31 | const event = readFixtures('test/fixtures/request_review.json'); 32 | const payload = event.body; 33 | const message = Slack.buildMessage(payload, config.message.requestReview); 34 | assert.deepEqual(message, expected); 35 | }); 36 | 37 | it('can create a request review message', () => { 38 | const event = readFixtures('test/fixtures/request_review.json'); 39 | const payload = event.body; 40 | const message = Slack.buildMessage( 41 | payload, 42 | config.message.requestReview, 43 | 'requestReview' 44 | ); 45 | assert.match(message[0].text, /:eyes:/); 46 | }); 47 | 48 | it('can create a merge message', () => { 49 | const event = readFixtures('test/fixtures/merge.json'); 50 | const payload = event.body; 51 | const message = Slack.buildMessage( 52 | payload, 53 | config.message.ableToMerge, 54 | 'ableToMerge' 55 | ); 56 | assert.match(message[0].text, /:white_check_mark:/); 57 | }); 58 | 59 | it('can create a mention message (review comment)', () => { 60 | const event = readFixtures('test/fixtures/mention_review.json'); 61 | const payload = event.body; 62 | const message = Slack.buildMessage( 63 | payload, 64 | config.message.mentionComment, 65 | 'mentionComment' 66 | ); 67 | assert.match(message[0].fields[0].value, /Review Comment/); 68 | }); 69 | 70 | it('can create a mention message (issue comment)', () => { 71 | const event = readFixtures('test/fixtures/mention_issue.json'); 72 | const payload = event.body; 73 | const message = Slack.buildMessage( 74 | payload, 75 | config.message.mentionComment, 76 | 'mentionComment' 77 | ); 78 | assert.match(message[0].fields[0].value, /Issue Comment/); 79 | }); 80 | }); 81 | }); 82 | -------------------------------------------------------------------------------- /test/utils/fixtures.js: -------------------------------------------------------------------------------- 1 | import fs from 'fs'; 2 | 3 | export default function readFixtures(path) { 4 | try { 5 | const data = JSON.parse(fs.readFileSync(path, 'utf-8')); 6 | return data; 7 | } catch (error) { 8 | if (error.code === 'ENOENT') return null; 9 | throw error; 10 | } 11 | } 12 | --------------------------------------------------------------------------------