Interview Prep/CI/CD/GitHub Actions

How do you give a job read access to a private repo that holds shared Terraform modules?

IntermediateScenarioGitHub Actions
Answer

Situation read → GITHUB_TOKEN is scoped to the current repo only.

What I'd do →

  1. Prefer a GitHub App: create an installation token with actions/create-github-app-token@v1 limited to the module repo.
  2. Alternative: a read-only deploy key per repo; avoid a broad PAT.
  3. Use the token in actions/checkout with repository: and token: inputs.

Why → An app token is short-lived and repo-scoped, independent of any user.

Interview tip → Same principle as Jenkins GitHub App: avoid PATs.

All CI/CD questions

More on GitHub Actions