From a54c7cf3a94779249bc4c1349ddc613f88fac588 Mon Sep 17 00:00:00 2001 From: xuexb Date: Sun, 15 Oct 2017 22:10:28 +0800 Subject: [PATCH] docs: add a used document --- README.md | 26 ++++++++++++++++++++++++++ env | 7 +++++++ package.json | 4 +++- 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100755 env diff --git a/README.md b/README.md index 6fbedac..58eac11 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,32 @@ feat: 添加xx功能 docs: update install info ``` +## 如何使用 + +### 1. 创建 access tokens + + (_需要在 .env 里配置_) + +### 2. 创建 webhook + +https://github.com/用户名/项目名/settings/hooks/new + +- Payload URL: www.example.com:8000 +- Content type: application/json +- trigger: Send me everything. +- Secret: xxx (_需要在 .env 里配置_) + +### 3. run server + +``` +npm install +cp env .env +vim .env +npm start +``` + +### + ## contributors - [@yugasun](https://github.com/yugasun/) diff --git a/env b/env new file mode 100755 index 0000000..e88ab5c --- /dev/null +++ b/env @@ -0,0 +1,7 @@ +# rename this file to .env + +# Bot's personal access tokens, get from https://github.com/settings/tokens +GITHUB_TOKEN=token + +# Webhook secret token, see https://developer.github.com/webhooks/securing/ +GITHUB_SECRET_TOKEN=secret diff --git a/package.json b/package.json index 8270b57..7a32d12 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,9 @@ "description": "Github bot", "version": "0.0.1", "main": "src/app.js", - "scripts": {}, + "scripts": { + "start": "NODE_ENV=development node src/app" + }, "repository": { "type": "git", "url": "git+https://github.com/xuexb/github-bot.git"