Skip to content

Update Stream Data #431

Update Stream Data

Update Stream Data #431

name: Update Stream Data
on:
schedule:
# 1時間ごと(毎時5分)
- cron: "5 * * * *"
workflow_dispatch: # 手動実行も可能
jobs:
update-streams:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Fetch streams
env:
YOUTUBE_API_KEY: ${{ secrets.YOUTUBE_API_KEY }}
TWITCH_CLIENT_ID: ${{ secrets.TWITCH_CLIENT_ID }}
TWITCH_CLIENT_SECRET: ${{ secrets.TWITCH_CLIENT_SECRET }}
TEST_LIMIT: 999
run: npm run fetch:streams
- name: Commit and push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add data/streams.json
if git diff --cached --quiet; then
echo "No changes to commit"
else
git commit -m "chore: update stream data"
git push
fi