名称: meeting-prep
描述: "自动化会议准备与每日提交摘要。用于检查 Google 日历中的即将到来的会议、从 GitHub 提交生成站会更新或发送每日开发摘要。提取会议安排和提交历史,并格式化为详细的开发者友好更新。"
为开发团队提供自动化会议准备和每日提交摘要。
在 Google Cloud Console 中创建 OAuth 凭据:
client_secret.json 存储在 credentials/ 目录中https://www.googleapis.com/auth/calendarcredentials/calendar_tokens.json对于多个账户,请为每个账户存储单独的令牌文件。
创建一个具有 repo 范围的经典个人访问令牌。存储在 credentials/github_token。
触发方式:每 15 分钟或心跳触发一次 Cron。
hangoutLink 或 conferenceData)触发方式:每日结束时触发 Cron。
NOW=$(date -u +%Y-%m-%dT%H:%M:%SZ)
LATER=$(date -u -d "+45 minutes" +%Y-%m-%dT%H:%M:%SZ)
TOKEN=$(jq -r '.access_token' credentials/calendar_tokens.json)
curl -s "https://www.googleapis.com/calendar/v3/calendars/primary/events?timeMin=$NOW&timeMax=$LATER&singleEvents=true" \
-H "Authorization: Bearer $TOKEN" | \
jq '[.items[] | select(.hangoutLink != null or .conferenceData != null)]'
CLIENT_ID=$(jq -r '.installed.client_id' credentials/client_secret.json)
CLIENT_SECRET=$(jq -r '.installed.client_secret' credentials/client_secret.json)
REFRESH_TOKEN=$(jq -r '.refresh_token' credentials/calendar_tokens.json)
curl -s -X POST https://oauth2.googleapis.com/token \
-d "client_id=$CLIENT_ID" \
-d "client_secret=$CLIENT_SECRET" \
-d "refresh_token=$REFRESH_TOKEN" \
-d "grant_type=refresh_token"
TOKEN=$(cat credentials/github_token)
SINCE=$(date -u -d "-7 days" +%Y-%m-%dT%H:%M:%SZ)
# 列出组织代码库
curl -s -H "Authorization: Bearer $TOKEN" \
"https://api.github.com/orgs/ORG_NAME/repos?per_page=50&sort=pushed"
# 获取提交
curl -s -H "Authorization: Bearer $TOKEN" \
"https://api.github.com/repos/ORG/REPO/commits?since=$SINCE&per_page=30"
纯文本,无 Markdown,无表情符号:
更新 - [日期]
[代码库名称]
[子目录]
• 详细的变更描述(作者)
• 另一项变更(作者)
今日
• [用户输入]
阻碍
• 无
讨论
• 无
在 data/meeting-prep-state.json 中跟踪状态:
{
"notified": {},
"config": {
"repoFilter": "org-name/*"
}
}