GetCurrentDay #28
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: GetCurrentDay | |
on: | |
schedule: | |
# Run at 00:10 UTC-5 from 1-25 december. Note that github actions are UTC | |
- cron: '10 5 1-25 12 *' | |
jobs: | |
# run the prepare_day.js script and commit & push changes | |
prepare_day: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js 20.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm install | |
- name: Prepare day | |
# Yes its hacky but idc | |
run: node ./prepare_day.js today ${{ secrets.SESSION_COOKIE }} | |
- name: Commit changes | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add . | |
git commit -m "Prepare day $(date +'%d')" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: master |