fix: use Forgejo integer CommentType (7) instead of string "label" in timeline query
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful

Forgejo's timeline API serializes CommentType as an integer enum, not a
string. CommentTypeLabel is 7. The previous .type == "label" filter never
matched, making the grace period a no-op.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude 2026-04-09 14:57:14 +00:00
parent 8679332756
commit 96aeb549c0

View file

@ -114,10 +114,12 @@ in_progress_recently_added() {
now=$(date +%s)
# Query issue timeline for the most recent in-progress label event
# 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.
label_ts=$(curl -sf -H "Authorization: token ${FORGE_TOKEN}" \
"${API}/issues/${issue}/timeline" | \
jq -r '[.[] | select(.type == "label") | select(.label.name == "in-progress")] | last | .created_at // empty') || true
jq -r '[.[] | select(.type == 7) | select(.label.name == "in-progress")] | last | .created_at // empty') || true
if [ -z "$label_ts" ]; then
return 1 # no label event found — not recently added