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 →
- Prefer a GitHub App: repo-scoped permissions, short-lived installation tokens, not tied to a user's seat.
- Use
GITHUB_TOKENwhen the work stays inside one repo. - A fine-grained PAT is acceptable for personal scripts, with expiry and selected repos.
- 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.
More on Secrets, Signing and Security
A developer pushed an AWS access key to a public repo 10 minutes ago. What is your first move?BeginnerAfter rotating the leaked key, you must purge it from repository history. How?AdvancedA push is rejected: "GH013: Repository rule violations found ... Push cannot contain secrets". What do you do?IntermediateSecret scanning alerts have piled up, and many look like false positives or old test credentials.IntermediateYou must set up signed commits on your laptop. Which method do you pick?BeginnerYour GPG signing key expires next week. What is the correct way to handle it?Intermediate