File tree Expand file tree Collapse file tree 3 files changed +19
-6
lines changed Expand file tree Collapse file tree 3 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,6 @@ module.exports = app => {
65
65
66
66
app . on ( [ "pull_request.opened" , "pull_request.synchronize" ] , async context => {
67
67
try {
68
- console . log ( process . env . NOW_GITHUB_COMMIT_REF ) ;
69
68
let number = context . payload . number ;
70
69
71
70
let repo = {
Original file line number Diff line number Diff line change @@ -4,9 +4,20 @@ const { createProbot } = require("probot");
4
4
const { findPrivateKey } = require ( "probot/lib/private-key" ) ;
5
5
const appFn = require ( "./" ) ;
6
6
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
+
7
12
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 ,
10
21
cert : findPrivateKey ( )
11
22
} ;
12
23
Original file line number Diff line number Diff line change 2
2
"version" : 2 ,
3
3
"scope" : " changesets" ,
4
4
"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"
8
11
},
9
12
"builds" : [{ "src" : " now.js" , "use" : " @now/node" }],
10
13
"routes" : [{ "src" : " /" , "dest" : " /now.js" }]
You can’t perform that action at this time.
0 commit comments