Fetch Doodles Data #397
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: 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 |