-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (29 loc) · 998 Bytes
/
fetchData.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
name: Fetch Doodles Data
on:
schedule:
- cron: '0 0 * * *' # Run at 00:00 UTC every day
workflow_dispatch: # Manual trigger
jobs:
fetch_data:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '14' # Use Node.js version compatible with your code
- name: Install Dependencies
run: npm install
- name: Run Data Fetch Script
run: node index.js
- name: Set Commit Message
run: |
# Set the commit message with the current date in DD/MM/YYYY format
COMMIT_MESSAGE="Update Doodles Data ($(date +'%d/%m/%Y'))"
echo "$COMMIT_MESSAGE" > commit_message.txt
git config --global user.name "Yasya El Hakim"
git config --global user.email "yasyaelhakim@gmail.com"
git add .
git commit -F commit_message.txt
git push