feat: AIニュース自動収集・分析ツールを追加
Made-with: Cursor
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
name: Daily AI News
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
use_sample_data:
|
||||
description: 'fixtures/sample-tweets.json を使って動作確認する(X連携なし)'
|
||||
type: boolean
|
||||
default: false
|
||||
schedule:
|
||||
- cron: '30 22 * * *' # 毎日 07:30 JST
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: daily-news
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
run:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
- uses: actions/setup-node@v5
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
cache: 'npm'
|
||||
|
||||
- run: npm ci
|
||||
|
||||
- run: npm start
|
||||
env:
|
||||
USE_SAMPLE_DATA: ${{ inputs.use_sample_data }}
|
||||
X_CONSUMER_KEY: ${{ secrets.X_CONSUMER_KEY }}
|
||||
X_CONSUMER_SECRET: ${{ secrets.X_CONSUMER_SECRET }}
|
||||
X_ACCESS_TOKEN: ${{ secrets.X_ACCESS_TOKEN }}
|
||||
X_ACCESS_TOKEN_SECRET: ${{ secrets.X_ACCESS_TOKEN_SECRET }}
|
||||
JINA_API_KEY: ${{ secrets.JINA_API_KEY }}
|
||||
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
|
||||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
|
||||
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
|
||||
|
||||
- name: Notify failure to Slack
|
||||
if: failure()
|
||||
run: |
|
||||
curl -X POST "https://slack.com/api/chat.postMessage" \
|
||||
-H "Authorization: Bearer $SLACK_BOT_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"channel": "'"${SLACK_CHANNEL}"'",
|
||||
"text": ":x: *AIニュース エラー発生*\nワークフロー実行: <'"${FAILED_RUN_URL}"'|詳細を確認>"
|
||||
}'
|
||||
env:
|
||||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
|
||||
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
|
||||
FAILED_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||
Reference in New Issue
Block a user