Skip to content

Commit

Permalink
Hate hate hate
Browse files Browse the repository at this point in the history
  • Loading branch information
wence- committed Nov 22, 2024
1 parent d828fb0 commit f633d11
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,20 @@ jobs:
run: |
pip install requests
VAL=$(python utils/get.py)
echo $VAL
echo $VAL >> $GITHUB_OUTPUT
echo "${VAL}"
echo "${VAL}" >> $GITHUB_OUTPUT
- name: Look at output
run: |
echo ${{ fromJSON(steps.get_last_id.outputs.RUN_INFO) }}
- name: Download last run commit hashes
if: ${{ fromJSON(steps.get_last_id.outputs.HAS_LAST_ID) }}
if: ${{ fromJSON(steps.get_last_id.outputs.RUN_INFO)["exists"] }}
continue-on-error: true
uses: actions/download-artifact@v4
with:
name: commit-hashes.txt
path: previous-run-hashes.txt
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ steps.get_last_id.outputs.LAST_RUN_ID }}
- name: Look at output
run:
echo "last id" ${{ steps.get_last_id.outputs.LAST_RUN_ID }}
echo "has id" ${{ steps.get_last_id.outputs.HAS_LAST_ID }}
# - name: Check if run needed
# run: |
# if [ ! -f previous-run-hashes.txt ]; then
Expand Down
8 changes: 5 additions & 3 deletions get.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import requests
import json


def previous_run_id() -> str | None:
Expand All @@ -25,7 +26,8 @@ def previous_run_id() -> str | None:
if __name__ == "__main__":
run_id = previous_run_id()
if run_id is not None:
print(f"LAST_RUN_ID={run_id}")
print("HAS_RUN_ID=true")
info = json.dumps({"id": run_id, "exists": True})
print(f"RUN_INFO={info}")
else:
print("HAS_RUN_ID=false")
info = json.dumps({"exists": False})
print(f"RUN_INFO={info}")

0 comments on commit f633d11

Please sign in to comment.