Run based on commits since last successful nightly run

This commit is contained in:
iranl
2024-08-11 23:06:40 +02:00
committed by GitHub
parent 720165ac59
commit d2f1012d1d

View File

@@ -19,9 +19,11 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
submodules: recursive submodules: recursive
- name: Get new commits - name: Get new commits since last successful run
id: commits 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: build:
name: Build ${{ matrix.board }} (${{ matrix.build }}) name: Build ${{ matrix.board }} (${{ matrix.build }})
needs: check-commits needs: check-commits