Skip to content

Commit 41d1155

Browse files
committed
update readme
1 parent 96c64f0 commit 41d1155

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ slack の過去ログを google sheet に書き出すツールです。
88
- github actions で実行可能、サーバー不要
99
- 公開リポジトリでセットアップ可能、トークン等の非公開情報は repository secrets に設定
1010

11+
デフォルトでは、実行日時の2か月前からの1か月分を1ファイルにします。
12+
13+
例: 10月x日に実行すると、 8/1 ~ 8/31 分のログを取得
14+
15+
1か月空けてあるのは、「スレッド返信はその発言元の時刻でしか取得できない」という、本システムの制限のためです。
16+
例えば、 9/30 の投稿に対し、10/2 にスレッド返信がついたとします。
17+
この返信は、9月のログを生成する際に取得されますが、10月のログには含まれません。
18+
10/1 に9月分を取得してしまうと、 10/2 のスレッドはどこにも記録されずに失われてしまうことになります。
19+
1120
# 準備
1221

1322
## slack bot の作成、 token の取得
@@ -61,3 +70,12 @@ jobs:
6170

6271
GOOGLE_PRIVATE_KEY はダウンロードした json の private_key の値だが、 \n を改行にあらかじめ置換してから github に登録する。
6372

73+
# オプション設定
74+
以下のように year, month を指定すると、指定の年月のログを取得します。
75+
76+
```
77+
- uses: kuboon/gsheet-slack-logger@main
78+
with:
79+
year: 2020
80+
month: 3
81+
```

src/monthly.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ let year, month
66
if (args.length < 2 || args[0] == "") {
77
const now = new Date
88
year = now.getFullYear()
9-
month = now.getMonth() + 1
9+
month = now.getMonth() + 1 - 2
1010
} else {
1111
year = parseInt(args[0])
1212
month = parseInt(args[1])

0 commit comments

Comments
 (0)