-
Notifications
You must be signed in to change notification settings - Fork 343
report GitHub comment #1065
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
report GitHub comment #1065
Changes from all commits
4d2292d
535bf55
bb7fe9e
34dcc81
5bb0401
649a9bc
995f4f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| let github = require('octonode'); | ||
|
|
||
| var client = github.client(process.env.GITHUB_TOKEN); | ||
|
|
||
| async function getBotInfo() { | ||
| let ghme = client.me(); | ||
| const result = await ghme.infoAsync(); | ||
| return result[0]; | ||
| } | ||
|
|
||
| var ghpr = client.issue(process.env.TRAVIS_REPO_SLUG, process.env.TRAVIS_PULL_REQUEST); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please use let. and I don'lt understand the name again. |
||
|
|
||
| async function removeBotComments(bot) { | ||
| let result = await ghpr.commentsAsync(); | ||
| let comments = result[0]; | ||
| for (let i = 0; i < comments.length; i++) { | ||
| comment = comments[i]; | ||
| if (bot == comment.user.login) { | ||
| await ghpr.deleteCommentAsync(comment.id); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| async function main() { | ||
| let botInfo = await getBotInfo(); | ||
| await removeBotComments(botInfo.login); | ||
| } | ||
|
|
||
| main(); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,19 @@ | ||
| #!/bin/bash | ||
|
|
||
| node contractSizeReport.js $TRAVIS_PULL_REQUEST_BRANCH | ||
| node gasUsedReport.js $TRAVIS_PULL_REQUEST_BRANCH | ||
| readonly test_part=${TEST_PART:-} | ||
| case "$test_part" in | ||
| All) | ||
| if [[ $TRAVIS_PULL_REQUEST ]]; then | ||
| export sizeReport=$(node contractSizeReport.js $TRAVIS_PULL_REQUEST_BRANCH) | ||
| export gasReport=$(node gasUsedReport.js $TRAVIS_PULL_REQUEST_BRANCH) | ||
| node travis/remove-all-bot-comment.js | ||
| curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST \ | ||
| -d "{\"body\": \"$sizeReport\"}" \ | ||
| "https://api.github.com/repos/${TRAVIS_REPO_SLUG}/issues/${TRAVIS_PULL_REQUEST}/comments" | ||
|
|
||
| curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST \ | ||
| -d "{\"body\": \"$gasReport\"}" \ | ||
| "https://api.github.com/repos/${TRAVIS_REPO_SLUG}/issues/${TRAVIS_PULL_REQUEST}/comments" | ||
| fi | ||
| ;; | ||
| esac |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,7 @@ | |
| "ethers": "5.0.4", | ||
| "ganache-cli": "6.8.2", | ||
| "mathjs": "4.4.2", | ||
| "octonode": "^0.9.5", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please remove ˆ |
||
| "rlp": "2.2.4", | ||
| "secp256k1": "3.8.0", | ||
| "sha3": "2.1.1", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the name.
what is ghme?