Skip to content

Commit a54c7cf

Browse files
committed
docs: add a used document
1 parent f21325c commit a54c7cf

3 files changed

Lines changed: 36 additions & 1 deletion

File tree

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,32 @@ feat: 添加xx功能
6565
docs: update install info
6666
```
6767

68+
## 如何使用
69+
70+
### 1. 创建 access tokens
71+
72+
<https://github.com/settings/tokens>_需要在 .env 里配置_
73+
74+
### 2. 创建 webhook
75+
76+
https://github.com/用户名/项目名/settings/hooks/new
77+
78+
- Payload URL: www.example.com:8000
79+
- Content type: application/json
80+
- trigger: Send me everything.
81+
- Secret: xxx (_需要在 .env 里配置_
82+
83+
### 3. run server
84+
85+
```
86+
npm install
87+
cp env .env
88+
vim .env
89+
npm start
90+
```
91+
92+
###
93+
6894
## contributors
6995

7096
- [@yugasun](https://github.com/yugasun/)

env

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# rename this file to .env
2+
3+
# Bot's personal access tokens, get from https://github.com/settings/tokens
4+
GITHUB_TOKEN=token
5+
6+
# Webhook secret token, see https://developer.github.com/webhooks/securing/
7+
GITHUB_SECRET_TOKEN=secret

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
"description": "Github bot",
44
"version": "0.0.1",
55
"main": "src/app.js",
6-
"scripts": {},
6+
"scripts": {
7+
"start": "NODE_ENV=development node src/app"
8+
},
79
"repository": {
810
"type": "git",
911
"url": "git+https://github.com/xuexb/github-bot.git"

0 commit comments

Comments
 (0)