save-hukamnama #546
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: save-hukamnama | |
on: | |
schedule: | |
# Hukamnama is usually given to us at ~4:55am IST in the morning | |
# ∴ run this at 23:40 UTC to catch it with a bit of a buffer | |
# - cron: "50 23 * * *" | |
# backup in case the first one misses it | |
- cron: "10 00 * * *" | |
jobs: | |
save-hukamnama: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Get today's Hukamnama | |
run: ./save.sh | |
- name: Committing back to the repo | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
# github actions valid email https://github.com/orgs/community/discussions/26560 | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config user.name "github-actions[bot]" | |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | |
git fetch origin main | |
git status | |
git add . | |
git commit -m "Adds Hukamnama for $(date '+%Y-%m-%d') (GitHub actions)" | |
git push origin HEAD:main |