diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 6bce011..0e76945 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -19,9 +19,11 @@ jobs: with: fetch-depth: 0 submodules: recursive - - name: Get new commits + - name: Get new commits since last successful run id: commits - run: echo "NEW_COMMIT_COUNT=$(git log --oneline --since '24 hours ago' | wc -l)" >> $GITHUB_OUTPUT + run: | + COUNT=$(gh api -H 'Accept: application/vnd.github+json' -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/technyon/nuki_hub/actions/workflows/nightly.yml/runs?status=success | jq '.workflow_runs[0].created_at') + echo "NEW_COMMIT_COUNT=$(git log --oneline --since $COUNT | wc -l)" >> $GITHUB_OUTPUT build: name: Build ${{ matrix.board }} (${{ matrix.build }}) needs: check-commits