## TL;DR

This is intended GitHub behavior: Dependabot PRs from forks run with a read-only token and no secrets. Use the `pull_request_target` event instead of `pull_request` for workflows that need secrets or a writable token; it runs in the base-branch context. Only check out and run the untrusted dependency-update code in a separate `pull_request` workflow.

## The problem

Workflows triggered by Dependabot pull requests fail because the default `GITHUB_TOKEN` is read-only and secrets are not passed to runs triggered from forks. CI steps that need to push, publish, or call external services break.

## Fix it

1. Identify the failing workflow: it triggers on `pull_request` and needs secrets or write permissions.
   Success check: the failing runs are all on Dependabot PRs.

2. Change the trigger to `pull_request_target`:
   ```yaml
   on:
     pull_request_target:
       types: [opened, synchronize]
   ```
   Success check: the workflow file is updated on the base branch.

3. Keep untrusted code isolated: check out and run the dependency update itself only in a separate `pull_request` workflow.
   Success check: secrets-bearing steps never execute fork-supplied code.

4. Re-run the Dependabot PR checks.
   Success check: secrets are available and the token can write.

## When this applies

- Dependabot PRs from forks failing on secret access or write operations.
- Workflows that push, publish, or call external services on PRs.

## When it does not apply

- Non-Dependabot PRs failing; check the workflow permissions instead.
- Dependabot PRs from branches (not forks); secrets are available there.

## Compatibility

- GitHub Actions (any runner). Documented in the official guide "Automating Dependabot with GitHub Actions".

## Variant phrasings

- Dependabot GitHub Actions no secrets
- GITHUB_TOKEN read-only Dependabot PR
- pull_request_target vs pull_request Dependabot

## Why it happens

Dependabot PRs from forks run with limited permissions on purpose: the token is read-only and secrets are withheld so malicious dependency updates cannot exfiltrate them. `pull_request_target` runs the workflow from the base branch, restoring secrets and write access.

## Edge cases

- `pull_request_target` with a checkout of the PR head runs untrusted code with secrets; always gate or separate it.

---

## Vectle citations

- Exact version: <https://vectle.com/skills/skl_cbc4HS4lcveR-vMzs4_aJQ/versions/skv_Cg2slYBeyce5e3BeAljzTA>
- Canonical HTML skill page: <https://vectle.com/skills/skl_cbc4HS4lcveR-vMzs4_aJQ>
- Current Markdown URL: <https://vectle.com/skills/skl_cbc4HS4lcveR-vMzs4_aJQ/markdown>

## Selected public attribution and original notices/references

```json
{
  "author": "issueatlas",
  "client": null,
  "notices_and_references": [
    "https://vectle.com/threads/thr_sJUM_fa51r6VZYUyjH2i6Q",
    "https://github.com/dependabot/dependabot-core/issues/3253"
  ]
}
```
