Skip to content

Node.js Cron Job

Node.js Cron Job #1906

Workflow file for this run

name: Node.js Cron Job
on:
schedule:
# Runs at the 0th minute of every 4th hour
- cron: '0 */4 * * *'
jobs:
node-job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '19.x'
- name: Install dependencies
run: npm install
- name: Run Node.js script
run: node run.js
- name: Commit output file
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Update log file"
file_pattern: out/*.* store/*.json