Skip to content

Commit b167a8a

Browse files
committed
Check if needing to run
1 parent d96d815 commit b167a8a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/cron.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,20 @@ jobs:
3434
run: |
3535
echo "last_run_id=$((${{ github.run_id }} - 1))" >> $GITHUB_OUTPUT
3636
- name: Download last run commit hashes
37+
continue-on-error: true
3738
uses: actions/download-artifact@v4
3839
with:
3940
name: commit-hashes.txt
4041
path: previous-run-hashes.txt
4142
github-token: ${{ secrets.GITHUB_TOKEN }}
4243
# Previous run
4344
run-id: ${{ job.get_last_id.last_run_id }}
45+
- name: Check if run needed
46+
run: |
47+
if [ ! -f previous-run-hashes.txt ]; then
48+
echo "No previous run hashes, need to re-run"
49+
elif cmp -s commit-hashes.txt previous-run-hashes.txt; then
50+
echo "Previous run hash same as this one, no need to re-run"
51+
else
52+
echo "Previous run hash different, need to re-run"
53+
fi

0 commit comments

Comments
 (0)