diff --git a/.github/workflows/cron.yaml b/.github/workflows/cron.yaml index fef9d2f..a1b28ac 100644 --- a/.github/workflows/cron.yaml +++ b/.github/workflows/cron.yaml @@ -34,6 +34,7 @@ jobs: run: | echo "last_run_id=$((${{ github.run_id }} - 1))" >> $GITHUB_OUTPUT - name: Download last run commit hashes + continue-on-error: true uses: actions/download-artifact@v4 with: name: commit-hashes.txt @@ -41,3 +42,12 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} # Previous run run-id: ${{ job.get_last_id.last_run_id }} + - name: Check if run needed + run: | + if [ ! -f previous-run-hashes.txt ]; then + echo "No previous run hashes, need to re-run" + elif cmp -s commit-hashes.txt previous-run-hashes.txt; then + echo "Previous run hash same as this one, no need to re-run" + else + echo "Previous run hash different, need to re-run" + fi