Skip to content

Commit

Permalink
Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
wence- committed Nov 22, 2024
1 parent 52f6d2e commit 2f6346c
Showing 1 changed file with 28 additions and 20 deletions.
48 changes: 28 additions & 20 deletions .github/workflows/cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,33 @@ jobs:
name: commit-hashes.txt
path: commit-hashes.txt
# TODO: This one is wrong, need to use the REST API to get the most recently uploaded artifact id.
- name: Get last run id
id: get_last_id
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
- name: Setup python
uses: actions/setup-python@v5
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
python-version: 3.12
- name: Checkout ourselves
uses: actions/checkout@v4
- name: Stuff
id: get_last_id
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
pip install requests
python get.py ${{ secrets.GITHUB_TOKEN }}
# 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 2f6346c

Please sign in to comment.