Skip to content

Commit 42e6aa4

Browse files
committed
Some stuff
1 parent 4d4e744 commit 42e6aa4

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ module.exports = app => {
6565

6666
app.on(["pull_request.opened", "pull_request.synchronize"], async context => {
6767
try {
68-
console.log(process.env.NOW_GITHUB_COMMIT_REF);
6968
let number = context.payload.number;
7069

7170
let repo = {

now.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,20 @@ const { createProbot } = require("probot");
44
const { findPrivateKey } = require("probot/lib/private-key");
55
const appFn = require("./");
66

7+
process.env.PRIVATE_KEY =
8+
process.env.NOW_GITHUB_COMMIT_REF === "master"
9+
? process.env.PROD_PRIVATE_KEY
10+
: process.env.DEV_PRIVATE_KEY;
11+
712
const options = {
8-
id: process.env.APP_ID,
9-
secret: process.env.WEBHOOK_SECRET,
13+
id:
14+
process.env.NOW_GITHUB_COMMIT_REF === "master"
15+
? process.env.PROD_APP_ID
16+
: process.env.DEV_APP_ID,
17+
secret:
18+
process.env.NOW_GITHUB_COMMIT_REF === "master"
19+
? process.env.PROD_WEBHOOK_SECRET
20+
: process.env.DEV_WEBHOOK_SECRET,
1021
cert: findPrivateKey()
1122
};
1223

now.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
"version": 2,
33
"scope": "changesets",
44
"env": {
5-
"APP_ID": "@app-id",
6-
"WEBHOOK_SECRET": "@webhook-secret",
7-
"PRIVATE_KEY": "@private-key-base64-encoded"
5+
"PROD_APP_ID": "@prod-app-id",
6+
"PROD_WEBHOOK_SECRET": "@prod-webhook-secret",
7+
"PROD_PRIVATE_KEY": "@prod-private-key-base64-encoded",
8+
"DEV_APP_ID": "@dev-app-id",
9+
"DEV_WEBHOOK_SECRET": "@dev-webhook-secret",
10+
"DEV_PRIVATE_KEY": "@dev-private-key-base64-encoded"
811
},
912
"builds": [{ "src": "now.js", "use": "@now/node" }],
1013
"routes": [{ "src": "/", "dest": "/now.js" }]

0 commit comments

Comments
 (0)