Today Prayer Times Update #495
This file contains hidden or 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: Today Prayer Times Update | |
| on: | |
| schedule: | |
| # job is 1 minute before midnight so that changes can be seen at midnight by users (job takes a minute or two) | |
| - cron: '59 4 * * *' # 04:59 AM UTC / 11:59 PM Toronto | |
| workflow_dispatch: # Allows manual triggering | |
| jobs: | |
| update_today_csv: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Get full repository history to preserve all commits | |
| # fetch-depth: 0 ensures we don't truncate history | |
| - name: Checkout Repository | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| # Set up Git identity for the automated commit | |
| # This identity will appear in Git history for tracking | |
| - name: Configure Git | |
| run: | | |
| git config user.name "GitHub Actions" | |
| git config user.email "actions@github.com" | |
| # Update today's prayer times by copying from tomorrow's file | |
| # Amends last commit instead of creating new one | |
| - name: Update Today's Prayer Times | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Required for push access | |
| run: | | |
| # Update CSV file | |
| cp data/prayer_times/tomorrow_prayer_times.csv data/prayer_times/today_prayer_times.csv | |
| # Stage only the specific file | |
| git add data/prayer_times/today_prayer_times.csv | |
| # Amend last commit, preserving its message | |
| git commit --amend --no-edit | |
| # Force push with safety check | |
| git push -f origin main |