Interview Prep/Git & GitHub/Secrets, Signing and Security

Which credential type do you use for automation: classic PAT, fine-grained PAT, or a GitHub App?

IntermediateScenarioSecrets, Signing and Security
Answer

Situation read → The credential should be scoped, short-lived and not tied to one person.

What I'd do →

  1. Prefer a GitHub App: repo-scoped permissions, short-lived installation tokens, not tied to a user's seat.
  2. Use GITHUB_TOKEN when the work stays inside one repo.
  3. A fine-grained PAT is acceptable for personal scripts, with expiry and selected repos.
  4. Avoid classic PATs; they are broad and long-lived.

Why → Narrow scope and short life mean less damage if leaked.

Interview tip → "Not tied to a person" is the key org-level argument for Apps.

All Git & GitHub questions Roadmap: Git & GitHub

More on Secrets, Signing and Security