A called reusable workflow needs a Sonar token, an npm token and AWS access. How do you pass them?
AdvancedScenarioReuse at Scale: Reusable Workflows & Actions
Answer
Situation read → Secrets plus cloud identity across a workflow boundary.
What I'd do →
- Declare named secrets in
workflow_call.secrets(SONAR_TOKEN,NPM_TOKEN) and pass explicitly from the caller. - No AWS secret at all: caller job grants
id-token: write, the called workflow runsconfigure-aws-credentialswith a role ARN input. - Trust policy can pin to the reusable workflow via
job_workflow_refclaim if the org customizessub.
Why → Explicit secrets document the contract; OIDC removes the most dangerous secret.
Interview tip → Mention why secrets: inherit is avoided across team boundaries.
More on Reuse at Scale: Reusable Workflows & Actions
Forty microservice repos each have a slightly different copy of the same build workflow. How do you standardize?IntermediateA team wants to share "checkout, setup Java, Maven cache, run Sonar" steps. Reusable workflow or composite action?BeginnerA shared reusable workflow change broke 120 pipelines on Monday. How do you prevent a repeat?IntermediateYou want to ensure only the central deploy workflow can assume the production AWS role, not arbitrary workflows in app repos. How?AdvancedYou need an action that comments a Terraform plan summary on PRs and must work on Linux and Windows. Which kind?BeginnerA reusable workflow needs to return the deployed URL to the caller. How?Beginner