From f65cfbc2cf69ec94ef03578dc43c1f2897edb7de Mon Sep 17 00:00:00 2001 From: jason5ng32 Date: Sun, 25 Feb 2024 19:40:47 +0800 Subject: [PATCH] 2 --- .github/workflows/autogen.yml | 14 ++++++++++---- .github/workflows/autoget.yml | 11 ++++++++--- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/autogen.yml b/.github/workflows/autogen.yml index f4fba166f..2e4f9e6ad 100644 --- a/.github/workflows/autogen.yml +++ b/.github/workflows/autogen.yml @@ -2,7 +2,7 @@ name: Generate ics files on: schedule: - - cron: '*/30 * * * *' + - cron: '*/8 * * * *' jobs: run-scripts: @@ -11,6 +11,11 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Reset local changes + run: | + git fetch origin main + git reset --hard origin/main + - name: Set up Node.js uses: actions/setup-node@v2 with: @@ -22,8 +27,8 @@ jobs: - name: Run genAllIcs script run: node ./api/github_gen.js env: - SHOULD_GEN_SELECTED: ${{ secrets.SHOULD_GEN_SELECTED }} - SHOULD_GEN_ALL: ${{ secrets.SHOULD_GEN_ALL }} + SHOULD_GEN_SELECTED: ${{ vars.SHOULD_GEN_SELECTED }} + SHOULD_GEN_ALL: ${{ vars.SHOULD_GEN_ALL }} - name: Commit files run: | @@ -31,4 +36,5 @@ jobs: git config --local user.name "GitHub Action" git add -A git commit -m "Auto generated ics files" -a || echo "No changes to commit" - git push + git push --force + diff --git a/.github/workflows/autoget.yml b/.github/workflows/autoget.yml index 4d52d728b..8bec3fdb5 100644 --- a/.github/workflows/autoget.yml +++ b/.github/workflows/autoget.yml @@ -2,7 +2,7 @@ name: Get Earnings Calendar Data on: schedule: - - cron: '*/30 * * * *' + - cron: '*/5 * * * *' jobs: run-scripts: @@ -11,6 +11,11 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Reset local changes + run: | + git fetch origin main + git reset --hard origin/main + - name: Set up Node.js uses: actions/setup-node@v2 with: @@ -22,8 +27,8 @@ jobs: - name: Run fetchEarningsCalendarData script run: node ./api/github_get.js env: - SHOULD_GEN_SELECTED: ${{ secrets.SHOULD_GEN_SELECTED }} - SHOULD_GEN_ALL: ${{ secrets.SHOULD_GEN_ALL }} + SHOULD_GEN_SELECTED: ${{ vars.SHOULD_GEN_SELECTED }} + SHOULD_GEN_ALL: ${{ vars.SHOULD_GEN_ALL }} - name: Commit files run: |