forked from tibdex/backport
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
54db53f
commit f4a64b0
Showing
7 changed files
with
308 additions
and
774 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"builds": [{ "src": "app/index.js", "use": "@now/node" }], | ||
"env": { | ||
"APP_ID": "@backport-app-id", | ||
"DEBUG": "@backport-debug", | ||
"LOG_LEVEL": "@backport-log-level", | ||
"PRIVATE_KEY": "@backport-base64-encoded-private-key", | ||
"SENTRY_DSN": "@backport-sentry-dsn", | ||
"WEBHOOK_SECRET": "@backport-webhook-secret" | ||
}, | ||
"routes": [{ "src": "/", "dest": "app/index.js" }], | ||
"version": 2 | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Application, Context } from "probot"; | ||
|
||
import handleEvent from "./backport"; | ||
|
||
const appFn = (app: Application) => { | ||
app.log("App loaded"); | ||
|
||
app.on( | ||
["pull_request.labeled", "pull_request.closed"], | ||
async (context: Context) => { | ||
const { payload, github: octokit } = context; | ||
const { number: pullRequestNumber, owner, repo } = context.issue(); | ||
await handleEvent({ | ||
// @ts-ignore The value is the good one even if the type doesn't match. | ||
octokit, | ||
owner, | ||
payload, | ||
pullRequestNumber, | ||
repo, | ||
}); | ||
}, | ||
); | ||
}; | ||
|
||
export = appFn; |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,5 @@ | ||
import { Application, Context } from "probot"; | ||
import * as toLambda from "probot-serverless-now"; | ||
|
||
import handleEvent from "./backport"; | ||
import * as applicationFunction from "./app"; | ||
|
||
module.exports = (app: Application) => { | ||
app.log("App loaded"); | ||
|
||
app.on( | ||
["pull_request.labeled", "pull_request.closed"], | ||
async (context: Context) => { | ||
const { payload, github: octokit } = context; | ||
const { number: pullRequestNumber, owner, repo } = context.issue(); | ||
await handleEvent({ | ||
// @ts-ignore The value is the good one even if the type doesn't match. | ||
octokit, | ||
owner, | ||
payload, | ||
pullRequestNumber, | ||
repo, | ||
}); | ||
}, | ||
); | ||
}; | ||
export = toLambda(applicationFunction); |
Oops, something went wrong.