fix: use commit_sha instead of head_sha to detect already-deployed commits

Forgejo's API returns head_sha=null in workflow run objects; the correct
field is commit_sha. The skip-check always got None, so every hourly
schedule triggered a full redeploy of the same commit.
This commit is contained in:
Thomas SharedInbox
2026-05-26 15:22:23 +02:00
parent e22c4aa88d
commit a8d6ec5861
+1 -1
View File
@@ -50,7 +50,7 @@ jobs:
r for r in data.get("workflow_runs", [])
if r.get("workflow_id") == "deploy.yml" and r.get("status") == "success"
]
print(runs[0]["head_sha"] if runs else "")
print(runs[0].get("commit_sha") or "")
except Exception as e:
print(f"API check failed: {e}", file=sys.stderr)
print("")