Skip to content

Get Earnings Calendar Data #9

Get Earnings Calendar Data

Get Earnings Calendar Data #9

Workflow file for this run

name: Get Earnings Calendar Data
on:
schedule:
- cron: '*/30 * * * *'
jobs:
run-scripts:
runs-on: ubuntu-latest
environment: OhEarningsCal
steps:
- uses: actions/checkout@v4
- name: Reset local changes
run: |
git fetch origin main
git reset --hard origin/main
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm install
- name: Run fetchEarningsCalendarData script
run: node ./api/github_get.js
env:
SHOULD_GEN_SELECTED: ${{ vars.SHOULD_GEN_SELECTED }}
SHOULD_GEN_ALL: ${{ vars.SHOULD_GEN_ALL }}
- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add -A
CURRENT_DATE=$(date +"%Y-%m-%d")
git commit -m "Auto update earnings files - $CURRENT_DATE" -a || echo "No changes to commit"
git push --force