Skip to content

Commit

Permalink
Check if needing to run
Browse files Browse the repository at this point in the history
  • Loading branch information
wence- committed Nov 20, 2024
1 parent d96d815 commit b167a8a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,20 @@ 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
path: previous-run-hashes.txt
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

0 comments on commit b167a8a

Please sign in to comment.