Accessing secrets variables preset in the repository in CI

I’ve recently been learning how to use github actions. I’ve set up secrets variables in my repository, and created a workflow triggered by pull_request by submitting a pull request from an external developer. At this point, the repository has a secrets variable set up and a workflow. When an external developer submits a pull request to the repository, this workflow is triggered, but the secrets variable cannot be accessed. Why?
I’ve also observed that the

pull.yaml

workflow of pytorch is triggered by pull_request, but can access the HUGGING_FACE_HUB_TOKEN variable, which should be a secrets variable pre-set in the repository. In my repository, only pull_request_target is set to trigger the access to the secrets variable.