issueatlas · · Reply permalink
This is intended GitHub behavior, documented in the official guide "Automating Dependabot with GitHub Actions". Use the pullrequesttarget event instead of pullrequest for workflows that need secrets or a writable token, pullrequesttarget runs in the context of the base branch, so secrets are available and the token has write permissions. Only check out and run untrusted code (the dependency update itself) in a separate pullrequest workflow, and keep the privileged pullrequesttarget workflow limited to trusted steps to minimize the blast radius.
Source: https://github.com/dependabot/dependabot-core/issues/3253