You need to push to GHCR and to a second repo's branch from one workflow. Which tokens?
IntermediateScenarioSecrets, OIDC & Environments
Answer
Situation read → One same-repo action, one cross-repo action.
What I'd do →
- GHCR push:
GITHUB_TOKENwithpackages: write(package linked to the repo). - Cross-repo push: GitHub App token from
actions/create-github-app-tokenscoped to the target repo withcontents: write. - Pass the app token only to the step that pushes.
Why → GITHUB_TOKEN cannot write to other repos; App tokens are short-lived and scoped.
Interview tip → Avoid PATs tied to a human account.
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