This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let XGithubDelivery = getXGithubDelivery(header); | |
| let XGithubEvent = getXGithubEvent(header); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getPullRequestBranch(payload) { | |
| return pullRequestBranch = delve(payload, 'pull_request.head.ref'); | |
| } | |
| function getBaseBranch(payload) { | |
| return baseBranch = delve(payload, 'pull_request.base.ref'); | |
| } | |
| function getCommitURL(payload) { | |
| return commitURL = delve(payload, 'pull_request.statuses_url'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| app.post("/hook", (req, res) => { | |
| let payload = req.body; | |
| let header = req.headers; | |
| res.status(200).end() | |
| let pullRequestBranch = getPullRequestBranch(payload); | |
| let baseBranch = getBaseBranch(payload); | |
| let commitURL = getCommitURL(payload); | |
| let action = getAction(payload); | |
| let XGithubDelivery = getXGithubDelivery(header); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Require express and body-parser | |
| const express = require("express"); | |
| const bodyParser = require("body-parser"); | |
| const delve = require('dlv'); | |
| const axios = require('axios'); | |
| const FormData = require('form-data'); | |
| // Initialize express and define a port | |
| const app = express(); |
NewerOlder