Run Today #363
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run Today | |
on: | |
push: | |
branches: | |
- main | |
# run every day at 4am UTC which is 11pm EST | |
# TODO: does that work correctly for daylight savings? | |
schedule: | |
- cron: "0 3 * * *" | |
# set environment variables from github secrets | |
env: | |
GARMIN_TOKENS: ${{ secrets.GARMIN_TOKENS }} | |
# allow action to push to repo | |
permissions: | |
contents: write | |
jobs: | |
run: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: cachix/install-nix-action@v23 | |
- name: Configure Git | |
run: | | |
git config --global user.email "ian@beckr.dev" | |
git config --global user.name "Ian Becker" | |
- name: Check if I ran today and update streak.json | |
run: | | |
nix develop --impure --command just ran | |
- name: Commit streak to GitHub if it changed | |
run: | | |
git diff --quiet HEAD -- streak.json || (git commit -m "chore: updates streak.json" streak.json && git push origin main) |