diff --git a/ansible/roles/forgejo_metrics/templates/forgejo-metrics.sh.j2 b/ansible/roles/forgejo_metrics/templates/forgejo-metrics.sh.j2 index 0afb488..365b62b 100644 --- a/ansible/roles/forgejo_metrics/templates/forgejo-metrics.sh.j2 +++ b/ansible/roles/forgejo_metrics/templates/forgejo-metrics.sh.j2 @@ -18,7 +18,8 @@ api() { } # jq helper: convert ISO 8601 timestamp (with any tz offset) to epoch seconds -JQ_EPOCH='def epoch: sub("[.][0-9]+"; "") | sub("[+-][0-9][0-9]:[0-9][0-9]$"; "Z") | sub("ZZ$"; "Z") | fromdate;' +# jq's fromdate only handles Z, so we parse the offset and apply it manually +JQ_EPOCH='def epoch: sub("[.][0-9]+"; "") | if test("[+-][0-9]{2}:[0-9]{2}$") then capture("^(?