fix: bug: in_progress_recently_added grace period broken — filters timeline by type==7 but Forgejo API returns type as string "label" (#565)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful

This commit is contained in:
Claude 2026-04-10 10:59:06 +00:00
parent d29a19612e
commit 6df0476808

View file

@ -115,11 +115,10 @@ in_progress_recently_added() {
now=$(date +%s)
# Query issue timeline for the most recent in-progress label event.
# Forgejo serializes CommentType as an integer, not a string —
# CommentTypeLabel is 7 in the Gitea/Forgejo enum.
# Forgejo 11.x API returns type as string "label", not integer 7.
label_ts=$(curl -sf -H "Authorization: token ${FORGE_TOKEN}" \
"${API}/issues/${issue}/timeline" | \
jq -r '[.[] | select(.type == 7) | select(.label.name == "in-progress")] | last | .created_at // empty') || true
jq -r '[.[] | select(.type == "label") | select(.label.name == "in-progress")] | last | .created_at // empty') || true
if [ -z "$label_ts" ]; then
return 1 # no label event found — not recently added