Skip to content

Suno Balance Monitor #270

Suno Balance Monitor

Suno Balance Monitor #270

Workflow file for this run

name: Suno Balance Monitor
on:
schedule:
- cron: '0 */2 * * *' # 每两小时执行一次
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
# 在这里定义非敏感的环境变量
# 添加权限配置
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
env:
# 在 job 级别定义环境变量
JOB_SPECIFIC_VAR: value
steps:
- uses: actions/checkout@v3
with:
# 确保我们有完整的 git 历史
fetch-depth: 0
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Build and Run
env:
# 使用 GitHub Secrets 存储敏感信息
AUTHORIZATION: ${{ secrets.AUTHORIZATION }}
APP_ID: ${{ secrets.APP_ID }} # 如果 ID 是敏感信息,使用 secrets
run: |
cargo build --verbose
cargo run --verbose
- name: Run tests
run: cargo test --verbose
- name: Run
env:
AUTHORIZATION: ${{ secrets.AUTHORIZATION }}
APP_ID: ${{ secrets.APP_ID }}
run: cargo run --verbose
- name: Commit and push changes
run: |
git config --local user.email "kevinxft@gmailcom"
git config --local user.name "kevinxft"
git add .
git commit -m "Update data for $(date +'%Y-%m-%d')"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}