From 66730cef3064b4daff762eacc050b3b7ad925b1f Mon Sep 17 00:00:00 2001 From: Jacques Gagnon Date: Sat, 14 Dec 2024 14:53:15 -0500 Subject: [PATCH] [ACTIONS] Run build once a day if change made that day --- .github/workflows/build.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c2624a44..173441e4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,10 +1,8 @@ name: build on: - push: - branches: [ master ] - pull_request: - branches: [ master ] workflow_dispatch: + schedule: + - cron: '0 10 * * *' jobs: build: @@ -36,6 +34,11 @@ jobs: with: submodules: recursive fetch-depth: 0 + - name: Cron needed check + if: github.event_name == 'schedule' + run: if [[ "$(git log --oneline --since '24 hours ago' | wc -l)" == "0" ]]; then gh run cancel ${{ github.run_id }}; gh run watch ${{ github.run_id }}; fi + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Build with ESP-IDF shell: bash run: |