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:
@@ -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("")
|
||||
|
||||
Reference in New Issue
Block a user