做了一个使用 Notion 自动管理 GitHub Star 的 repo 小工具(via GitHub Actions)

2021-10-08 10:43:14 +08:00
 emlcj
Hi,我做了一个使用 Notion 自动管理 GitHub Star 的小工具,会借助 GitHub Actions 去同步(全量或者增量) Star 到 Notion 的 database,并且可以在 Notion 上进行一些标记(比如打标签、设置批注等),大家有兴趣可以试用一下~

文档在: https://www.notion.so/lcj/ed1a50d5b57b4bca8a8ec3509c38f5ed
Showcase 在: https://www.notion.so/lcj/597ca47341074f10a8a754378f470411?v=0140b25047c84ec8bc562e6106937b75
5220 次点击
所在节点    分享创造
42 条回复
greatHair
2021-10-08 11:01:01 +08:00
好东西,帮顶
fkue0487
2021-10-08 11:35:56 +08:00
好东西。报错了什么原因啊。

Notion: error from recover cache Error: ENOENT: no such file or directory, open '/home/runner/work/github-notion-star/github-notion-star/.cache/notion-page.json'
kongkongyzt
2021-10-08 12:32:30 +08:00
好的惹
emlcj
2021-10-08 12:41:22 +08:00
@fkue0487 这个报错可以忽略,这个是尝试使用之前缓存下来的数据信息
kongkongyzt
2021-10-08 12:48:12 +08:00
试了一下, 确实不错, 方便管理我的 github star ✅
KAAAsS
2021-10-08 14:06:28 +08:00
好评!就是管理之前的 Star 好痛苦,快将近 1000……
sd539994389
2021-10-08 14:20:22 +08:00
好东西 谢谢分享
SenLief
2021-10-08 14:23:09 +08:00
挺好的,每次碰到以后可能有用的都会 star 一下,但是后面就找不到了。
ryougifujino
2021-10-08 14:29:08 +08:00
不错
CoderTom
2021-10-08 15:50:32 +08:00
不错
longline
2021-10-08 16:04:23 +08:00
同二楼报错
raysmond
2021-10-08 16:58:54 +08:00
支持
emlcj
2021-10-08 17:15:02 +08:00
@KAAAsS 所以我选择先不管…或者每天发呆的时候标记几个


@longline 那个报错没有任何影响的,可以检查下其他三个环境变量是否都提供了
xdashan
2021-10-08 17:40:41 +08:00
报错,求指点
Notion: error from recover cache Error: ENOENT: no such file or directory, open '/home/runner/work/github-notion-star/github-notion-star/.cache/notion-page.json'
at Object.openSync (node:fs:585:3)
at Object.readFileSync (node:fs:453:35)
at Object.get (/home/runner/work/github-notion-star/github-notion-star/libs/cache.ts:18:31)
at new Notion (/home/runner/work/github-notion-star/github-notion-star/libs/notion.ts:19:22)
at Object.<anonymous> (/home/runner/work/github-notion-star/github-notion-star/libs/notion.ts:132:23)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Module.m._compile (/home/runner/work/github-notion-star/github-notion-star/node_modules/ts-node/src/index.ts:1225:23)
at Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Object.require.extensions.<computed> [as .ts] (/home/runner/work/github-notion-star/github-notion-star/node_modules/ts-node/src/index.ts:1228:12)
at Module.load (node:internal/modules/cjs/loader:981:32) {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: '/home/runner/work/github-notion-star/github-notion-star/.cache/notion-page.json'
}
Notion: restored from cache, count is 0
Github: Start to get all starred repos, limit is 20
Notion: Start to get all pages
Github: Get all starred repos success, count is 55

/home/runner/work/github-notion-star/github-notion-star/libs/notion.ts:67
pages.forEach((page) => {
^
TypeError: Cannot read properties of undefined (reading 'plain_text')
at /home/runner/work/github-notion-star/github-notion-star/libs/notion.ts:68:54
at Array.forEach (<anonymous>)
at Notion.addPages (/home/runner/work/github-notion-star/github-notion-star/libs/notion.ts:67:15)
at Notion.fullSyncIfNeeded (/home/runner/work/github-notion-star/github-notion-star/libs/notion.ts:55:18)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Promise.all (index 1)
at fullSync (/home/runner/work/github-notion-star/github-notion-star/main.ts:6:5)
Error: Process completed with exit code 1.
kappa
2021-10-08 17:44:20 +08:00
@emlcj 请问 Tagged 那一栏有什么用?
xdashan
2021-10-08 17:44:25 +08:00
@xdashan notion 表里有一条空数据,删了同步成功了
kappa
2021-10-08 17:44:57 +08:00
另外 unstar 的项目好像不会被自动删除
emlcj
2021-10-08 17:59:56 +08:00
@kappa 那个是方便我自己用的。我这边是会给 star 的 repo 打 tag,打完 tag 之后就用这个属性来标记一下。

当然这个属性是可以删除的,不会影响现有功能。
emlcj
2021-10-08 18:03:18 +08:00
@kappa 对,目前还不支持 unstar 的项目也在 notion 那边同步删除
d5
2021-10-08 19:32:44 +08:00
这个很酷,收藏了 🎉

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/806349

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX