-
Notifications
You must be signed in to change notification settings - Fork 5
37 lines (35 loc) · 1.1 KB
/
getCurrentDay.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: GetCurrentDay
on:
schedule:
# Run at 00:01 UTC-5 from 1-25 december. Note that github actions are UTC
- cron: '1 5 1-25 12 *'
workflow_dispatch:
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: Generate config
run: npm run generate-config
- 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