Just try the below steps.The DRONE_PULL_REQUEST environment variable has the pull request number.
You can see a list of all environment variables by dumping them to your build logs. This can be done by adding the env command to your yaml:
pipeline:
build:
image: golang
commands:
- env # dump environment variables
You will see something like this in your build logs:
...
DRONE_PULL_REQUEST=42
DRONE_BUILD_EVENT=pull_request
...
Note that the pull request is only set when Drone is building a pull request hook. You can confirm this by looking at the build event environment variable.
I hope the above explanation will be helpful to you.