Files
chinese-independent-developer/.github/workflows/trigger_claude_routine.yml

23 lines
663 B
YAML

name: 触发 Claude Routine
on:
schedule:
- cron: '0 */6 * * *'
workflow_dispatch:
jobs:
trigger:
runs-on: ubuntu-latest
steps:
- name: 触发 Claude Routine
run: |
response=$(curl -s -X POST "https://api.anthropic.com/v1/claude_code/routines/trig_01QqQ9rpKCEVLB5R78v83umP/fire" \
-H "Authorization: Bearer ${{ secrets.CLAUDE_ROUTINE_TOKEN }}" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json")
echo "$response"
if echo "$response" | grep -q '"type":"error"'; then
echo "API returned an error"
exit 1
fi