I am trying to create a git hook checking on pull request before merge. I was really happy to see there is an env variable GITEA_PR_ID set by gitea. Unfortunately the value in this variable is not pull request number I was hoping for (e.g. 15 for refs/pull/15/head), but there is stored some internal DB pull request auto-increment ID which I don’t know how to use for the hook purpose.
I am curious if this is a bug and the variable is populated with wrong ID by mistake, or if I am missing something. If the later please can you help me to understand how to get pull request number as git understands it in the pre-receive hook?