Skip to content
This repository was archived by the owner on Oct 17, 2019. It is now read-only.

Commit 6055528

Browse files
committed
Add project files
1 parent 4f4f524 commit 6055528

File tree

6 files changed

+85
-4
lines changed

6 files changed

+85
-4
lines changed

Diff for: LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Jason Etcovitch
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Diff for: README.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,4 @@ _A 2018 GitHub Universe Workshop_
55
### Workshop Pre-requisites
66

77
- A GitHub.com account
8-
- Node.js and NPM installed
9-
- `brew install node`
10-
- https://nodejs.org/en/
11-
- A code editor (Atom, VSCode, Notepad++, etc)
8+
- Excitement

Diff for: app.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public: false
2+
default_events:
3+
- issue_comment
4+
default_permissions:
5+
issues: write

Diff for: finished-code.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const { Translate } = require('@google-cloud/translate')
2+
3+
module.exports = app => {
4+
const translator = new Translate({ key: process.env.TRANSLATE_API_TOKEN })
5+
6+
app.on('issue_comment.created', async context => {
7+
const { body, id } = context.payload.comment
8+
9+
const translated = await translator.translate(body, 'fr')
10+
const details = `<details>\n<summary>French</summary>\n\n${translated[0]}\n</details>`
11+
12+
return context.github.issues.editComment(context.issue({
13+
body: body + '\n\n---\n\n' + details,
14+
comment_id: id
15+
}))
16+
})
17+
}

Diff for: index.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = (app) => {
2+
app.log('Yay! The app was loaded!!!')
3+
4+
app.on('issue_comment.created', async context => {
5+
// A new issue comment was created!
6+
// Let's log the body of the comment, to see what was said.
7+
console.log(context.payload.comment.body)
8+
})
9+
}

Diff for: package.json

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"//1": "describes your app and its dependencies",
3+
"//2": "https://docs.npmjs.com/files/package.json",
4+
"//3": "updating this file will download and update your packages",
5+
"version": "1.0.0",
6+
"description": "",
7+
"author": "github-username <email-address>",
8+
"repository": "https://github.com/probot/probot",
9+
"license": "MIT",
10+
"scripts": {
11+
"dev": "nodemon --exec \"npm start\"",
12+
"start": "probot run ./index.js",
13+
"test": "jest && standard"
14+
},
15+
"dependencies": {
16+
"probot": "^7.2.0"
17+
},
18+
"devDependencies": {
19+
"jest": "^23.2.0",
20+
"smee-client": "^1.0.1",
21+
"standard": "^11.0.1"
22+
},
23+
"engines": {
24+
"node": "8.9",
25+
"npm": "5.6"
26+
},
27+
"standard": {
28+
"env": [
29+
"jest"
30+
]
31+
}
32+
}

0 commit comments

Comments
 (0)