File tree Expand file tree Collapse file tree 3 files changed +43
-2
lines changed Expand file tree Collapse file tree 3 files changed +43
-2
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ before_script:
2929script :
3030 - ./cmp.sh
3131 - .travis/test-part.sh
32+
33+ after_success :
3234 - .travis/report.sh
3335
3436deploy :
Original file line number Diff line number Diff line change 1+ let github = require ( 'octonode' ) ;
2+
3+ var client = github . client ( process . env . GITHUB_TOKEN ) ;
4+
5+ async function getBotInfo ( ) {
6+ let ghme = client . me ( ) ;
7+ const result = await ghme . infoAsync ( ) ;
8+ return result [ 0 ] ;
9+ }
10+
11+ var ghpr = client . issue ( process . env . TRAVIS_REPO_SLUG , process . env . TRAVIS_PULL_REQUEST ) ;
12+
13+ async function removeBotComments ( bot ) {
14+ let result = await ghpr . commentsAsync ( ) ;
15+ let comments = result [ 0 ] ;
16+ for ( let i = 0 ; i < comments . length ; i ++ ) {
17+ comment = comments [ i ] ;
18+ if ( bot == comment . user . login ) {
19+ await ghpr . deleteCommentAsync ( comment . id ) ;
20+ }
21+ }
22+ }
23+
24+ async function main ( ) {
25+ let botInfo = await getBotInfo ( ) ;
26+ await removeBotComments ( botInfo . login ) ;
27+ }
28+
29+ main ( ) ;
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- node contractSizeReport.js $TRAVIS_PULL_REQUEST_BRANCH
4- node gasUsedReport.js $TRAVIS_PULL_REQUEST_BRANCH
3+ sizeReport = ` node contractSizeReport.js $TRAVIS_PULL_REQUEST_BRANCH `
4+ gasReport = ` node gasUsedReport.js $TRAVIS_PULL_REQUEST_BRANCH `
5+
6+ if [[ $TRAVIS_PULL_REQUEST ]]; then
7+ node travis/remove-all-bot-comment.js
8+ curl -H " Authorization: token ${GITHUB_TOKEN} " -X POST \
9+ -d " {\" body\" : \" $sizeReport \" }" \
10+ " https://api.github.com/repos/${TRAVIS_REPO_SLUG} /issues/${TRAVIS_PULL_REQUEST} /comments"
11+
12+ curl -H " Authorization: token ${GITHUB_TOKEN} " -X POST \
13+ -d " {\" body\" : \" $gasReport \" }" \
14+ " https://api.github.com/repos/${TRAVIS_REPO_SLUG} /issues/${TRAVIS_PULL_REQUEST} /comments"
You can’t perform that action at this time.
0 commit comments