Skip to content

Daily Answer Script #123

Daily Answer Script

Daily Answer Script #123

Workflow file for this run

name: Daily Answer Script
on:
schedule:
- cron: "30 22 * * *"
workflow_dispatch:
inputs:
account:
description: "账号"
required: false
password:
description: "密码"
required: false
date:
description: "日期"
required: false
env:
ACCOUNT: ${{ github.event.inputs.account || secrets.ACCOUNT }}
PASSWORD: ${{ github.event.inputs.password || secrets.PASSWORD }}
KEY: ${{ secrets.KEY }}
IV: ${{ secrets.IV }}
DATE: ${{ github.event.inputs.date }}
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
jobs:
run-script:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: bun install
- name: Run Answer Script and Send Telegram Message
run: |
bun run index.ts || true
output=$(cat output.txt)
curl -s -X POST https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage -d chat_id=${TELEGRAM_CHAT_ID} -d text="$output"