Skip to content

Commit

Permalink
Merge pull request #38 from iDerekLi/workflows
Browse files Browse the repository at this point in the history
Workflows
  • Loading branch information
iDerekLi authored May 31, 2022
2 parents d6dec78 + 93498d4 commit f729e15
Show file tree
Hide file tree
Showing 15 changed files with 123 additions and 576 deletions.
5 changes: 5 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## 处理自动化相关逻辑
base: `workflows` <- compare `your branch`

## 处理JueJinAPI相关逻辑
base: `package` <- compare `your branch`
1 change: 1 addition & 0 deletions .github/workflows/checkin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
EMAIL_PASS: ${{ secrets.EMAIL_PASS }}
EMAIL_TO: ${{ secrets.EMAIL_TO }}
DINGDING_WEBHOOK: ${{ secrets.DINGDING_WEBHOOK }}
PUSHPLUS_TOKEN: ${{ secrets.PUSHPLUS_TOKEN }}
run: |
yarn
yarn checkin
1 change: 1 addition & 0 deletions .github/workflows/seaGold.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
EMAIL_PASS: ${{ secrets.EMAIL_PASS }}
EMAIL_TO: ${{ secrets.EMAIL_TO }}
DINGDING_WEBHOOK: ${{ secrets.DINGDING_WEBHOOK }}
PUSHPLUS_TOKEN: ${{ secrets.PUSHPLUS_TOKEN }}
run: |
yarn
yarn seaGold
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@

2. 仓库 -> Settings -> Secrets -> New repository secret, 添加Secrets变量如下:

| Name | Value |
| --- | --- |
| COOKIE | 掘金网站Cookie, 打开浏览器,登录 [掘金](https://juejin.cn/), 打开控制台DevTools -> Network,复制 cookie, **掘金Cookie有效期约1个月需定期更新.** |
| DINGDING_WEBHOOK | 钉钉机器人WEBHOOK |
| EMAIL_USER | 发件人邮箱地址(需要开启 SMTP) |
| EMAIL_PASS | 发件人邮箱密码(SMTP密码) |
| EMAIL_TO | 订阅人邮箱地址(收件人). 如需多人订阅使用 `, ` 分割, 例如: `[email protected], [email protected]` |
| Name | Value | 是否必填 |
| --- | --- | --- |
| COOKIE | 掘金网站Cookie, 打开浏览器,登录 [掘金](https://juejin.cn/), 打开控制台DevTools -> Network,复制 cookie, **掘金Cookie有效期约1个月需定期更新.** ||
| DINGDING_WEBHOOK | 钉钉机器人WEBHOOK ||
| EMAIL_USER | 发件人邮箱地址(需要开启 SMTP) ||
| EMAIL_PASS | 发件人邮箱密码(SMTP密码) ||
| EMAIL_TO | 订阅人邮箱地址(收件人). 如需多人订阅使用 `, ` 分割, 例如: `[email protected], [email protected]` ||
| PUSHPLUS_TOKEN | [Pushplus](http://www.pushplus.plus/) 官网免费申请,支持微信公众号、第三方webhook、企业微信、邮箱。 ||

3. 仓库 -> Actions, 检查Workflows并启用。

Expand Down
11 changes: 5 additions & 6 deletions scripts/checkin.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const JuejinHelper = require("juejin-helper");
const utils = require("./utils/utils");
const email = require("./utils/email");
const pushMessage = require("./utils/pushMessage");
const env = require("./utils/env");

class CheckIn {
Expand Down Expand Up @@ -199,18 +199,17 @@ async function run(args) {

console.log(content); // 打印结果

email({
pushMessage({
subject: "掘金每日签到",
text: content
});
utils.dingding(content);
})
}

run(process.argv.splice(2)).catch(error => {
email({
pushMessage({
subject: "掘金每日签到",
html: `<strong>Error</strong><pre>${error.message}</pre>`
});
})

throw error;
});
214 changes: 0 additions & 214 deletions scripts/juejin-console-script.js

This file was deleted.

Loading

0 comments on commit f729e15

Please sign in to comment.