Skip to content

Daily Runner

Daily Runner #4

Workflow file for this run

name: Daily Runner
on:
schedule:
- cron: '0 0 * * *' # Runs at 00:00 UTC every day
workflow_dispatch: # Also allows manual triggering
jobs:
run-and-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Run cargo
run: cargo run
- name: Check for changes
id: git-check
run: |
git add result.json
git diff --staged --quiet || echo "changed=true" >> $GITHUB_ENV
- name: Commit changes
if: job.run-and-commit.steps.git-check.env.changed == 'true'
run: |
git config --global user.name 'GitHub Actions Bot'
git config --global user.email '[email protected]'
git commit -m "Auto-update result.json"
git push