Interview Prep/GitHub Actions/Security Hardening & Supply Chain

A third-party action requires `contents: write` but you only want it to read. What do you do?

IntermediateScenarioSecurity Hardening & Supply Chain
Answer

Situation read → Over-privileged dependency.

What I'd do →

  1. Read its code to understand why; often a feature you do not use (auto-commit).
  2. Run it in a separate job with permissions: contents: read and see if it works with its write feature disabled.
  3. If it truly needs write for a read use case, replace it.

Why → Granting write to a third-party action lets it modify your code or releases.

Interview tip → "Permissions are per job, so isolate risky actions in their own job."

All GitHub Actions questions Roadmap: GitHub Actions

More on Security Hardening & Supply Chain