Skip to content

Commit

Permalink
Refactor publish_to_feishu_bitable to publish_to_feishu_document
Browse files Browse the repository at this point in the history
  • Loading branch information
imjszhang committed Oct 17, 2024
1 parent 8c1f13e commit 8b94852
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish_to_feishu_docx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch: # 手动触发

jobs:
publish_to_feishu_bitable:
publish_to_feishu_document:
runs-on: ubuntu-latest
env:
PUBLISH_ENABLED: 'true' # 设置环境变量,控制是否启用发布
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update_feishu_daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch: # 手动触发

jobs:
publish_to_feishu_bitable:
update_feishu_daily:
runs-on: ubuntu-latest
env:
PUBLISH_ENABLED: 'true' # 设置环境变量,控制是否启用发布
Expand All @@ -28,7 +28,7 @@ jobs:
pip install pytz
pip install requests
- name: Publish to Feishu Document
- name: Update Feishu Daily
if: ${{ env.PUBLISH_ENABLED == 'true' }}
env:
FEISHU_APP_ID: ${{ secrets.FEISHU_APP_ID }}
Expand Down
5 changes: 2 additions & 3 deletions scripts/update_feishu_daily.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

FEISHU_APP_ID = os.getenv('FEISHU_APP_ID')
FEISHU_APP_SECRET= os.getenv('FEISHU_APP_SECRET')
FEISHU_DOCX_FOLDER_TOKEN = os.getenv('FEISHU_DOCX_FOLDER_TOKEN')

# 初始化 FeishuDocxAPIHandler
feishu_docx_api_handler = FeishuDocxAPIHandler(FEISHU_APP_ID, FEISHU_APP_SECRET)
Expand All @@ -24,7 +23,7 @@ def get_file_url_by_date(date_str):
"""
根据日期,获取文件夹里特定名字的文件
"""
folder_token=FEISHU_DOCX_FOLDER_TOKEN
folder_token="Fyj3fEqQ4lMMkZdwrYpcmOfUnWp"
name = f"helixlife-AI-daily-{date_str}" # 使用 f-string 格式化日期
file_list, _ = feishu_drive_api_handler.get_folder_files(folder_token, page_size=10) # 解包元组,忽略第二个元素

Expand Down Expand Up @@ -316,7 +315,7 @@ def process_multiple_dates(document_id, blocks, date_block_ids, file_block_ids,
:param block_ids_list: 每个项目的 block_id 列表
:param days_to_process: 要处理的天数
"""
today = datetime.now(timezone.utc)+timedelta(hours=8)
today = datetime.now(timezone.utc)

for i in range(len(date_block_ids)):
# 获取开始日期
Expand Down

0 comments on commit 8b94852

Please sign in to comment.