Workflows triggered by the pull_request_target trigger can read secrets and edit code in the repository that the PR is targeting. This is a dangerous trigger that must be used with caution. For security reasons, GitHub runs these workflows using the code from the base branch, rather than the code from the PR.
If you use this trigger you must not checkout the code of the PR, otherwise anyone can simply write malicious code and get it to run in a context that has access to your secrets, in addition to write access to the repository.
This type of attack is sometimes referred to as “pwn request”.
Note that if you use the “workflow_call” trigger, your workflow is callable by other workflows, so possibly by a workflow using the pull_request_target trigger.