Dependabot PRs fail because secrets are empty. Why, and what do you do?
BeginnerScenarioSecrets, OIDC & Environments
Answer
Situation read → Dependabot-triggered runs use Dependabot secrets, not Actions secrets, and get a read-only token.
What I'd do →
- Add needed secrets under Settings, Secrets, Dependabot (for example a private registry token).
- Skip steps that need write or deploy access when
github.actor == 'dependabot[bot]'. - For auto-merge, use a separate
pull_request_targetworkflow that only calls the API (no code checkout) withdependabot/fetch-metadata.
Why → Dependabot PR code is treated as untrusted, like fork code.
Interview tip → Know that Dependabot has its own secret store.
More on Secrets, OIDC & Environments
You find AWS access keys stored as repo secrets in 25 repos. Plan the migration.IntermediateA developer asks to print a secret in the log "just once" to debug. What do you do instead?BeginnerStaging and prod need different database URLs and different AWS roles, using one workflow. How?BeginnerSecurity requires two people for prod deploys: the author cannot approve. Configure it.BeginnerWrite the AWS trust policy for a role used only by the prod deploy job of one repo.IntermediatePR workflows need read-only AWS access for `terraform plan`, including from same-repo branches. How do you set trust?Advanced