Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9a839e0

Browse files
committed
test again if comment works from travis
1 parent 1e4ee11 commit 9a839e0

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

scripts/now.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#! /usr/bin/env node
22
/* eslint-disable camelcase */
3-
console.log(`PR: ${process.env.TRAVIS_PULL_REQUEST}`);
43
const github = require('octonode');
54
const normalizeUrl = require('normalize-url');
65
const spawn = require('cross-spawn');
@@ -25,7 +24,7 @@ if (!nowToken) {
2524
throw new Error('Missing required environment variable NOW_TOKEN');
2625
}
2726

28-
console.log(`PR: ${process.env.TRAVIS_PULL_REQUEST}`);
27+
console.log(process.env.TRAVIS_PULL_REQUEST);
2928

3029
const client = github.client(githubToken);
3130
const ghRepo = client.repo(process.env.TRAVIS_REPO_SLUG);
@@ -42,7 +41,7 @@ function noop() {}
4241

4342
function getUrl(content) {
4443
const urls = content.match(urlRegex()) || [];
45-
console.log(`PR: ${process.env.TRAVIS_PULL_REQUEST}`);
44+
4645
return urls.map(url => normalizeUrl(url.trim().replace(/\.+$/, '')))[0];
4746
}
4847

@@ -104,14 +103,18 @@ function deploy(context, sha) {
104103

105104
child.on('close', () => {
106105
const target_url = alias || getUrl(stdout);
107-
console.log(`PR: ${process.env.TRAVIS_PULL_REQUEST}`);
108106
if (ghPR) {
109-
const comment = `(Note: This is autogenerated through Travis build) New Staging URL : ${target_url}`;
110-
console.log(comment);
107+
const comment = `
108+
### Δ Now ${context} deployment complete
109+
- ✅ **Build Passed**
110+
- 🚀 **Staging URL** : ${target_url}
111+
---
112+
Note: **This is autogenerated through Travis build**
113+
`;
111114
ghPR.createComment(
112115
{
113116
body: comment,
114-
in_reply_to: 1,
117+
in_reply_to: 147402206,
115118
},
116119
(err, res) => {
117120
console.log(err, res);

0 commit comments

Comments
 (0)