Skip to main content
InterviewHubPRO
Section Overview
Q36

Question 36 of 50

Part 3: Enterprise Scale, Compliance & Production Hardening (Senior / Staff)

72%
CI/CD & GitHub Actions (50 Qs)•Part 3: Enterprise Scale, Compliance & Production Hardening (Senior / Staff)

GitHub Actions Reusable Workflows vs Composite Actions: Key differences and selection criteria.

senior LevelCode ExampleState ManagementCI/CD & DevOps

In Simple Words:

  • Reusable Workflows (workflow_call): Entire parameterized pipeline workflows defined in .github/workflows/. They run on their own separate runners, support secret inheritance, environment protection gates, and multi-job execution.
  • Composite Actions (action.yml): Bundles multiple shell steps into a single reusable action within the same job/runner. Best for packaging frequently repeated tasks (e.g., setup toolchain + authenticate + cache).
FeatureReusable Workflows (workflow_call)Composite Actions (action.yml)
ScopeCross-job orchestration (contains multiple jobs)Step-level (runs within an existing job)
RunnerCan define new and independent runs-on targetsExecutes inside the caller job's runner
Secrets AccessExplicit input or secrets: inheritInputs passed as standard arguments
File Location.github/workflows/*.ymlRoot or subfolder containing action.yml
yaml
# Reusable Workflow Caller
jobs:
  call-deploy:
    uses: my-org/shared-workflows/.github/workflows/deploy.yml@v2
    with:
      environment: production
    secrets: inherit