Files
wehub-resource-sync 070959e133
landing-page-staging / Deploy landing page to staging (push) Has been skipped
landing-page-ci / Validate landing page (push) Failing after 4s
visual-baseline / Capture visual baselines (push) Has been cancelled
bake-plugin-previews / Bake plugin previews (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:00:47 +08:00

66 lines
2.3 KiB
YAML

name: tutorials-youtube-sync
on:
# Daily sweep for new community YouTube tutorials about Open Design. New
# candidates are posted to Feishu for a maintainer to review — this workflow
# does NOT generate entries or open PRs. A maintainer replies with which
# candidates to publish, and the selected videos are turned into entries via
# scripts/youtube-tutorials/generate-selected.ts (run by a maintainer, who
# opens the PR).
schedule:
- cron: '30 2 * * *'
# Manual trigger: force a sweep outside the daily schedule. Leave days empty to
# use the same gap-free watermark (since the last successful run) the schedule
# uses; set it to force a fixed N-day catch-up window.
workflow_dispatch:
inputs:
days:
description: 'Override lookback window in days (blank = since last successful run)'
required: false
default: ''
permissions:
contents: read
# Read this workflow's own run history to derive a gap-free window start.
actions: read
# Read open tutorial-submission issues and contribution PRs for the digest.
issues: read
pull-requests: read
concurrency:
group: tutorials-youtube-sync
cancel-in-progress: true
jobs:
notify:
name: Post tutorial candidates to Feishu
if: github.repository == 'nexu-io/open-design'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '24'
- name: Discover candidates and post Feishu digest
working-directory: apps/landing-page
env:
GITHUB_TOKEN: ${{ github.token }}
YOUTUBE_API_KEY: ${{ secrets.YOUTUBE_API_KEY }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
ANTHROPIC_AUTH_TOKEN: ${{ secrets.ANTHROPIC_AUTH_TOKEN }}
ANTHROPIC_BASE_URL: ${{ secrets.ANTHROPIC_BASE_URL }}
FEISHU_TUTORIALS_WEBHOOK: ${{ secrets.FEISHU_TUTORIALS_WEBHOOK }}
FEISHU_TUTORIALS_SECRET: ${{ secrets.FEISHU_TUTORIALS_SECRET }}
DAYS_OVERRIDE: ${{ github.event.inputs.days }}
run: |
if [ -n "$DAYS_OVERRIDE" ]; then
npx --yes tsx@4.22.3 scripts/youtube-tutorials/notify-candidates.ts --days "$DAYS_OVERRIDE"
else
npx --yes tsx@4.22.3 scripts/youtube-tutorials/notify-candidates.ts
fi